diff --git "a/partition_69.json" "b/partition_69.json" new file mode 100644--- /dev/null +++ "b/partition_69.json" @@ -0,0 +1,78433 @@ +[ + { + "hash": "961f7f5348dce942991e98e48a966f458bb26273", + "msg": "Merged r1773:1791 branch of numpy into main trunk", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-04T22:57:46+00:00", + "author_timezone": 0, + "committer_date": "2006-01-04T22:57:46+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": true, + "parents": [ + "6d9c86cde543110e1b5937e2b217eb1374ee9adf", + "0f05f3848fddb57a5ae895d8ac0f9d728ab8a9ed" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1380, + "insertions": 1475, + "lines": 2855, + "files": 336, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null + }, + { + "hash": "be4d973ac0fa792c7e072408c2e2a895853ccdbf", + "msg": "Fixed version issue..", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-04T23:20:44+00:00", + "author_timezone": 0, + "committer_date": "2006-01-04T23:20:44+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "961f7f5348dce942991e98e48a966f458bb26273" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 2, + "insertions": 2, + "lines": 4, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/f2py/f2py2e.py", + "new_path": "numpy/f2py/f2py2e.py", + "filename": "f2py2e.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -36,7 +36,7 @@\n outmess = auxfuncs.outmess\n \n try:\n- from numpy import __core_version__ as numpy_core_version\n+ from numpy import __version__ as numpy_version\n except ImportError:\n numpy_distutils_version = 'N/A'\n \n@@ -164,7 +164,7 @@\n Requires: Python 2.3 or higher.\n License: LGPL (see http://www.fsf.org)\n Copyright 1999 - 2005 Pearu Peterson all rights reserved.\n-http://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_core_version)\n+http://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n \n \n def scaninputline(inputline):\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __version__ as numpy_version\nexcept ImportError:\n numpy_distutils_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy_core Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __core_version__ as numpy_core_version\nexcept ImportError:\n numpy_distutils_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy_core Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_core_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "methods": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 495, + "complexity": 129, + "token_count": 3030, + "diff_parsed": { + "added": [ + " from numpy import __version__ as numpy_version", + "http://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)" + ], + "deleted": [ + " from numpy import __core_version__ as numpy_core_version", + "http://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_core_version)" + ] + } + } + ] + }, + { + "hash": "c5b355719e9ee893362d8c6fa8f12fc32f3dc2b4", + "msg": "Fixed name issue.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-04T23:34:09+00:00", + "author_timezone": 0, + "committer_date": "2006-01-04T23:34:09+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "be4d973ac0fa792c7e072408c2e2a895853ccdbf" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1, + "insertions": 1, + "lines": 2, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/f2py/f2py2e.py", + "new_path": "numpy/f2py/f2py2e.py", + "filename": "f2py2e.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -38,7 +38,7 @@\n try:\n from numpy import __version__ as numpy_version\n except ImportError:\n- numpy_distutils_version = 'N/A'\n+ numpy_version = 'N/A'\n \n __usage__ = \"\"\"\\\n Usage:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __version__ as numpy_version\nexcept ImportError:\n numpy_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy_core Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __version__ as numpy_version\nexcept ImportError:\n numpy_distutils_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy_core Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "methods": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 495, + "complexity": 129, + "token_count": 3030, + "diff_parsed": { + "added": [ + " numpy_version = 'N/A'" + ], + "deleted": [ + " numpy_distutils_version = 'N/A'" + ] + } + } + ] + }, + { + "hash": "75077ce6023283d25222768f177e52c5cd0a7904", + "msg": "Fixed import errors.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-04T23:38:48+00:00", + "author_timezone": 0, + "committer_date": "2006-01-04T23:38:48+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "c5b355719e9ee893362d8c6fa8f12fc32f3dc2b4" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 5, + "insertions": 5, + "lines": 10, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/distutils/misc_util.py", + "new_path": "numpy/distutils/misc_util.py", + "filename": "misc_util.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -861,19 +861,19 @@ def get_cmd(cmdname,_cache={}):\n return _cache[cmdname]\n \n def get_numpy_include_dirs():\n- # numpy_include_dirs are set by numpy/base/setup.py, otherwise []\n+ # numpy_include_dirs are set by numpy/core/setup.py, otherwise []\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n if numpy.show_core_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n- 'base','include'))\n+ 'core','include'))\n else:\n # using installed numpy core headers\n- import numpy.base as base\n- include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n- # else running numpy/base/setup.py\n+ import numpy.core as core\n+ include_dirs.append(os.path.join(os.path.dirname(core.__file__),'include'))\n+ # else running numpy/core/setup.py\n return include_dirs\n \n #########################\n", + "added_lines": 5, + "deleted_lines": 5, + "source_code": "import os\nimport re\nimport sys\nimport imp\nimport copy\nimport types\nimport glob\n\ndef allpath(name):\n \"Convert a /-separated pathname to one using the OS's path separator.\"\n splitted = name.split('/')\n return os.path.join(*splitted)\n\ndef get_path(mod_name,parent_path=None):\n \"\"\" Return path of the module.\n\n Returned path is relative to parent_path when given,\n otherwise it is absolute path.\n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n __import__(mod_name)\n mod = sys.modules[mod_name]\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n if parent_path is not None:\n pd = os.path.abspath(parent_path)\n if pd==d[:len(pd)]:\n d = d[len(pd)+1:]\n return d or '.'\n\n# Hooks for colored terminal output.\n# See also http://www.livinglogic.de/Python/ansistyle\ndef terminal_has_colors():\n if sys.platform=='cygwin' and not os.environ.has_key('USE_COLOR'):\n # Avoid importing curses that causes illegal operation\n # with a message:\n # PYTHON2 caused an invalid page fault in\n # module CYGNURSES7.DLL as 015f:18bbfc28\n # Details: Python 2.3.3 [GCC 3.3.1 (cygming special)]\n # ssh to Win32 machine from debian\n # curses.version is 2.2\n # CYGWIN_98-4.10, release 1.5.7(0.109/3/2))\n return 0\n if hasattr(sys.stdout,'isatty') and sys.stdout.isatty(): \n try:\n import curses\n curses.setupterm()\n if (curses.tigetnum(\"colors\") >= 0\n and curses.tigetnum(\"pairs\") >= 0\n and ((curses.tigetstr(\"setf\") is not None \n and curses.tigetstr(\"setb\") is not None) \n or (curses.tigetstr(\"setaf\") is not None\n and curses.tigetstr(\"setab\") is not None)\n or curses.tigetstr(\"scp\") is not None)):\n return 1\n except Exception,msg:\n pass\n return 0\n\nif terminal_has_colors():\n def red_text(s): return '\\x1b[31m%s\\x1b[0m'%s\n def green_text(s): return '\\x1b[32m%s\\x1b[0m'%s\n def yellow_text(s): return '\\x1b[33m%s\\x1b[0m'%s\n def blue_text(s): return '\\x1b[34m%s\\x1b[0m'%s\n def cyan_text(s): return '\\x1b[35m%s\\x1b[0m'%s\nelse:\n def red_text(s): return s\n def green_text(s): return s\n def yellow_text(s): return s\n def cyan_text(s): return s\n def blue_text(s): return s\n\n#########################\n\ndef cyg2win32(path):\n if sys.platform=='cygwin' and path.startswith('/cygdrive'):\n path = path[10] + ':' + os.path.normcase(path[11:])\n return path\n\n#########################\n\n#XXX need support for .C that is also C++\ncxx_ext_match = re.compile(r'.*[.](cpp|cxx|cc)\\Z',re.I).match\nfortran_ext_match = re.compile(r'.*[.](f90|f95|f77|for|ftn|f)\\Z',re.I).match\nf90_ext_match = re.compile(r'.*[.](f90|f95)\\Z',re.I).match\nf90_module_name_match = re.compile(r'\\s*module\\s*(?P[\\w_]+)',re.I).match\ndef _get_f90_modules(source):\n \"\"\" Return a list of Fortran f90 module names that\n given source file defines.\n \"\"\"\n if not f90_ext_match(source):\n return []\n modules = []\n f = open(source,'r')\n f_readlines = getattr(f,'xreadlines',f.readlines)\n for line in f_readlines():\n m = f90_module_name_match(line)\n if m:\n name = m.group('name')\n modules.append(name)\n # break # XXX can we assume that there is one module per file?\n f.close()\n return modules\n\ndef all_strings(lst):\n \"\"\" Return True if all items in lst are string objects. \"\"\"\n for item in lst:\n if type(item) is not types.StringType:\n return False\n return True\n\ndef has_f_sources(sources):\n \"\"\" Return True if sources contains Fortran files \"\"\"\n for source in sources:\n if fortran_ext_match(source):\n return True\n return False\n\ndef has_cxx_sources(sources):\n \"\"\" Return True if sources contains C++ files \"\"\"\n for source in sources:\n if cxx_ext_match(source):\n return True\n return False\n\ndef filter_sources(sources):\n \"\"\" Return four lists of filenames containing\n C, C++, Fortran, and Fortran 90 module sources,\n respectively.\n \"\"\"\n c_sources = []\n cxx_sources = []\n f_sources = []\n fmodule_sources = []\n for source in sources:\n if fortran_ext_match(source):\n modules = _get_f90_modules(source)\n if modules:\n fmodule_sources.append(source)\n else:\n f_sources.append(source)\n elif cxx_ext_match(source):\n cxx_sources.append(source)\n else:\n c_sources.append(source) \n return c_sources, cxx_sources, f_sources, fmodule_sources\n\n\ndef _get_headers(directory_list):\n # get *.h files from list of directories\n headers = []\n for dir in directory_list:\n head = glob.glob(os.path.join(dir,\"*.h\")) #XXX: *.hpp files??\n headers.extend(head)\n return headers\n\ndef _get_directories(list_of_sources):\n # get unique directories from list of sources.\n direcs = []\n for file in list_of_sources:\n dir = os.path.split(file)\n if dir[0] != '' and not dir[0] in direcs:\n direcs.append(dir[0])\n return direcs\n\ndef get_dependencies(sources):\n #XXX scan sources for include statements\n return _get_headers(_get_directories(sources))\n\ndef is_local_src_dir(directory):\n \"\"\" Return true if directory is local directory.\n \"\"\"\n if type(directory) is not type(''):\n return False\n abs_dir = os.path.abspath(directory)\n c = os.path.commonprefix([os.getcwd(),abs_dir])\n new_dir = abs_dir[len(c):].split(os.sep)\n if new_dir and not new_dir[0]:\n new_dir = new_dir[1:]\n if new_dir and new_dir[0]=='build':\n return False\n new_dir = os.sep.join(new_dir)\n return os.path.isdir(new_dir)\n\ndef _gsf_visit_func(filenames,dirname,names):\n if os.path.basename(dirname) in ['CVS','.svn','build']:\n names[:] = []\n return\n for name in names:\n if name[-1] in \"~#\":\n continue\n fullname = os.path.join(dirname,name)\n ext = os.path.splitext(fullname)[1]\n if ext and ext in ['.pyc','.o']:\n continue\n if os.path.isfile(fullname):\n filenames.append(fullname)\n\ndef get_ext_source_files(ext):\n # Get sources and any include files in the same directory.\n filenames = []\n sources = filter(lambda s:type(s) is types.StringType,ext.sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n for d in ext.depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_script_files(scripts):\n scripts = filter(lambda s:type(s) is types.StringType,scripts)\n return scripts\n\ndef get_lib_source_files(lib):\n filenames = []\n sources = lib[1].get('sources',[])\n sources = filter(lambda s:type(s) is types.StringType,sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n depends = lib[1].get('depends',[])\n for d in depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_data_files(data):\n if type(data) is types.StringType:\n return [data]\n sources = data[1]\n filenames = []\n for s in sources:\n if callable(s):\n s = s()\n if s is None:\n continue\n if is_local_src_dir(s):\n os.path.walk(s,_gsf_visit_func,filenames)\n elif type(s) is type(''):\n if os.path.isfile(s):\n filenames.append(s)\n else:\n print 'Not existing data file:',s\n else:\n raise TypeError,`s`\n return filenames\n\ndef dot_join(*args):\n return '.'.join(filter(None,args))\n\ndef get_frame(level=0):\n try:\n return sys._getframe(level+1)\n except AttributeError:\n frame = sys.exc_info()[2].tb_frame\n for i in range(level+1):\n frame = frame.f_back\n return frame\n\n######################\n\nclass Configuration:\n\n _list_keys = ['packages','ext_modules','data_files','include_dirs',\n 'libraries','headers','scripts']\n _dict_keys = ['package_dir']\n\n numpy_include_dirs = []\n\n def __init__(self,\n package_name=None,\n parent_name=None,\n top_path=None,\n package_path=None,\n **attrs):\n \"\"\" Construct configuration instance of a package.\n \"\"\"\n self.name = dot_join(parent_name, package_name)\n\n caller_frame = get_frame(1)\n caller_name = eval('__name__',caller_frame.f_globals,caller_frame.f_locals)\n \n self.local_path = get_path(caller_name, top_path)\n if top_path is None:\n top_path = self.local_path\n if package_path is None:\n package_path = self.local_path\n elif os.path.isdir(os.path.join(self.local_path,package_path)):\n package_path = os.path.join(self.local_path,package_path)\n assert os.path.isdir(package_path),`package_path`\n self.top_path = top_path\n\n self.list_keys = copy.copy(self._list_keys)\n self.dict_keys = copy.copy(self._dict_keys)\n\n for n in self.list_keys:\n setattr(self,n,copy.copy(attrs.get(n,[])))\n\n for n in self.dict_keys:\n setattr(self,n,copy.copy(attrs.get(n,{})))\n\n known_keys = self.list_keys + self.dict_keys\n self.extra_keys = []\n for n in attrs.keys():\n if n in known_keys:\n continue\n a = attrs[n]\n setattr(self,n,a)\n if type(a) is types.ListType:\n self.list_keys.append(n)\n elif type(a) is types.DictType:\n self.dict_keys.append(n)\n else:\n self.extra_keys.append(n)\n\n if os.path.exists(os.path.join(package_path,'__init__.py')):\n self.packages.append(self.name)\n self.package_dir[self.name] = package_path \n return\n\n def todict(self):\n \"\"\" Return configuration distionary suitable for passing\n to distutils.core.setup() function.\n \"\"\"\n d = {}\n for n in self.list_keys + self.dict_keys + self.extra_keys:\n a = getattr(self,n)\n if a:\n d[n] = a\n if self.name:\n d['name'] = self.name\n return d\n\n def __dict__(self):\n return self.todict()\n\n def get_distribution(self):\n import distutils.core\n dist = distutils.core._setup_distribution \n return dist\n\n def get_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Return subpackage configuration.\n \"\"\"\n if subpackage_name is None:\n assert subpackage_path is not None\n subpackage_name = os.path.basename(subpackage_path)\n assert '.' not in subpackage_name,`subpackage_name`\n if subpackage_path is None:\n subpackage_path = os.path.join(self.local_path,subpackage_name)\n else:\n subpackage_path = self._fix_paths([subpackage_path])[0]\n\n setup_py = os.path.join(subpackage_path,'setup_%s.py' % (subpackage_name))\n if not os.path.isfile(setup_py):\n setup_py = os.path.join(subpackage_path,'setup.py')\n if not os.path.isfile(setup_py):\n print 'Assuming default configuration '\\\n '(%s/{setup_%s,setup}.py was not found)' \\\n % (os.path.dirname(setup_py),subpackage_name)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n # In case setup_py imports local modules:\n sys.path.insert(0,os.path.dirname(setup_py))\n try:\n info = (open(setup_py),setup_py,('.py','U',1))\n setup_name = os.path.splitext(os.path.basename(setup_py))[0]\n n = dot_join(self.name,setup_name)\n setup_module = imp.load_module('_'.join(n.split('.')),*info)\n\n if not hasattr(setup_module,'configuration'):\n print 'Assuming default configuration '\\\n '(%s does not define configuration())' % (setup_module)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n args = (self.name,)\n if setup_module.configuration.func_code.co_argcount>1:\n args = args + (self.top_path,)\n config = setup_module.configuration(*args)\n\n finally:\n del sys.path[0]\n\n return config\n\n def add_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Add subpackage to configuration.\n \"\"\"\n config = self.get_subpackage(subpackage_name,subpackage_path)\n\n if not config:\n print 'No configuration returned, assuming unavailable.'\n else:\n\n if isinstance(config,Configuration):\n print 'Appending %s configuration to %s' % (config.name,self.name)\n self.dict_append(**config.todict())\n else:\n print 'Appending %s configuration to %s' % (config.get('name'),self.name)\n self.dict_append(**config)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a subpackage', subpackage_name\n return\n\n def add_data_dir(self,data_path):\n \"\"\" Recursively add files under data_path to data_files list.\n Argument can be either\n - 2-sequence (,)\n - path to data directory where python datadir suffix defaults\n to package dir.\n If path is not absolute then it's datadir suffix is\n package dir + subdirname of the path.\n \"\"\"\n if type(data_path) is type(()):\n assert len(data_path)==2,`data_path`\n d,data_path = data_path\n else:\n d = None\n assert type(data_path) is type(''),`data_path`\n for path in self.paths(data_path):\n if not os.path.exists(path):\n print 'Not existing data path',path\n continue\n filenames = []\n os.path.walk(path, _gsf_visit_func,filenames)\n if not os.path.isabs(path):\n if d is None:\n ds = os.path.join(*(self.name.split('.')+[data_path]))\n else:\n ds = os.path.join(d,data_path)\n self.add_data_files((ds,filenames))\n else:\n if d is None:\n self.add_data_files(*filenames)\n else:\n self.add_data_files((d,filenames))\n return\n\n def add_data_files(self,*files):\n \"\"\" Add data files to configuration data_files.\n Argument(s) can be either\n - 2-sequence (,)\n - paths to data files where python datadir prefix defaults\n to package dir.\n If path is not absolute then it's datadir prefix is\n package dir + dirname of the path.\n \"\"\"\n data_dict = {}\n new_files = []\n for p in files:\n if type(p) is not type(()):\n d = os.path.join(*(self.name.split('.')))\n if type(p) is type('') and not os.path.isabs(p):\n d = appendpath(d,os.path.dirname(p))\n p = (d,p)\n new_files.append(p)\n files = []\n for prefix,filepattern in new_files:\n if type(filepattern) is type(''):\n file_list = self.paths(filepattern)\n elif callable(filepattern):\n file_list = [filepattern]\n else:\n file_list = self.paths(*filepattern)\n\n nof_path_components = [len(f.split(os.sep)) \\\n for f in file_list if type(f) is type('')]\n if nof_path_components:\n min_path_components = min(nof_path_components)-1\n else:\n min_path_components = 0\n\n for f in file_list:\n if type(f) is type(''):\n extra_path_components = f.split(os.sep)[min_path_components:-1]\n p = os.path.join(*([prefix]+extra_path_components))\n else:\n p = prefix\n if not data_dict.has_key(p):\n data_dict[p] = [f]\n else:\n data_dict[p].append(f)\n\n dist = self.get_distribution()\n if dist is not None:\n dist.data_files.extend(data_dict.items())\n else:\n self.data_files.extend(data_dict.items())\n return \n \n def add_include_dirs(self,*paths):\n \"\"\" Add paths to configuration include directories.\n \"\"\"\n include_dirs = self._fix_paths(paths)\n dist = self.get_distribution()\n if dist is not None:\n dist.include_dirs.extend(include_dirs)\n else:\n self.include_dirs.extend(include_dirs)\n return\n\n def add_headers(self,*files):\n \"\"\" Add installable headers to configuration.\n Argument(s) can be either\n - 2-sequence (,)\n - path(s) to header file(s) where python includedir suffix will default\n to package name.\n \"\"\"\n headers = []\n for path in files:\n if type(path) is type(''):\n [headers.append((self.name,p)) for p in self.paths(path)]\n else:\n assert type(path) in [type(()),type([])] and len(path)==2,`path`\n [headers.append((path[0],p)) for p in self.paths(path[1])]\n dist = self.get_distribution()\n if dist is not None:\n dist.headers.extend(headers)\n else:\n self.headers.extend(headers)\n return\n\n def _fix_paths(self,paths):\n new_paths = []\n for n in paths:\n if isinstance(n,str):\n if '*' in n or '?' in n:\n p = glob.glob(n)\n p2 = glob.glob(os.path.join(self.local_path,n))\n if p2:\n new_paths.extend(p2)\n elif p:\n new_paths.extend(p)\n else:\n new_paths.append(n)\n else:\n n2 = os.path.join(self.local_path,n)\n if os.path.exists(n2):\n new_paths.append(n2)\n else:\n new_paths.append(n)\n else:\n new_paths.append(n)\n return new_paths\n\n def paths(self,*paths):\n \"\"\" Apply glob to paths and prepend local_path if needed.\n \"\"\"\n return self._fix_paths(paths)\n\n def add_extension(self,name,sources,**kw):\n \"\"\" Add extension to configuration.\n\n Keywords:\n include_dirs, define_macros, undef_macros,\n library_dirs, libraries, runtime_library_dirs,\n extra_objects, extra_compile_args, extra_link_args,\n export_symbols, swig_opts, depends, language,\n f2py_options, module_dirs\n extra_info - dict or list of dict of keywords to be\n appended to keywords.\n \"\"\"\n ext_args = copy.copy(kw)\n ext_args['name'] = dot_join(self.name,name)\n ext_args['sources'] = sources\n\n if ext_args.has_key('extra_info'):\n extra_info = ext_args['extra_info']\n del ext_args['extra_info']\n if type(extra_info) is type({}):\n extra_info = [extra_info]\n for info in extra_info:\n assert type(info) is type({}),`info`\n dict_append(ext_args,**info)\n\n for k in ext_args.keys():\n v = ext_args[k]\n if k in ['sources','depends','include_dirs','library_dirs',\n 'module_dirs','extra_objects']:\n new_v = self._fix_paths(v)\n ext_args[k] = new_v\n\n # Resolve out-of-tree dependencies\n libraries = ext_args.get('libraries',[])\n libnames = []\n ext_args['libraries'] = []\n for libname in libraries:\n if '@' in libname:\n lname,lpath = libname.split('@',1)\n lpath = os.path.abspath(os.path.join(self.local_path,lpath))\n if os.path.isdir(lpath):\n c = self.get_subpackage(None,lpath)\n if isinstance(c,Configuration):\n c = c.todict()\n for l in [l[0] for l in c.get('libraries',[])]:\n llname = l.split('__OF__',1)[0]\n if llname == lname:\n c.pop('name',None)\n dict_append(ext_args,**c)\n break\n continue\n libnames.append(libname)\n\n ext_args['libraries'] = libnames + ext_args['libraries']\n\n from numpy.distutils.core import Extension\n ext = Extension(**ext_args)\n self.ext_modules.append(ext)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add an extension', name\n return ext\n\n def add_library(self,name,sources,**build_info):\n \"\"\" Add library to configuration.\n \n Valid keywords for build_info:\n depends\n macros\n include_dirs\n extra_compiler_args\n f2py_options\n \"\"\"\n build_info = copy.copy(build_info)\n name = name #+ '__OF__' + self.name\n build_info['sources'] = sources\n\n for k in build_info.keys():\n v = build_info[k]\n if k in ['sources','depends']:\n new_v = self._fix_paths(v)\n build_info[k] = new_v\n self.libraries.append((name,build_info))\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a library', name\n return\n\n def add_scripts(self,*files):\n \"\"\" Add scripts to configuration.\n \"\"\"\n scripts = self._fix_paths(files)\n dist = self.get_distribution()\n if dist is not None:\n dist.scripts.extend(scripts)\n else:\n self.scripts.extend(scripts)\n return\n\n def dict_append(self,**dict):\n for key in self.list_keys:\n a = getattr(self,key)\n a.extend(dict.get(key,[]))\n for key in self.dict_keys:\n a = getattr(self,key)\n a.update(dict.get(key,{}))\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n for key in dict.keys():\n if key not in known_keys and not hasattr(self,key):\n print 'Inheriting attribute %r from %r' \\\n % (key,dict.get('name','?'))\n setattr(self,key,dict[key])\n self.extra_keys.append(key)\n return\n\n def __str__(self):\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n s = '<'+5*'-' + '\\n'\n s += 'Configuration of '+self.name+':\\n'\n for k in known_keys:\n a = getattr(self,k,None)\n if a:\n s += '%s = %r\\n' % (k,a)\n s += 5*'-' + '>'\n return s\n\n def get_config_cmd(self):\n cmd = get_cmd('config')\n cmd.ensure_finalized()\n cmd.dump_source = 0\n cmd.noisy = 0\n old_path = os.environ.get('PATH')\n if old_path:\n path = os.pathsep.join(['.',old_path])\n os.environ['PATH'] = path\n return cmd\n\n def get_build_temp_dir(self):\n cmd = get_cmd('build')\n cmd.ensure_finalized()\n return cmd.build_temp\n\n def have_f77c(self):\n \"\"\" Check for availability of Fortran 77 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f77')\n return flag\n\n def have_f90c(self):\n \"\"\" Check for availability of Fortran 90 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f90')\n return flag\n\n def append_to(self, extlib):\n \"\"\" Append libraries, include_dirs to extension or library item.\n \"\"\"\n if type(extlib) is type(()):\n lib_name, build_info = extlib\n dict_append(build_info,\n libraries=self.libraries,\n include_dirs=self.include_dirs)\n else:\n from numpy.distutils.core import Extension\n assert isinstance(extlib,Extension),`extlib`\n extlib.libraries.extend(self.libraries)\n extlib.include_dirs.extend(self.include_dirs)\n return\n\n def _get_svn_revision(self,path):\n \"\"\" Return path's SVN revision number.\n \"\"\"\n entries = os.path.join(path,'.svn','entries')\n revision = None\n if os.path.isfile(entries):\n f = open(entries)\n m = re.search(r'revision=\"(?P\\d+)\"',f.read())\n f.close()\n if m:\n revision = int(m.group('revision'))\n return revision\n\n def get_version(self):\n \"\"\" Try to get version string of a package.\n \"\"\"\n version = getattr(self,'version',None)\n if version is not None:\n return version\n\n # Get version from version file.\n files = ['__version__.py',\n self.name.split('.')[-1]+'_version.py',\n 'version.py',\n '__svn_version__.py']\n version_vars = ['version',\n '__version__',\n self.name.split('.')[-1]+'_version']\n for f in files:\n fn = os.path.join(self.local_path,f)\n if os.path.isfile(fn):\n info = (open(fn),fn,('.py','U',1))\n name = os.path.splitext(os.path.basename(fn))[0]\n n = dot_join(self.name,name)\n try:\n version_module = imp.load_module('_'.join(n.split('.')),*info)\n except ImportError,msg:\n print msg\n version_module = None\n if version_module is None:\n continue\n\n for a in version_vars:\n version = getattr(version_module,a,None)\n if version is not None:\n break\n if version is not None:\n break\n\n if version is not None:\n self.version = version\n return version\n\n # Get version as SVN revision number\n revision = self._get_svn_revision(self.local_path)\n if revision is not None:\n version = str(revision)\n self.version = version\n\n return version\n\n def make_svn_version_py(self):\n \"\"\" Generate package __svn_version__.py file from SVN revision number,\n it will be removed after python exits but will be available\n when sdist, etc commands are executed.\n\n If __svn_version__.py existed before, nothing is done.\n \"\"\"\n target = os.path.join(self.local_path,'__svn_version__.py')\n if os.path.isfile(target):\n return\n\n def generate_svn_version_py():\n if not os.path.isfile(target):\n revision = self._get_svn_revision(self.local_path)\n assert revision is not None,'hmm, why I am not inside SVN tree???'\n version = str(revision)\n print 'Creating %s (version=%r)' % (target,version)\n f = open(target,'w')\n f.write('version = %r\\n' % (version))\n f.close()\n \n import atexit\n def rm_file(f=target):\n try: os.remove(f); print 'removed',f\n except OSError: pass\n try: os.remove(f+'c'); print 'removed',f+'c'\n except OSError: pass\n atexit.register(rm_file)\n\n return target\n\n d = os.path.join(*(self.name.split('.')))\n self.add_data_files((d,generate_svn_version_py()))\n return\n\n def make_config_py(self,name='__config__'):\n \"\"\" Generate package __config__.py file containing system_info\n information used during building the package.\n \"\"\"\n self.add_extension(name,[generate_config_py])\n return\n\ndef get_cmd(cmdname,_cache={}):\n if not _cache.has_key(cmdname):\n import distutils.core\n dist = distutils.core._setup_distribution\n if dist is None:\n from distutils.errors import DistutilsInternalError\n raise DistutilsInternalError,\\\n 'setup distribution instance not initialized'\n cmd = dist.get_command_obj(cmdname)\n _cache[cmdname] = cmd\n return _cache[cmdname]\n\ndef get_numpy_include_dirs():\n # numpy_include_dirs are set by numpy/core/setup.py, otherwise []\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n if numpy.show_core_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n 'core','include'))\n else:\n # using installed numpy core headers\n import numpy.core as core\n include_dirs.append(os.path.join(os.path.dirname(core.__file__),'include'))\n # else running numpy/core/setup.py\n return include_dirs\n\n#########################\n\ndef default_config_dict(name = None, parent_name = None, local_path=None):\n \"\"\" Return a configuration dictionary for usage in\n configuration() function defined in file setup_.py.\n \"\"\"\n import warnings\n warnings.warn('Use Configuration(%s,%s,top_path=%s) instead of '\\\n 'deprecated default_config_dict(%s,%s,%s)' \\\n % (`name`,`parent_name`,`local_path`,\n `name`,`parent_name`,`local_path`,\n ))\n c = Configuration(name, parent_name, local_path)\n return c.todict()\n\n\ndef dict_append(d,**kws):\n for k,v in kws.items():\n if d.has_key(k):\n d[k].extend(v)\n else:\n d[k] = v\n\ndef appendpath(prefix,path):\n if not ('/' == os.path.sep):\n prefix = prefix.replace('/',os.path.sep)\n path = path.replace('/',os.path.sep)\n drive = ''\n if os.path.isabs(path):\n drive = os.path.splitdrive(prefix)[0]\n absprefix = os.path.splitdrive(os.path.abspath(prefix))[1]\n pathdrive,path = os.path.splitdrive(path)\n d = os.path.commonprefix([absprefix,path])\n if os.path.join(absprefix[:len(d)],absprefix[len(d):])!=absprefix \\\n or os.path.join(path[:len(d)],path[len(d):])!=path:\n # Handle invalid paths\n d = os.path.dirname(d)\n subpath = path[len(d):]\n if os.path.isabs(subpath):\n subpath = subpath[1:]\n else:\n subpath = path\n return os.path.normpath(os.path.join(drive + prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n \"\"\" Generate /config.py file containing system_info\n information used during building the package.\n\n Usage:\\\n ext = Extension(dot_join(config['name'],'config'),\n sources=[generate_config_py])\n config['ext_modules'].append(ext)\n \"\"\"\n from numpy.distutils.system_info import system_info\n from distutils.dir_util import mkpath\n target = os.path.join(*([build_dir]+extension.name.split('.'))) + '.py'\n mkpath(os.path.dirname(target))\n f = open(target,'w')\n f.write('# This file is generated by %s\\n' % (os.path.abspath(sys.argv[0])))\n f.write('# It contains system_info results at the time of building this package.\\n')\n f.write('__all__ = [\"get_info\",\"show\"]\\n\\n')\n for k,i in system_info.saved_results.items():\n f.write('%s=%r\\n' % (k,i))\n f.write('\\ndef get_info(name): g=globals(); return g.get(name,g.get(name+\"_info\",{}))\\n')\n f.write('''\ndef show():\n for name,info_dict in globals().items():\n if name[0]==\"_\" or type(info_dict) is not type({}): continue\n print name+\":\"\n if not info_dict:\n print \" NOT AVAILABLE\"\n for k,v in info_dict.items():\n v = str(v)\n if k==\\'sources\\' and len(v)>200: v = v[:60]+\\' ...\\\\n... \\'+v[-60:]\n print \\' %s = %s\\'%(k,v)\n print\n return\n ''')\n\n f.close()\n return target\n\ndef generate_svn_version_py(extension, build_dir):\n \"\"\" Generate __svn_version__.py file containing SVN\n revision number of a module.\n \n To use, add the following codelet to setup\n configuration(..) function\n\n ext = Extension(dot_join(config['name'],'__svn_version__'),\n sources=[generate_svn_version_py])\n ext.local_path = local_path\n config['ext_modules'].append(ext)\n\n \"\"\"\n from distutils import dep_util\n local_path = extension.local_path\n target = os.path.join(build_dir, '__svn_version__.py')\n entries = os.path.join(local_path,'.svn','entries')\n if os.path.isfile(entries):\n if not dep_util.newer(entries, target):\n return target\n elif os.path.isfile(target):\n return target\n\n revision = get_svn_revision(local_path)\n f = open(target,'w')\n f.write('revision=%s\\n' % (revision))\n f.close()\n return target\n", + "source_code_before": "import os\nimport re\nimport sys\nimport imp\nimport copy\nimport types\nimport glob\n\ndef allpath(name):\n \"Convert a /-separated pathname to one using the OS's path separator.\"\n splitted = name.split('/')\n return os.path.join(*splitted)\n\ndef get_path(mod_name,parent_path=None):\n \"\"\" Return path of the module.\n\n Returned path is relative to parent_path when given,\n otherwise it is absolute path.\n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n __import__(mod_name)\n mod = sys.modules[mod_name]\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n if parent_path is not None:\n pd = os.path.abspath(parent_path)\n if pd==d[:len(pd)]:\n d = d[len(pd)+1:]\n return d or '.'\n\n# Hooks for colored terminal output.\n# See also http://www.livinglogic.de/Python/ansistyle\ndef terminal_has_colors():\n if sys.platform=='cygwin' and not os.environ.has_key('USE_COLOR'):\n # Avoid importing curses that causes illegal operation\n # with a message:\n # PYTHON2 caused an invalid page fault in\n # module CYGNURSES7.DLL as 015f:18bbfc28\n # Details: Python 2.3.3 [GCC 3.3.1 (cygming special)]\n # ssh to Win32 machine from debian\n # curses.version is 2.2\n # CYGWIN_98-4.10, release 1.5.7(0.109/3/2))\n return 0\n if hasattr(sys.stdout,'isatty') and sys.stdout.isatty(): \n try:\n import curses\n curses.setupterm()\n if (curses.tigetnum(\"colors\") >= 0\n and curses.tigetnum(\"pairs\") >= 0\n and ((curses.tigetstr(\"setf\") is not None \n and curses.tigetstr(\"setb\") is not None) \n or (curses.tigetstr(\"setaf\") is not None\n and curses.tigetstr(\"setab\") is not None)\n or curses.tigetstr(\"scp\") is not None)):\n return 1\n except Exception,msg:\n pass\n return 0\n\nif terminal_has_colors():\n def red_text(s): return '\\x1b[31m%s\\x1b[0m'%s\n def green_text(s): return '\\x1b[32m%s\\x1b[0m'%s\n def yellow_text(s): return '\\x1b[33m%s\\x1b[0m'%s\n def blue_text(s): return '\\x1b[34m%s\\x1b[0m'%s\n def cyan_text(s): return '\\x1b[35m%s\\x1b[0m'%s\nelse:\n def red_text(s): return s\n def green_text(s): return s\n def yellow_text(s): return s\n def cyan_text(s): return s\n def blue_text(s): return s\n\n#########################\n\ndef cyg2win32(path):\n if sys.platform=='cygwin' and path.startswith('/cygdrive'):\n path = path[10] + ':' + os.path.normcase(path[11:])\n return path\n\n#########################\n\n#XXX need support for .C that is also C++\ncxx_ext_match = re.compile(r'.*[.](cpp|cxx|cc)\\Z',re.I).match\nfortran_ext_match = re.compile(r'.*[.](f90|f95|f77|for|ftn|f)\\Z',re.I).match\nf90_ext_match = re.compile(r'.*[.](f90|f95)\\Z',re.I).match\nf90_module_name_match = re.compile(r'\\s*module\\s*(?P[\\w_]+)',re.I).match\ndef _get_f90_modules(source):\n \"\"\" Return a list of Fortran f90 module names that\n given source file defines.\n \"\"\"\n if not f90_ext_match(source):\n return []\n modules = []\n f = open(source,'r')\n f_readlines = getattr(f,'xreadlines',f.readlines)\n for line in f_readlines():\n m = f90_module_name_match(line)\n if m:\n name = m.group('name')\n modules.append(name)\n # break # XXX can we assume that there is one module per file?\n f.close()\n return modules\n\ndef all_strings(lst):\n \"\"\" Return True if all items in lst are string objects. \"\"\"\n for item in lst:\n if type(item) is not types.StringType:\n return False\n return True\n\ndef has_f_sources(sources):\n \"\"\" Return True if sources contains Fortran files \"\"\"\n for source in sources:\n if fortran_ext_match(source):\n return True\n return False\n\ndef has_cxx_sources(sources):\n \"\"\" Return True if sources contains C++ files \"\"\"\n for source in sources:\n if cxx_ext_match(source):\n return True\n return False\n\ndef filter_sources(sources):\n \"\"\" Return four lists of filenames containing\n C, C++, Fortran, and Fortran 90 module sources,\n respectively.\n \"\"\"\n c_sources = []\n cxx_sources = []\n f_sources = []\n fmodule_sources = []\n for source in sources:\n if fortran_ext_match(source):\n modules = _get_f90_modules(source)\n if modules:\n fmodule_sources.append(source)\n else:\n f_sources.append(source)\n elif cxx_ext_match(source):\n cxx_sources.append(source)\n else:\n c_sources.append(source) \n return c_sources, cxx_sources, f_sources, fmodule_sources\n\n\ndef _get_headers(directory_list):\n # get *.h files from list of directories\n headers = []\n for dir in directory_list:\n head = glob.glob(os.path.join(dir,\"*.h\")) #XXX: *.hpp files??\n headers.extend(head)\n return headers\n\ndef _get_directories(list_of_sources):\n # get unique directories from list of sources.\n direcs = []\n for file in list_of_sources:\n dir = os.path.split(file)\n if dir[0] != '' and not dir[0] in direcs:\n direcs.append(dir[0])\n return direcs\n\ndef get_dependencies(sources):\n #XXX scan sources for include statements\n return _get_headers(_get_directories(sources))\n\ndef is_local_src_dir(directory):\n \"\"\" Return true if directory is local directory.\n \"\"\"\n if type(directory) is not type(''):\n return False\n abs_dir = os.path.abspath(directory)\n c = os.path.commonprefix([os.getcwd(),abs_dir])\n new_dir = abs_dir[len(c):].split(os.sep)\n if new_dir and not new_dir[0]:\n new_dir = new_dir[1:]\n if new_dir and new_dir[0]=='build':\n return False\n new_dir = os.sep.join(new_dir)\n return os.path.isdir(new_dir)\n\ndef _gsf_visit_func(filenames,dirname,names):\n if os.path.basename(dirname) in ['CVS','.svn','build']:\n names[:] = []\n return\n for name in names:\n if name[-1] in \"~#\":\n continue\n fullname = os.path.join(dirname,name)\n ext = os.path.splitext(fullname)[1]\n if ext and ext in ['.pyc','.o']:\n continue\n if os.path.isfile(fullname):\n filenames.append(fullname)\n\ndef get_ext_source_files(ext):\n # Get sources and any include files in the same directory.\n filenames = []\n sources = filter(lambda s:type(s) is types.StringType,ext.sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n for d in ext.depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_script_files(scripts):\n scripts = filter(lambda s:type(s) is types.StringType,scripts)\n return scripts\n\ndef get_lib_source_files(lib):\n filenames = []\n sources = lib[1].get('sources',[])\n sources = filter(lambda s:type(s) is types.StringType,sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n depends = lib[1].get('depends',[])\n for d in depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_data_files(data):\n if type(data) is types.StringType:\n return [data]\n sources = data[1]\n filenames = []\n for s in sources:\n if callable(s):\n s = s()\n if s is None:\n continue\n if is_local_src_dir(s):\n os.path.walk(s,_gsf_visit_func,filenames)\n elif type(s) is type(''):\n if os.path.isfile(s):\n filenames.append(s)\n else:\n print 'Not existing data file:',s\n else:\n raise TypeError,`s`\n return filenames\n\ndef dot_join(*args):\n return '.'.join(filter(None,args))\n\ndef get_frame(level=0):\n try:\n return sys._getframe(level+1)\n except AttributeError:\n frame = sys.exc_info()[2].tb_frame\n for i in range(level+1):\n frame = frame.f_back\n return frame\n\n######################\n\nclass Configuration:\n\n _list_keys = ['packages','ext_modules','data_files','include_dirs',\n 'libraries','headers','scripts']\n _dict_keys = ['package_dir']\n\n numpy_include_dirs = []\n\n def __init__(self,\n package_name=None,\n parent_name=None,\n top_path=None,\n package_path=None,\n **attrs):\n \"\"\" Construct configuration instance of a package.\n \"\"\"\n self.name = dot_join(parent_name, package_name)\n\n caller_frame = get_frame(1)\n caller_name = eval('__name__',caller_frame.f_globals,caller_frame.f_locals)\n \n self.local_path = get_path(caller_name, top_path)\n if top_path is None:\n top_path = self.local_path\n if package_path is None:\n package_path = self.local_path\n elif os.path.isdir(os.path.join(self.local_path,package_path)):\n package_path = os.path.join(self.local_path,package_path)\n assert os.path.isdir(package_path),`package_path`\n self.top_path = top_path\n\n self.list_keys = copy.copy(self._list_keys)\n self.dict_keys = copy.copy(self._dict_keys)\n\n for n in self.list_keys:\n setattr(self,n,copy.copy(attrs.get(n,[])))\n\n for n in self.dict_keys:\n setattr(self,n,copy.copy(attrs.get(n,{})))\n\n known_keys = self.list_keys + self.dict_keys\n self.extra_keys = []\n for n in attrs.keys():\n if n in known_keys:\n continue\n a = attrs[n]\n setattr(self,n,a)\n if type(a) is types.ListType:\n self.list_keys.append(n)\n elif type(a) is types.DictType:\n self.dict_keys.append(n)\n else:\n self.extra_keys.append(n)\n\n if os.path.exists(os.path.join(package_path,'__init__.py')):\n self.packages.append(self.name)\n self.package_dir[self.name] = package_path \n return\n\n def todict(self):\n \"\"\" Return configuration distionary suitable for passing\n to distutils.core.setup() function.\n \"\"\"\n d = {}\n for n in self.list_keys + self.dict_keys + self.extra_keys:\n a = getattr(self,n)\n if a:\n d[n] = a\n if self.name:\n d['name'] = self.name\n return d\n\n def __dict__(self):\n return self.todict()\n\n def get_distribution(self):\n import distutils.core\n dist = distutils.core._setup_distribution \n return dist\n\n def get_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Return subpackage configuration.\n \"\"\"\n if subpackage_name is None:\n assert subpackage_path is not None\n subpackage_name = os.path.basename(subpackage_path)\n assert '.' not in subpackage_name,`subpackage_name`\n if subpackage_path is None:\n subpackage_path = os.path.join(self.local_path,subpackage_name)\n else:\n subpackage_path = self._fix_paths([subpackage_path])[0]\n\n setup_py = os.path.join(subpackage_path,'setup_%s.py' % (subpackage_name))\n if not os.path.isfile(setup_py):\n setup_py = os.path.join(subpackage_path,'setup.py')\n if not os.path.isfile(setup_py):\n print 'Assuming default configuration '\\\n '(%s/{setup_%s,setup}.py was not found)' \\\n % (os.path.dirname(setup_py),subpackage_name)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n # In case setup_py imports local modules:\n sys.path.insert(0,os.path.dirname(setup_py))\n try:\n info = (open(setup_py),setup_py,('.py','U',1))\n setup_name = os.path.splitext(os.path.basename(setup_py))[0]\n n = dot_join(self.name,setup_name)\n setup_module = imp.load_module('_'.join(n.split('.')),*info)\n\n if not hasattr(setup_module,'configuration'):\n print 'Assuming default configuration '\\\n '(%s does not define configuration())' % (setup_module)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n args = (self.name,)\n if setup_module.configuration.func_code.co_argcount>1:\n args = args + (self.top_path,)\n config = setup_module.configuration(*args)\n\n finally:\n del sys.path[0]\n\n return config\n\n def add_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Add subpackage to configuration.\n \"\"\"\n config = self.get_subpackage(subpackage_name,subpackage_path)\n\n if not config:\n print 'No configuration returned, assuming unavailable.'\n else:\n\n if isinstance(config,Configuration):\n print 'Appending %s configuration to %s' % (config.name,self.name)\n self.dict_append(**config.todict())\n else:\n print 'Appending %s configuration to %s' % (config.get('name'),self.name)\n self.dict_append(**config)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a subpackage', subpackage_name\n return\n\n def add_data_dir(self,data_path):\n \"\"\" Recursively add files under data_path to data_files list.\n Argument can be either\n - 2-sequence (,)\n - path to data directory where python datadir suffix defaults\n to package dir.\n If path is not absolute then it's datadir suffix is\n package dir + subdirname of the path.\n \"\"\"\n if type(data_path) is type(()):\n assert len(data_path)==2,`data_path`\n d,data_path = data_path\n else:\n d = None\n assert type(data_path) is type(''),`data_path`\n for path in self.paths(data_path):\n if not os.path.exists(path):\n print 'Not existing data path',path\n continue\n filenames = []\n os.path.walk(path, _gsf_visit_func,filenames)\n if not os.path.isabs(path):\n if d is None:\n ds = os.path.join(*(self.name.split('.')+[data_path]))\n else:\n ds = os.path.join(d,data_path)\n self.add_data_files((ds,filenames))\n else:\n if d is None:\n self.add_data_files(*filenames)\n else:\n self.add_data_files((d,filenames))\n return\n\n def add_data_files(self,*files):\n \"\"\" Add data files to configuration data_files.\n Argument(s) can be either\n - 2-sequence (,)\n - paths to data files where python datadir prefix defaults\n to package dir.\n If path is not absolute then it's datadir prefix is\n package dir + dirname of the path.\n \"\"\"\n data_dict = {}\n new_files = []\n for p in files:\n if type(p) is not type(()):\n d = os.path.join(*(self.name.split('.')))\n if type(p) is type('') and not os.path.isabs(p):\n d = appendpath(d,os.path.dirname(p))\n p = (d,p)\n new_files.append(p)\n files = []\n for prefix,filepattern in new_files:\n if type(filepattern) is type(''):\n file_list = self.paths(filepattern)\n elif callable(filepattern):\n file_list = [filepattern]\n else:\n file_list = self.paths(*filepattern)\n\n nof_path_components = [len(f.split(os.sep)) \\\n for f in file_list if type(f) is type('')]\n if nof_path_components:\n min_path_components = min(nof_path_components)-1\n else:\n min_path_components = 0\n\n for f in file_list:\n if type(f) is type(''):\n extra_path_components = f.split(os.sep)[min_path_components:-1]\n p = os.path.join(*([prefix]+extra_path_components))\n else:\n p = prefix\n if not data_dict.has_key(p):\n data_dict[p] = [f]\n else:\n data_dict[p].append(f)\n\n dist = self.get_distribution()\n if dist is not None:\n dist.data_files.extend(data_dict.items())\n else:\n self.data_files.extend(data_dict.items())\n return \n \n def add_include_dirs(self,*paths):\n \"\"\" Add paths to configuration include directories.\n \"\"\"\n include_dirs = self._fix_paths(paths)\n dist = self.get_distribution()\n if dist is not None:\n dist.include_dirs.extend(include_dirs)\n else:\n self.include_dirs.extend(include_dirs)\n return\n\n def add_headers(self,*files):\n \"\"\" Add installable headers to configuration.\n Argument(s) can be either\n - 2-sequence (,)\n - path(s) to header file(s) where python includedir suffix will default\n to package name.\n \"\"\"\n headers = []\n for path in files:\n if type(path) is type(''):\n [headers.append((self.name,p)) for p in self.paths(path)]\n else:\n assert type(path) in [type(()),type([])] and len(path)==2,`path`\n [headers.append((path[0],p)) for p in self.paths(path[1])]\n dist = self.get_distribution()\n if dist is not None:\n dist.headers.extend(headers)\n else:\n self.headers.extend(headers)\n return\n\n def _fix_paths(self,paths):\n new_paths = []\n for n in paths:\n if isinstance(n,str):\n if '*' in n or '?' in n:\n p = glob.glob(n)\n p2 = glob.glob(os.path.join(self.local_path,n))\n if p2:\n new_paths.extend(p2)\n elif p:\n new_paths.extend(p)\n else:\n new_paths.append(n)\n else:\n n2 = os.path.join(self.local_path,n)\n if os.path.exists(n2):\n new_paths.append(n2)\n else:\n new_paths.append(n)\n else:\n new_paths.append(n)\n return new_paths\n\n def paths(self,*paths):\n \"\"\" Apply glob to paths and prepend local_path if needed.\n \"\"\"\n return self._fix_paths(paths)\n\n def add_extension(self,name,sources,**kw):\n \"\"\" Add extension to configuration.\n\n Keywords:\n include_dirs, define_macros, undef_macros,\n library_dirs, libraries, runtime_library_dirs,\n extra_objects, extra_compile_args, extra_link_args,\n export_symbols, swig_opts, depends, language,\n f2py_options, module_dirs\n extra_info - dict or list of dict of keywords to be\n appended to keywords.\n \"\"\"\n ext_args = copy.copy(kw)\n ext_args['name'] = dot_join(self.name,name)\n ext_args['sources'] = sources\n\n if ext_args.has_key('extra_info'):\n extra_info = ext_args['extra_info']\n del ext_args['extra_info']\n if type(extra_info) is type({}):\n extra_info = [extra_info]\n for info in extra_info:\n assert type(info) is type({}),`info`\n dict_append(ext_args,**info)\n\n for k in ext_args.keys():\n v = ext_args[k]\n if k in ['sources','depends','include_dirs','library_dirs',\n 'module_dirs','extra_objects']:\n new_v = self._fix_paths(v)\n ext_args[k] = new_v\n\n # Resolve out-of-tree dependencies\n libraries = ext_args.get('libraries',[])\n libnames = []\n ext_args['libraries'] = []\n for libname in libraries:\n if '@' in libname:\n lname,lpath = libname.split('@',1)\n lpath = os.path.abspath(os.path.join(self.local_path,lpath))\n if os.path.isdir(lpath):\n c = self.get_subpackage(None,lpath)\n if isinstance(c,Configuration):\n c = c.todict()\n for l in [l[0] for l in c.get('libraries',[])]:\n llname = l.split('__OF__',1)[0]\n if llname == lname:\n c.pop('name',None)\n dict_append(ext_args,**c)\n break\n continue\n libnames.append(libname)\n\n ext_args['libraries'] = libnames + ext_args['libraries']\n\n from numpy.distutils.core import Extension\n ext = Extension(**ext_args)\n self.ext_modules.append(ext)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add an extension', name\n return ext\n\n def add_library(self,name,sources,**build_info):\n \"\"\" Add library to configuration.\n \n Valid keywords for build_info:\n depends\n macros\n include_dirs\n extra_compiler_args\n f2py_options\n \"\"\"\n build_info = copy.copy(build_info)\n name = name #+ '__OF__' + self.name\n build_info['sources'] = sources\n\n for k in build_info.keys():\n v = build_info[k]\n if k in ['sources','depends']:\n new_v = self._fix_paths(v)\n build_info[k] = new_v\n self.libraries.append((name,build_info))\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a library', name\n return\n\n def add_scripts(self,*files):\n \"\"\" Add scripts to configuration.\n \"\"\"\n scripts = self._fix_paths(files)\n dist = self.get_distribution()\n if dist is not None:\n dist.scripts.extend(scripts)\n else:\n self.scripts.extend(scripts)\n return\n\n def dict_append(self,**dict):\n for key in self.list_keys:\n a = getattr(self,key)\n a.extend(dict.get(key,[]))\n for key in self.dict_keys:\n a = getattr(self,key)\n a.update(dict.get(key,{}))\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n for key in dict.keys():\n if key not in known_keys and not hasattr(self,key):\n print 'Inheriting attribute %r from %r' \\\n % (key,dict.get('name','?'))\n setattr(self,key,dict[key])\n self.extra_keys.append(key)\n return\n\n def __str__(self):\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n s = '<'+5*'-' + '\\n'\n s += 'Configuration of '+self.name+':\\n'\n for k in known_keys:\n a = getattr(self,k,None)\n if a:\n s += '%s = %r\\n' % (k,a)\n s += 5*'-' + '>'\n return s\n\n def get_config_cmd(self):\n cmd = get_cmd('config')\n cmd.ensure_finalized()\n cmd.dump_source = 0\n cmd.noisy = 0\n old_path = os.environ.get('PATH')\n if old_path:\n path = os.pathsep.join(['.',old_path])\n os.environ['PATH'] = path\n return cmd\n\n def get_build_temp_dir(self):\n cmd = get_cmd('build')\n cmd.ensure_finalized()\n return cmd.build_temp\n\n def have_f77c(self):\n \"\"\" Check for availability of Fortran 77 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f77')\n return flag\n\n def have_f90c(self):\n \"\"\" Check for availability of Fortran 90 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f90')\n return flag\n\n def append_to(self, extlib):\n \"\"\" Append libraries, include_dirs to extension or library item.\n \"\"\"\n if type(extlib) is type(()):\n lib_name, build_info = extlib\n dict_append(build_info,\n libraries=self.libraries,\n include_dirs=self.include_dirs)\n else:\n from numpy.distutils.core import Extension\n assert isinstance(extlib,Extension),`extlib`\n extlib.libraries.extend(self.libraries)\n extlib.include_dirs.extend(self.include_dirs)\n return\n\n def _get_svn_revision(self,path):\n \"\"\" Return path's SVN revision number.\n \"\"\"\n entries = os.path.join(path,'.svn','entries')\n revision = None\n if os.path.isfile(entries):\n f = open(entries)\n m = re.search(r'revision=\"(?P\\d+)\"',f.read())\n f.close()\n if m:\n revision = int(m.group('revision'))\n return revision\n\n def get_version(self):\n \"\"\" Try to get version string of a package.\n \"\"\"\n version = getattr(self,'version',None)\n if version is not None:\n return version\n\n # Get version from version file.\n files = ['__version__.py',\n self.name.split('.')[-1]+'_version.py',\n 'version.py',\n '__svn_version__.py']\n version_vars = ['version',\n '__version__',\n self.name.split('.')[-1]+'_version']\n for f in files:\n fn = os.path.join(self.local_path,f)\n if os.path.isfile(fn):\n info = (open(fn),fn,('.py','U',1))\n name = os.path.splitext(os.path.basename(fn))[0]\n n = dot_join(self.name,name)\n try:\n version_module = imp.load_module('_'.join(n.split('.')),*info)\n except ImportError,msg:\n print msg\n version_module = None\n if version_module is None:\n continue\n\n for a in version_vars:\n version = getattr(version_module,a,None)\n if version is not None:\n break\n if version is not None:\n break\n\n if version is not None:\n self.version = version\n return version\n\n # Get version as SVN revision number\n revision = self._get_svn_revision(self.local_path)\n if revision is not None:\n version = str(revision)\n self.version = version\n\n return version\n\n def make_svn_version_py(self):\n \"\"\" Generate package __svn_version__.py file from SVN revision number,\n it will be removed after python exits but will be available\n when sdist, etc commands are executed.\n\n If __svn_version__.py existed before, nothing is done.\n \"\"\"\n target = os.path.join(self.local_path,'__svn_version__.py')\n if os.path.isfile(target):\n return\n\n def generate_svn_version_py():\n if not os.path.isfile(target):\n revision = self._get_svn_revision(self.local_path)\n assert revision is not None,'hmm, why I am not inside SVN tree???'\n version = str(revision)\n print 'Creating %s (version=%r)' % (target,version)\n f = open(target,'w')\n f.write('version = %r\\n' % (version))\n f.close()\n \n import atexit\n def rm_file(f=target):\n try: os.remove(f); print 'removed',f\n except OSError: pass\n try: os.remove(f+'c'); print 'removed',f+'c'\n except OSError: pass\n atexit.register(rm_file)\n\n return target\n\n d = os.path.join(*(self.name.split('.')))\n self.add_data_files((d,generate_svn_version_py()))\n return\n\n def make_config_py(self,name='__config__'):\n \"\"\" Generate package __config__.py file containing system_info\n information used during building the package.\n \"\"\"\n self.add_extension(name,[generate_config_py])\n return\n\ndef get_cmd(cmdname,_cache={}):\n if not _cache.has_key(cmdname):\n import distutils.core\n dist = distutils.core._setup_distribution\n if dist is None:\n from distutils.errors import DistutilsInternalError\n raise DistutilsInternalError,\\\n 'setup distribution instance not initialized'\n cmd = dist.get_command_obj(cmdname)\n _cache[cmdname] = cmd\n return _cache[cmdname]\n\ndef get_numpy_include_dirs():\n # numpy_include_dirs are set by numpy/base/setup.py, otherwise []\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n if numpy.show_core_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n 'base','include'))\n else:\n # using installed numpy core headers\n import numpy.base as base\n include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))\n # else running numpy/base/setup.py\n return include_dirs\n\n#########################\n\ndef default_config_dict(name = None, parent_name = None, local_path=None):\n \"\"\" Return a configuration dictionary for usage in\n configuration() function defined in file setup_.py.\n \"\"\"\n import warnings\n warnings.warn('Use Configuration(%s,%s,top_path=%s) instead of '\\\n 'deprecated default_config_dict(%s,%s,%s)' \\\n % (`name`,`parent_name`,`local_path`,\n `name`,`parent_name`,`local_path`,\n ))\n c = Configuration(name, parent_name, local_path)\n return c.todict()\n\n\ndef dict_append(d,**kws):\n for k,v in kws.items():\n if d.has_key(k):\n d[k].extend(v)\n else:\n d[k] = v\n\ndef appendpath(prefix,path):\n if not ('/' == os.path.sep):\n prefix = prefix.replace('/',os.path.sep)\n path = path.replace('/',os.path.sep)\n drive = ''\n if os.path.isabs(path):\n drive = os.path.splitdrive(prefix)[0]\n absprefix = os.path.splitdrive(os.path.abspath(prefix))[1]\n pathdrive,path = os.path.splitdrive(path)\n d = os.path.commonprefix([absprefix,path])\n if os.path.join(absprefix[:len(d)],absprefix[len(d):])!=absprefix \\\n or os.path.join(path[:len(d)],path[len(d):])!=path:\n # Handle invalid paths\n d = os.path.dirname(d)\n subpath = path[len(d):]\n if os.path.isabs(subpath):\n subpath = subpath[1:]\n else:\n subpath = path\n return os.path.normpath(os.path.join(drive + prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n \"\"\" Generate /config.py file containing system_info\n information used during building the package.\n\n Usage:\\\n ext = Extension(dot_join(config['name'],'config'),\n sources=[generate_config_py])\n config['ext_modules'].append(ext)\n \"\"\"\n from numpy.distutils.system_info import system_info\n from distutils.dir_util import mkpath\n target = os.path.join(*([build_dir]+extension.name.split('.'))) + '.py'\n mkpath(os.path.dirname(target))\n f = open(target,'w')\n f.write('# This file is generated by %s\\n' % (os.path.abspath(sys.argv[0])))\n f.write('# It contains system_info results at the time of building this package.\\n')\n f.write('__all__ = [\"get_info\",\"show\"]\\n\\n')\n for k,i in system_info.saved_results.items():\n f.write('%s=%r\\n' % (k,i))\n f.write('\\ndef get_info(name): g=globals(); return g.get(name,g.get(name+\"_info\",{}))\\n')\n f.write('''\ndef show():\n for name,info_dict in globals().items():\n if name[0]==\"_\" or type(info_dict) is not type({}): continue\n print name+\":\"\n if not info_dict:\n print \" NOT AVAILABLE\"\n for k,v in info_dict.items():\n v = str(v)\n if k==\\'sources\\' and len(v)>200: v = v[:60]+\\' ...\\\\n... \\'+v[-60:]\n print \\' %s = %s\\'%(k,v)\n print\n return\n ''')\n\n f.close()\n return target\n\ndef generate_svn_version_py(extension, build_dir):\n \"\"\" Generate __svn_version__.py file containing SVN\n revision number of a module.\n \n To use, add the following codelet to setup\n configuration(..) function\n\n ext = Extension(dot_join(config['name'],'__svn_version__'),\n sources=[generate_svn_version_py])\n ext.local_path = local_path\n config['ext_modules'].append(ext)\n\n \"\"\"\n from distutils import dep_util\n local_path = extension.local_path\n target = os.path.join(build_dir, '__svn_version__.py')\n entries = os.path.join(local_path,'.svn','entries')\n if os.path.isfile(entries):\n if not dep_util.newer(entries, target):\n return target\n elif os.path.isfile(target):\n return target\n\n revision = get_svn_revision(local_path)\n f = open(target,'w')\n f.write('revision=%s\\n' % (revision))\n f.close()\n return target\n", + "methods": [ + { + "name": "allpath", + "long_name": "allpath( name )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "name" + ], + "start_line": 9, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "get_path", + "long_name": "get_path( mod_name , parent_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 132, + "parameters": [ + "mod_name", + "parent_path" + ], + "start_line": 14, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "terminal_has_colors", + "long_name": "terminal_has_colors( )", + "filename": "misc_util.py", + "nloc": 18, + "complexity": 13, + "token_count": 137, + "parameters": [], + "start_line": 38, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "cyg2win32", + "long_name": "cyg2win32( path )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "path" + ], + "start_line": 80, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "_get_f90_modules", + "long_name": "_get_f90_modules( source )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 77, + "parameters": [ + "source" + ], + "start_line": 92, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "all_strings", + "long_name": "all_strings( lst )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 26, + "parameters": [ + "lst" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_f_sources", + "long_name": "has_f_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 117, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_cxx_sources", + "long_name": "has_cxx_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 124, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "filter_sources", + "long_name": "filter_sources( sources )", + "filename": "misc_util.py", + "nloc": 17, + "complexity": 5, + "token_count": 84, + "parameters": [ + "sources" + ], + "start_line": 131, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "_get_headers", + "long_name": "_get_headers( directory_list )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "directory_list" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_get_directories", + "long_name": "_get_directories( list_of_sources )", + "filename": "misc_util.py", + "nloc": 7, + "complexity": 4, + "token_count": 51, + "parameters": [ + "list_of_sources" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "get_dependencies", + "long_name": "get_dependencies( sources )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "sources" + ], + "start_line": 171, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "is_local_src_dir", + "long_name": "is_local_src_dir( directory )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 6, + "token_count": 112, + "parameters": [ + "directory" + ], + "start_line": 175, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "_gsf_visit_func", + "long_name": "_gsf_visit_func( filenames , dirname , names )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 7, + "token_count": 103, + "parameters": [ + "filenames", + "dirname", + "names" + ], + "start_line": 190, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_ext_source_files", + "long_name": "get_ext_source_files( ext )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 4, + "token_count": 87, + "parameters": [ + "ext" + ], + "start_line": 204, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "get_script_files", + "long_name": "get_script_files( scripts )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "scripts" + ], + "start_line": 217, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "get_lib_source_files", + "long_name": "get_lib_source_files( lib )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 111, + "parameters": [ + "lib" + ], + "start_line": 221, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_data_files", + "long_name": "get_data_files( data )", + "filename": "misc_util.py", + "nloc": 20, + "complexity": 8, + "token_count": 112, + "parameters": [ + "data" + ], + "start_line": 235, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "dot_join", + "long_name": "dot_join( * args )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "args" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_frame", + "long_name": "get_frame( level = 0 )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "level" + ], + "start_line": 259, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , package_name = None , parent_name = None , top_path = None , package_path = None , ** attrs )", + "filename": "misc_util.py", + "nloc": 41, + "complexity": 11, + "token_count": 348, + "parameters": [ + "self", + "package_name", + "parent_name", + "top_path", + "package_path", + "attrs" + ], + "start_line": 278, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 1 + }, + { + "name": "todict", + "long_name": "todict( self )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__dict__", + "long_name": "__dict__( self )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 342, + "end_line": 343, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_distribution", + "long_name": "get_distribution( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 345, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_subpackage", + "long_name": "get_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 8, + "token_count": 333, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 350, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "add_subpackage", + "long_name": "add_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 103, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 396, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "add_data_dir", + "long_name": "add_data_dir( self , data_path )", + "filename": "misc_util.py", + "nloc": 25, + "complexity": 7, + "token_count": 188, + "parameters": [ + "self", + "data_path" + ], + "start_line": 417, + "end_line": 449, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_data_files", + "long_name": "add_data_files( self , * files )", + "filename": "misc_util.py", + "nloc": 40, + "complexity": 15, + "token_count": 324, + "parameters": [ + "self", + "files" + ], + "start_line": 451, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "add_include_dirs", + "long_name": "add_include_dirs( self , * paths )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "paths" + ], + "start_line": 503, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "add_headers", + "long_name": "add_headers( self , * files )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 7, + "token_count": 143, + "parameters": [ + "self", + "files" + ], + "start_line": 514, + "end_line": 533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "_fix_paths", + "long_name": "_fix_paths( self , paths )", + "filename": "misc_util.py", + "nloc": 22, + "complexity": 8, + "token_count": 136, + "parameters": [ + "self", + "paths" + ], + "start_line": 535, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "paths", + "long_name": "paths( self , * paths )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "paths" + ], + "start_line": 558, + "end_line": 561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "add_extension", + "long_name": "add_extension( self , name , sources , ** kw )", + "filename": "misc_util.py", + "nloc": 45, + "complexity": 14, + "token_count": 365, + "parameters": [ + "self", + "name", + "sources", + "kw" + ], + "start_line": 563, + "end_line": 625, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "add_library", + "long_name": "add_library( self , name , sources , ** build_info )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 4, + "token_count": 98, + "parameters": [ + "self", + "name", + "sources", + "build_info" + ], + "start_line": 627, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "add_scripts", + "long_name": "add_scripts( self , * files )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "files" + ], + "start_line": 653, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "dict_append", + "long_name": "dict_append( self , ** dict )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 138, + "parameters": [ + "self", + "dict" + ], + "start_line": 664, + "end_line": 678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 680, + "end_line": 689, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_config_cmd", + "long_name": "get_config_cmd( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 691, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_build_temp_dir", + "long_name": "get_build_temp_dir( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 702, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "have_f77c", + "long_name": "have_f77c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 707, + "end_line": 718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "have_f90c", + "long_name": "have_f90c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 720, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "append_to", + "long_name": "append_to( self , extlib )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 2, + "token_count": 83, + "parameters": [ + "self", + "extlib" + ], + "start_line": 733, + "end_line": 746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_svn_revision", + "long_name": "_get_svn_revision( self , path )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 77, + "parameters": [ + "self", + "path" + ], + "start_line": 748, + "end_line": 759, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "get_version", + "long_name": "get_version( self )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 11, + "token_count": 257, + "parameters": [ + "self" + ], + "start_line": 761, + "end_line": 807, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 1 + }, + { + "name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file", + "long_name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file( f = target )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "f" + ], + "start_line": 831, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 3 + }, + { + "name": "make_svn_version_py.generate_svn_version_py", + "long_name": "make_svn_version_py.generate_svn_version_py( )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 2, + "token_count": 81, + "parameters": [], + "start_line": 820, + "end_line": 838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 2 + }, + { + "name": "make_svn_version_py", + "long_name": "make_svn_version_py( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 809, + "end_line": 842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "make_config_py", + "long_name": "make_config_py( self , name = '__config__' )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "name" + ], + "start_line": 844, + "end_line": 849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_cmd", + "long_name": "get_cmd( cmdname , _cache = { } )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 65, + "parameters": [ + "cmdname", + "_cache" + ], + "start_line": 851, + "end_line": 861, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "default_config_dict", + "long_name": "default_config_dict( name = None , parent_name = None , local_path = None )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 1, + "token_count": 70, + "parameters": [ + "name", + "parent_name", + "local_path" + ], + "start_line": 881, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 895, + "end_line": 900, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "appendpath", + "long_name": "appendpath( prefix , path )", + "filename": "misc_util.py", + "nloc": 19, + "complexity": 6, + "token_count": 237, + "parameters": [ + "prefix", + "path" + ], + "start_line": 902, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generate_config_py", + "long_name": "generate_config_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 28, + "complexity": 2, + "token_count": 145, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 923, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "generate_svn_version_py", + "long_name": "generate_svn_version_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 109, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 961, + "end_line": 988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "allpath", + "long_name": "allpath( name )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "name" + ], + "start_line": 9, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "get_path", + "long_name": "get_path( mod_name , parent_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 132, + "parameters": [ + "mod_name", + "parent_path" + ], + "start_line": 14, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "terminal_has_colors", + "long_name": "terminal_has_colors( )", + "filename": "misc_util.py", + "nloc": 18, + "complexity": 13, + "token_count": 137, + "parameters": [], + "start_line": 38, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "cyg2win32", + "long_name": "cyg2win32( path )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "path" + ], + "start_line": 80, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "_get_f90_modules", + "long_name": "_get_f90_modules( source )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 77, + "parameters": [ + "source" + ], + "start_line": 92, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "all_strings", + "long_name": "all_strings( lst )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 26, + "parameters": [ + "lst" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_f_sources", + "long_name": "has_f_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 117, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_cxx_sources", + "long_name": "has_cxx_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 124, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "filter_sources", + "long_name": "filter_sources( sources )", + "filename": "misc_util.py", + "nloc": 17, + "complexity": 5, + "token_count": 84, + "parameters": [ + "sources" + ], + "start_line": 131, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "_get_headers", + "long_name": "_get_headers( directory_list )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "directory_list" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_get_directories", + "long_name": "_get_directories( list_of_sources )", + "filename": "misc_util.py", + "nloc": 7, + "complexity": 4, + "token_count": 51, + "parameters": [ + "list_of_sources" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "get_dependencies", + "long_name": "get_dependencies( sources )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "sources" + ], + "start_line": 171, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "is_local_src_dir", + "long_name": "is_local_src_dir( directory )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 6, + "token_count": 112, + "parameters": [ + "directory" + ], + "start_line": 175, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "_gsf_visit_func", + "long_name": "_gsf_visit_func( filenames , dirname , names )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 7, + "token_count": 103, + "parameters": [ + "filenames", + "dirname", + "names" + ], + "start_line": 190, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_ext_source_files", + "long_name": "get_ext_source_files( ext )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 4, + "token_count": 87, + "parameters": [ + "ext" + ], + "start_line": 204, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "get_script_files", + "long_name": "get_script_files( scripts )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "scripts" + ], + "start_line": 217, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "get_lib_source_files", + "long_name": "get_lib_source_files( lib )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 111, + "parameters": [ + "lib" + ], + "start_line": 221, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_data_files", + "long_name": "get_data_files( data )", + "filename": "misc_util.py", + "nloc": 20, + "complexity": 8, + "token_count": 112, + "parameters": [ + "data" + ], + "start_line": 235, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "dot_join", + "long_name": "dot_join( * args )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "args" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_frame", + "long_name": "get_frame( level = 0 )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "level" + ], + "start_line": 259, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , package_name = None , parent_name = None , top_path = None , package_path = None , ** attrs )", + "filename": "misc_util.py", + "nloc": 41, + "complexity": 11, + "token_count": 348, + "parameters": [ + "self", + "package_name", + "parent_name", + "top_path", + "package_path", + "attrs" + ], + "start_line": 278, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 1 + }, + { + "name": "todict", + "long_name": "todict( self )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__dict__", + "long_name": "__dict__( self )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 342, + "end_line": 343, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_distribution", + "long_name": "get_distribution( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 345, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_subpackage", + "long_name": "get_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 8, + "token_count": 333, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 350, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "add_subpackage", + "long_name": "add_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 103, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 396, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "add_data_dir", + "long_name": "add_data_dir( self , data_path )", + "filename": "misc_util.py", + "nloc": 25, + "complexity": 7, + "token_count": 188, + "parameters": [ + "self", + "data_path" + ], + "start_line": 417, + "end_line": 449, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_data_files", + "long_name": "add_data_files( self , * files )", + "filename": "misc_util.py", + "nloc": 40, + "complexity": 15, + "token_count": 324, + "parameters": [ + "self", + "files" + ], + "start_line": 451, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "add_include_dirs", + "long_name": "add_include_dirs( self , * paths )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "paths" + ], + "start_line": 503, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "add_headers", + "long_name": "add_headers( self , * files )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 7, + "token_count": 143, + "parameters": [ + "self", + "files" + ], + "start_line": 514, + "end_line": 533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "_fix_paths", + "long_name": "_fix_paths( self , paths )", + "filename": "misc_util.py", + "nloc": 22, + "complexity": 8, + "token_count": 136, + "parameters": [ + "self", + "paths" + ], + "start_line": 535, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "paths", + "long_name": "paths( self , * paths )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "paths" + ], + "start_line": 558, + "end_line": 561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "add_extension", + "long_name": "add_extension( self , name , sources , ** kw )", + "filename": "misc_util.py", + "nloc": 45, + "complexity": 14, + "token_count": 365, + "parameters": [ + "self", + "name", + "sources", + "kw" + ], + "start_line": 563, + "end_line": 625, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "add_library", + "long_name": "add_library( self , name , sources , ** build_info )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 4, + "token_count": 98, + "parameters": [ + "self", + "name", + "sources", + "build_info" + ], + "start_line": 627, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "add_scripts", + "long_name": "add_scripts( self , * files )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "files" + ], + "start_line": 653, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "dict_append", + "long_name": "dict_append( self , ** dict )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 138, + "parameters": [ + "self", + "dict" + ], + "start_line": 664, + "end_line": 678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 680, + "end_line": 689, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_config_cmd", + "long_name": "get_config_cmd( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 691, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_build_temp_dir", + "long_name": "get_build_temp_dir( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 702, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "have_f77c", + "long_name": "have_f77c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 707, + "end_line": 718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "have_f90c", + "long_name": "have_f90c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 720, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "append_to", + "long_name": "append_to( self , extlib )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 2, + "token_count": 83, + "parameters": [ + "self", + "extlib" + ], + "start_line": 733, + "end_line": 746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_svn_revision", + "long_name": "_get_svn_revision( self , path )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 77, + "parameters": [ + "self", + "path" + ], + "start_line": 748, + "end_line": 759, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "get_version", + "long_name": "get_version( self )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 11, + "token_count": 257, + "parameters": [ + "self" + ], + "start_line": 761, + "end_line": 807, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 1 + }, + { + "name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file", + "long_name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file( f = target )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "f" + ], + "start_line": 831, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 3 + }, + { + "name": "make_svn_version_py.generate_svn_version_py", + "long_name": "make_svn_version_py.generate_svn_version_py( )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 2, + "token_count": 81, + "parameters": [], + "start_line": 820, + "end_line": 838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 2 + }, + { + "name": "make_svn_version_py", + "long_name": "make_svn_version_py( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 809, + "end_line": 842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "make_config_py", + "long_name": "make_config_py( self , name = '__config__' )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "name" + ], + "start_line": 844, + "end_line": 849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_cmd", + "long_name": "get_cmd( cmdname , _cache = { } )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 65, + "parameters": [ + "cmdname", + "_cache" + ], + "start_line": 851, + "end_line": 861, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "default_config_dict", + "long_name": "default_config_dict( name = None , parent_name = None , local_path = None )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 1, + "token_count": 70, + "parameters": [ + "name", + "parent_name", + "local_path" + ], + "start_line": 881, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 895, + "end_line": 900, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "appendpath", + "long_name": "appendpath( prefix , path )", + "filename": "misc_util.py", + "nloc": 19, + "complexity": 6, + "token_count": 237, + "parameters": [ + "prefix", + "path" + ], + "start_line": 902, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generate_config_py", + "long_name": "generate_config_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 28, + "complexity": 2, + "token_count": 145, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 923, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "generate_svn_version_py", + "long_name": "generate_svn_version_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 109, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 961, + "end_line": 988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 739, + "complexity": 231, + "token_count": 5512, + "diff_parsed": { + "added": [ + " # numpy_include_dirs are set by numpy/core/setup.py, otherwise []", + " 'core','include'))", + " import numpy.core as core", + " include_dirs.append(os.path.join(os.path.dirname(core.__file__),'include'))", + " # else running numpy/core/setup.py" + ], + "deleted": [ + " # numpy_include_dirs are set by numpy/base/setup.py, otherwise []", + " 'base','include'))", + " import numpy.base as base", + " include_dirs.append(os.path.join(os.path.dirname(base.__file__),'include'))", + " # else running numpy/base/setup.py" + ] + } + } + ] + }, + { + "hash": "e53c47ee4476a5de9e302fab9618006502d1b8ed", + "msg": "Fixed svn_version hooks.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-04T23:40:55+00:00", + "author_timezone": 0, + "committer_date": "2006-01-04T23:40:55+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "75077ce6023283d25222768f177e52c5cd0a7904" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 2, + "insertions": 2, + "lines": 4, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/version.py", + "new_path": "numpy/version.py", + "filename": "version.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -2,10 +2,10 @@\n \n import os\n svn_version_file = os.path.join(os.path.dirname(__file__),\n- 'base','__svn_version__.py')\n+ 'core','__svn_version__.py')\n if os.path.isfile(svn_version_file):\n import imp\n- svn = imp.load_module('numpy.base.__svn_version__',\n+ svn = imp.load_module('numpy.core.__svn_version__',\n open(svn_version_file),\n svn_version_file,\n ('.py','U',1))\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "version='0.9.2'\n\nimport os\nsvn_version_file = os.path.join(os.path.dirname(__file__),\n 'core','__svn_version__.py')\nif os.path.isfile(svn_version_file):\n import imp\n svn = imp.load_module('numpy.core.__svn_version__',\n open(svn_version_file),\n svn_version_file,\n ('.py','U',1))\n version += '.'+svn.version\n", + "source_code_before": "version='0.9.2'\n\nimport os\nsvn_version_file = os.path.join(os.path.dirname(__file__),\n 'base','__svn_version__.py')\nif os.path.isfile(svn_version_file):\n import imp\n svn = imp.load_module('numpy.base.__svn_version__',\n open(svn_version_file),\n svn_version_file,\n ('.py','U',1))\n version += '.'+svn.version\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 11, + "complexity": 0, + "token_count": 68, + "diff_parsed": { + "added": [ + " 'core','__svn_version__.py')", + " svn = imp.load_module('numpy.core.__svn_version__'," + ], + "deleted": [ + " 'base','__svn_version__.py')", + " svn = imp.load_module('numpy.base.__svn_version__'," + ] + } + } + ] + }, + { + "hash": "e74ea102831a608086fdd155101158ab19a24c2c", + "msg": "Documentation updates: SciPy core -> NumPy", + "author": { + "name": "edschofield", + "email": "edschofield@localhost" + }, + "committer": { + "name": "edschofield", + "email": "edschofield@localhost" + }, + "author_date": "2006-01-05T00:13:13+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T00:13:13+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "e53c47ee4476a5de9e302fab9618006502d1b8ed" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 6, + "insertions": 6, + "lines": 12, + "files": 2, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/__init__.py", + "new_path": "numpy/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,9 +1,9 @@\n \"\"\"\\\n-SciPy Core\n+NumPy\n ==========\n \n-You can support the development of SciPy by purchasing documentation\n-at\n+You can support the development of NumPy and SciPy by purchasing\n+documentation at\n \n http://www.trelgol.com\n \n@@ -26,7 +26,7 @@\n \n class PackageLoader:\n def __init__(self):\n- \"\"\" Manages loading SciPy packages.\n+ \"\"\" Manages loading NumPy packages.\n \"\"\"\n \n self.parent_frame = frame = sys._getframe(1)\n", + "added_lines": 4, + "deleted_lines": 4, + "source_code": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __core_config__ import show as show_core_config\nexcept ImportError:\n show_core_config = None\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\npkgload = PackageLoader()\n\nif show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\nelse:\n from version import version as __version__\n\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n\n\n test = ScipyTest('numpy').test\n __all__.append('test')\n\n__numpy_doc__ = \"\"\"\n\nNumPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nif show_core_config is None:\n show_numpy_config = None\nelse:\n try:\n from __numpy_config__ import show as show_numpy_config\n except ImportError:\n show_numpy_config = None\n\n\nif show_numpy_config is not None:\n from numpy_version import numpy_version as __numpy_version__\n __doc__ += __numpy_doc__\n pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n", + "source_code_before": "\"\"\"\\\nSciPy Core\n==========\n\nYou can support the development of SciPy by purchasing documentation\nat\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __core_config__ import show as show_core_config\nexcept ImportError:\n show_core_config = None\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading SciPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\npkgload = PackageLoader()\n\nif show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\nelse:\n from version import version as __version__\n\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n\n\n test = ScipyTest('numpy').test\n __all__.append('test')\n\n__numpy_doc__ = \"\"\"\n\nNumPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nif show_core_config is None:\n show_numpy_config = None\nelse:\n try:\n from __numpy_config__ import show as show_numpy_config\n except ImportError:\n show_numpy_config = None\n\n\nif show_numpy_config is not None:\n from numpy_version import numpy_version as __numpy_version__\n __doc__ += __numpy_doc__\n pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "__init__.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 43, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "__init__.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 63, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "__init__.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "__init__.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 136, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 259, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "__init__.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 271, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 281, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 287, + "end_line": 289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "__init__.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 43, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "__init__.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 63, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "__init__.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "__init__.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 136, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 259, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "__init__.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 271, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 281, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 287, + "end_line": 289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + } + ], + "nloc": 232, + "complexity": 63, + "token_count": 1449, + "diff_parsed": { + "added": [ + "NumPy", + "You can support the development of NumPy and SciPy by purchasing", + "documentation at", + " \"\"\" Manages loading NumPy packages." + ], + "deleted": [ + "SciPy Core", + "You can support the development of SciPy by purchasing documentation", + "at", + " \"\"\" Manages loading SciPy packages." + ] + } + }, + { + "old_path": "numpy/doc/README.txt", + "new_path": "numpy/doc/README.txt", + "filename": "README.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -1,9 +1,9 @@\n Very complete documentation is available from the primary developer of\n-SciPy Core for a small fee. After a brief period, that documentation\n+NumPy for a small fee. After a brief period, that documentation\n will become freely available. See http://www.trelgol.com for\n details. The fee and restriction period is intended to allow people\n and to encourage companies to easily contribute to the development of\n-SciPy.\n+NumPy.\n \n This directory will contain all public documentation that becomes available. \n \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "Very complete documentation is available from the primary developer of\nNumPy for a small fee. After a brief period, that documentation\nwill become freely available. See http://www.trelgol.com for\ndetails. The fee and restriction period is intended to allow people\nand to encourage companies to easily contribute to the development of\nNumPy.\n\nThis directory will contain all public documentation that becomes available. \n\nVery good documentation is also available using Python's (and\nespecially IPython's) own help system. Most of the functions have\ndocstrings that provide usage assistance.\n\n\n\n", + "source_code_before": "Very complete documentation is available from the primary developer of\nSciPy Core for a small fee. After a brief period, that documentation\nwill become freely available. See http://www.trelgol.com for\ndetails. The fee and restriction period is intended to allow people\nand to encourage companies to easily contribute to the development of\nSciPy.\n\nThis directory will contain all public documentation that becomes available. \n\nVery good documentation is also available using Python's (and\nespecially IPython's) own help system. Most of the functions have\ndocstrings that provide usage assistance.\n\n\n\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "NumPy for a small fee. After a brief period, that documentation", + "NumPy." + ], + "deleted": [ + "SciPy Core for a small fee. After a brief period, that documentation", + "SciPy." + ] + } + } + ] + }, + { + "hash": "6a0653c0eabcc39a1a45565fc9dd21857c465aba", + "msg": "Fixes to convertcode.py", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T00:16:33+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T00:16:33+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "e74ea102831a608086fdd155101158ab19a24c2c" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 6, + "insertions": 6, + "lines": 12, + "files": 3, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "THANKS.txt", + "new_path": "THANKS.txt", + "filename": "THANKS.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -6,7 +6,7 @@ Perry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray\n Paul Dubois for Masked Arrays\n Pearu Peterson for f2py and distutils and help with code organization\n Robert Kern for mtrand, bug fixes, help with distutils, and code organization\n-Eric Jones for weave and other sundry subroutines\n+Eric Jones for sundry subroutines\n Fernando Perez for code snippets, ideas, bufixes, and testing.\n John Hunter for code snippets (from matplotlib)\n Chris Hanley for help with records.py, testing, and bug fixes.\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "Travis Oliphant for the majority of code adaptation\nJim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for \n Numeric on which the code is based.\nPerry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray\n which gave much inspiration and showed the way forward.\nPaul Dubois for Masked Arrays\nPearu Peterson for f2py and distutils and help with code organization\nRobert Kern for mtrand, bug fixes, help with distutils, and code organization\nEric Jones for sundry subroutines\nFernando Perez for code snippets, ideas, bufixes, and testing.\nJohn Hunter for code snippets (from matplotlib)\nChris Hanley for help with records.py, testing, and bug fixes.\nTravis Vaught and Joe Cooper for administration of numpy.org web site and SVN \nEric Firing for bugfixes.\nArnd Baecker for 64-bit testing\nDavid Cooke for many code improvements including the auto-generated C-API\n", + "source_code_before": "Travis Oliphant for the majority of code adaptation\nJim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for \n Numeric on which the code is based.\nPerry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray\n which gave much inspiration and showed the way forward.\nPaul Dubois for Masked Arrays\nPearu Peterson for f2py and distutils and help with code organization\nRobert Kern for mtrand, bug fixes, help with distutils, and code organization\nEric Jones for weave and other sundry subroutines\nFernando Perez for code snippets, ideas, bufixes, and testing.\nJohn Hunter for code snippets (from matplotlib)\nChris Hanley for help with records.py, testing, and bug fixes.\nTravis Vaught and Joe Cooper for administration of numpy.org web site and SVN \nEric Firing for bugfixes.\nArnd Baecker for 64-bit testing\nDavid Cooke for many code improvements including the auto-generated C-API\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "Eric Jones for sundry subroutines" + ], + "deleted": [ + "Eric Jones for weave and other sundry subroutines" + ] + } + }, + { + "old_path": "numpy/core/numerictypes.py", + "new_path": "numpy/core/numerictypes.py", + "filename": "numerictypes.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -41,7 +41,7 @@\n \n generic\n bool_\n- numeric\n+ number\n integer\n signedinteger (intxx)\n byte\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "# Borrowed and adapted from numarray\n\n\"\"\"numerictypes: Define the numeric type objects\n\nThis module is designed so 'from numerictypes import *' is safe.\nExported symbols include:\n\n Dictionary with all registered number types (including aliases):\n typeDict\n\n Type objects (not all will be available, depends on platform):\n see variable arraytypes for which ones you have\n\n Bit-width names\n\n int8 int16 int32 int64 int128\n uint8 uint16 uint32 uint64 uint128\n float16 float32 float64 float96 float128 float256\n complex32 complex64 complex128 complex192 complex256 complex512\n\n c-based names\n\n bool_\n\n object_\n\n void, str_, unicode_\n\n byte, ubyte,\n short, ushort\n intc, uintc,\n intp, uintp,\n int_, uint,\n longlong, ulonglong,\n\n single, csingle,\n float_, complex_,\n longfloat, clongfloat,\n\n As part of the type-hierarchy: xx -- is bit-width\n\n generic\n bool_\n number\n integer\n signedinteger (intxx)\n byte\n short\n intc\n intp int0\n int_\n longlong\n unsignedinteger (uintxx)\n ubyte\n ushort\n uintc\n uintp uint0\n uint_\n ulonglong\n floating (floatxx)\n single\n float_ (double)\n longfloat\n complexfloating (complexxx)\n csingle\n complex_ (cfloat, cdouble)\n clongfloat\n\n flexible\n character\n str_ (string)\n unicode_\n void\n\n object_\n\n$Id: numerictypes.py,v 1.17 2005/09/09 22:20:06 teoliphant Exp $\n\"\"\"\n\n# we add more at the bottom\n__all__ = ['typeDict', 'typeNA', 'arraytypes', 'ScalarType', 'obj2dtype', 'cast', 'nbytes', 'dtype2char']\n\nfrom multiarray import typeinfo, ndarray, array, empty\nimport types as _types\n\n# we don't export these for import *, but we do want them accessible\n# as numerictypes.bool, etc.\nfrom __builtin__ import bool, int, long, float, complex, object, unicode, str\n\ntypeDict = {} # Contains all leaf-node numeric types with aliases\ntypeNA = {} # Contails all leaf-node types -> numarray type equivalences\nallTypes = {} # Collect the types we will add to the module here\n\ndef _evalname(name):\n k = 0\n for ch in name:\n if ch in '0123456789':\n break\n k += 1\n try:\n bits = int(name[k:])\n except ValueError:\n bits = 0\n base = name[:k]\n return base, bits\n\ndef bitname(obj):\n \"\"\"Return a bit-width name for a given type object\"\"\"\n name = obj.__name__[:-8]\n base = ''\n char = ''\n try:\n info = typeinfo[name.upper()]\n assert(info[-1] == obj) # sanity check\n bits = info[2]\n\n except KeyError: # bit-width name\n base, bits = _evalname(name)\n char = base[0]\n\n if name == 'bool':\n char = 'b'\n base = 'bool'\n elif name=='string':\n char = 'S'\n base = 'string'\n elif name=='unicode':\n char = 'U'\n base = 'unicode'\n elif name=='void':\n char = 'V'\n base = 'void'\n elif name=='object':\n char = 'O'\n base = 'object'\n bits = 0\n\n bytes = bits / 8\n\n if char != '' and bytes != 0:\n char = \"%s%d\" % (char, bytes)\n\n return base, bits, char\n\nrevdict = {}\n\ndef _add_types():\n for a in typeinfo.keys():\n name = a.lower()\n if isinstance(typeinfo[a], type(())):\n typeobj = typeinfo[a][-1]\n \n # define C-name and insert typenum and typechar references also\n allTypes[name] = typeobj\n typeDict[name] = typeobj\n typeDict[typeinfo[a][0]] = typeobj\n typeDict[typeinfo[a][1]] = typeobj\n\n # insert bit-width version for this class (if relevant)\n base, bit, char = bitname(typeobj)\n revdict[typeobj] = (typeinfo[a][:-1], (base, bit, char), a)\n if base != '':\n allTypes[\"%s%d\" % (base, bit)] = typeobj\n typeDict[\"%s%d\" % (base, bit)] = typeobj\n if base == 'uint':\n tmpstr = 'UInt%d' % bit\n typeDict[tmpstr] = typeobj\n na_name = tmpstr\n elif base == 'complex':\n na_num = '%s%d' % (base.capitalize(), bit/2)\n elif base == 'bool':\n na_name = base.capitalize()\n typeDict[na_name] = typeobj\n else:\n na_name = \"%s%d\" % (base.capitalize(), bit)\n typeDict[na_name] = typeobj\n typeNA[na_name] = typeobj\n typeNA[typeobj] = na_name\n typeNA[typeinfo[a][0]] = na_name\n if char != '':\n typeDict[char] = typeobj\n typeNA[char] = na_name\n else: # generic class\n allTypes[name] = typeinfo[a]\n_add_types()\n\n\n# We use these later\nvoid = allTypes['void']\ngeneric = allTypes['generic']\n\n#\n# Rework the Python names (so that float and complex and int are consistent\n# with Python usage)\n#\ndef _set_up_aliases():\n type_pairs = [('complex_', 'cdouble'),\n ('int0', 'intp'),\n ('uint0', 'uintp'),\n ('single', 'float'),\n ('csingle', 'cfloat'),\n ('float_', 'double'),\n ('intc', 'int'),\n ('uintc', 'uint'),\n ('int_', 'long'),\n ('uint', 'ulong'),\n ('cfloat', 'cdouble'),\n ('longfloat', 'longdouble'),\n ('clongfloat', 'clongdouble'),\n ('bool_', 'bool'),\n ('unicode_', 'unicode'),\n ('str_', 'string'),\n ('object_', 'object')]\n for alias, t in type_pairs:\n allTypes[alias] = allTypes[t]\n # Remove aliases overriding python types\n for t in ['ulong', 'object', 'unicode', 'int', 'long', 'float',\n 'complex', 'bool']:\n try:\n del allTypes[t]\n except KeyError:\n pass\n_set_up_aliases()\n\n# Now, construct dictionary to lookup character codes from types\n_dtype2char_dict = {}\ndef _construct_char_code_lookup():\n for name in typeinfo.keys():\n tup = typeinfo[name]\n if isinstance(tup, tuple):\n\t if tup[0] not in ['p','P']:\n _dtype2char_dict[tup[-1]] = tup[0]\n_construct_char_code_lookup()\n\n\narraytypes = {'int': [],\n 'uint':[],\n 'float':[],\n 'complex':[],\n 'others':[bool,object,str,unicode,void]}\n\ndef _add_array_type(typename, bits):\n try:\n t = allTypes['%s%d' % (typename, bits)]\n except KeyError:\n pass\n else:\n arraytypes[typename].append(t)\n\ndef _set_array_types():\n ibytes = [1, 2, 4, 8, 16, 32, 64]\n fbytes = [2, 4, 8, 10, 12, 16, 32, 64]\n for bytes in ibytes:\n bits = 8*bytes\n _add_array_type('int', bits)\n _add_array_type('uint', bits)\n for bytes in fbytes:\n bits = 8*bytes\n _add_array_type('float', bits)\n _add_array_type('complex', bits)\n_set_array_types()\n\ngenericTypeRank = ['bool', 'int8', 'uint8', 'int16', 'uint16',\n 'int32', 'uint32', 'int64', 'uint64', 'int128',\n 'uint128', 'float16',\n 'float32', 'float64', 'float80', 'float96', 'float128',\n 'float256',\n 'complex32', 'complex64', 'complex128', 'complex160',\n 'complex192', 'complex256', 'complex512', 'object']\n\ndef maximum_dtype(t):\n \"\"\"returns the type of highest precision of the same general kind as 't'\"\"\"\n g = obj2dtype(t)\n if g is None:\n return t\n t = g\n name = t.__name__[:-8]\n base, bits = _evalname(name)\n if bits == 0:\n return t\n else:\n return arraytypes[base][-1]\n\n_python_types = {int : 'int_',\n float: 'float_',\n complex: 'complex_',\n bool: 'bool_',\n str: 'string',\n unicode: 'unicode_',\n _types.BufferType: 'void',\n }\ndef _python_type(t):\n \"\"\"returns the type corresponding to a certain Python type\"\"\"\n if not isinstance(t, _types.TypeType):\n t = type(t)\n return allTypes[_python_types.get(t, 'object_')]\n\ndef isdtype(rep):\n \"\"\"Determines whether the given object represents\n a numeric array type.\"\"\"\n try:\n char = dtype2char(rep)\n return True\n except (KeyError, ValueError):\n return False\n\ndef obj2dtype(rep, default=None):\n try:\n if issubclass(rep, generic):\n return rep\n except TypeError:\n pass\n if isinstance(rep, type):\n return _python_type(rep)\n if isinstance(rep, ndarray):\n return rep.dtype\n res = typeDict.get(rep, default)\n return res\n\n\n# This dictionary allows look up based on any alias for a type\nclass _typedict(dict):\n def __getitem__(self, obj):\n return dict.__getitem__(self, obj2dtype(obj))\n\nnbytes = _typedict()\n_alignment = _typedict()\n_maxvals = _typedict()\n_minvals = _typedict()\ndef _construct_lookups():\n for name, val in typeinfo.iteritems():\n if not isinstance(val, tuple):\n continue\n obj = val[-1]\n nbytes[obj] = val[2] / 8\n _alignment[obj] = val[3]\n if (len(val) > 5):\n _maxvals[obj] = val[4]\n _minvals[obj] = val[5]\n else:\n _maxvals[obj] = None\n _minvals[obj] = None\n\n_construct_lookups()\n\ndef dtype2char(dtype):\n dtype = obj2dtype(dtype)\n if dtype is None:\n raise ValueError, \"unrecognized type\"\n return _dtype2char_dict[dtype]\n\n# Create dictionary of casting functions that wrap sequences\n# indexed by type or type character\n\n\ncast = _typedict()\nScalarType = [_types.IntType, _types.FloatType,\n _types.ComplexType, _types.LongType, _types.BooleanType,\n _types.StringType, _types.UnicodeType, _types.BufferType]\nScalarType.extend(_dtype2char_dict.keys())\nScalarType = tuple(ScalarType)\nfor key in _dtype2char_dict.keys():\n cast[key] = lambda x, k=key : array(x, copy=False).astype(k)\n\n\n_unicodesize = array('u','U').itemsize\n\n# Create the typestring lookup dictionary\n_typestr = _typedict()\nfor key in _dtype2char_dict.keys():\n if issubclass(key, allTypes['flexible']):\n _typestr[key] = _dtype2char_dict[key]\n else:\n _typestr[key] = empty((1,),key).dtypestr[1:]\n\n# Now add the types we've determined to this module\nfor key in allTypes:\n globals()[key] = allTypes[key]\n __all__.append(key)\n\ndel key\n\n", + "source_code_before": "# Borrowed and adapted from numarray\n\n\"\"\"numerictypes: Define the numeric type objects\n\nThis module is designed so 'from numerictypes import *' is safe.\nExported symbols include:\n\n Dictionary with all registered number types (including aliases):\n typeDict\n\n Type objects (not all will be available, depends on platform):\n see variable arraytypes for which ones you have\n\n Bit-width names\n\n int8 int16 int32 int64 int128\n uint8 uint16 uint32 uint64 uint128\n float16 float32 float64 float96 float128 float256\n complex32 complex64 complex128 complex192 complex256 complex512\n\n c-based names\n\n bool_\n\n object_\n\n void, str_, unicode_\n\n byte, ubyte,\n short, ushort\n intc, uintc,\n intp, uintp,\n int_, uint,\n longlong, ulonglong,\n\n single, csingle,\n float_, complex_,\n longfloat, clongfloat,\n\n As part of the type-hierarchy: xx -- is bit-width\n\n generic\n bool_\n numeric\n integer\n signedinteger (intxx)\n byte\n short\n intc\n intp int0\n int_\n longlong\n unsignedinteger (uintxx)\n ubyte\n ushort\n uintc\n uintp uint0\n uint_\n ulonglong\n floating (floatxx)\n single\n float_ (double)\n longfloat\n complexfloating (complexxx)\n csingle\n complex_ (cfloat, cdouble)\n clongfloat\n\n flexible\n character\n str_ (string)\n unicode_\n void\n\n object_\n\n$Id: numerictypes.py,v 1.17 2005/09/09 22:20:06 teoliphant Exp $\n\"\"\"\n\n# we add more at the bottom\n__all__ = ['typeDict', 'typeNA', 'arraytypes', 'ScalarType', 'obj2dtype', 'cast', 'nbytes', 'dtype2char']\n\nfrom multiarray import typeinfo, ndarray, array, empty\nimport types as _types\n\n# we don't export these for import *, but we do want them accessible\n# as numerictypes.bool, etc.\nfrom __builtin__ import bool, int, long, float, complex, object, unicode, str\n\ntypeDict = {} # Contains all leaf-node numeric types with aliases\ntypeNA = {} # Contails all leaf-node types -> numarray type equivalences\nallTypes = {} # Collect the types we will add to the module here\n\ndef _evalname(name):\n k = 0\n for ch in name:\n if ch in '0123456789':\n break\n k += 1\n try:\n bits = int(name[k:])\n except ValueError:\n bits = 0\n base = name[:k]\n return base, bits\n\ndef bitname(obj):\n \"\"\"Return a bit-width name for a given type object\"\"\"\n name = obj.__name__[:-8]\n base = ''\n char = ''\n try:\n info = typeinfo[name.upper()]\n assert(info[-1] == obj) # sanity check\n bits = info[2]\n\n except KeyError: # bit-width name\n base, bits = _evalname(name)\n char = base[0]\n\n if name == 'bool':\n char = 'b'\n base = 'bool'\n elif name=='string':\n char = 'S'\n base = 'string'\n elif name=='unicode':\n char = 'U'\n base = 'unicode'\n elif name=='void':\n char = 'V'\n base = 'void'\n elif name=='object':\n char = 'O'\n base = 'object'\n bits = 0\n\n bytes = bits / 8\n\n if char != '' and bytes != 0:\n char = \"%s%d\" % (char, bytes)\n\n return base, bits, char\n\nrevdict = {}\n\ndef _add_types():\n for a in typeinfo.keys():\n name = a.lower()\n if isinstance(typeinfo[a], type(())):\n typeobj = typeinfo[a][-1]\n \n # define C-name and insert typenum and typechar references also\n allTypes[name] = typeobj\n typeDict[name] = typeobj\n typeDict[typeinfo[a][0]] = typeobj\n typeDict[typeinfo[a][1]] = typeobj\n\n # insert bit-width version for this class (if relevant)\n base, bit, char = bitname(typeobj)\n revdict[typeobj] = (typeinfo[a][:-1], (base, bit, char), a)\n if base != '':\n allTypes[\"%s%d\" % (base, bit)] = typeobj\n typeDict[\"%s%d\" % (base, bit)] = typeobj\n if base == 'uint':\n tmpstr = 'UInt%d' % bit\n typeDict[tmpstr] = typeobj\n na_name = tmpstr\n elif base == 'complex':\n na_num = '%s%d' % (base.capitalize(), bit/2)\n elif base == 'bool':\n na_name = base.capitalize()\n typeDict[na_name] = typeobj\n else:\n na_name = \"%s%d\" % (base.capitalize(), bit)\n typeDict[na_name] = typeobj\n typeNA[na_name] = typeobj\n typeNA[typeobj] = na_name\n typeNA[typeinfo[a][0]] = na_name\n if char != '':\n typeDict[char] = typeobj\n typeNA[char] = na_name\n else: # generic class\n allTypes[name] = typeinfo[a]\n_add_types()\n\n\n# We use these later\nvoid = allTypes['void']\ngeneric = allTypes['generic']\n\n#\n# Rework the Python names (so that float and complex and int are consistent\n# with Python usage)\n#\ndef _set_up_aliases():\n type_pairs = [('complex_', 'cdouble'),\n ('int0', 'intp'),\n ('uint0', 'uintp'),\n ('single', 'float'),\n ('csingle', 'cfloat'),\n ('float_', 'double'),\n ('intc', 'int'),\n ('uintc', 'uint'),\n ('int_', 'long'),\n ('uint', 'ulong'),\n ('cfloat', 'cdouble'),\n ('longfloat', 'longdouble'),\n ('clongfloat', 'clongdouble'),\n ('bool_', 'bool'),\n ('unicode_', 'unicode'),\n ('str_', 'string'),\n ('object_', 'object')]\n for alias, t in type_pairs:\n allTypes[alias] = allTypes[t]\n # Remove aliases overriding python types\n for t in ['ulong', 'object', 'unicode', 'int', 'long', 'float',\n 'complex', 'bool']:\n try:\n del allTypes[t]\n except KeyError:\n pass\n_set_up_aliases()\n\n# Now, construct dictionary to lookup character codes from types\n_dtype2char_dict = {}\ndef _construct_char_code_lookup():\n for name in typeinfo.keys():\n tup = typeinfo[name]\n if isinstance(tup, tuple):\n\t if tup[0] not in ['p','P']:\n _dtype2char_dict[tup[-1]] = tup[0]\n_construct_char_code_lookup()\n\n\narraytypes = {'int': [],\n 'uint':[],\n 'float':[],\n 'complex':[],\n 'others':[bool,object,str,unicode,void]}\n\ndef _add_array_type(typename, bits):\n try:\n t = allTypes['%s%d' % (typename, bits)]\n except KeyError:\n pass\n else:\n arraytypes[typename].append(t)\n\ndef _set_array_types():\n ibytes = [1, 2, 4, 8, 16, 32, 64]\n fbytes = [2, 4, 8, 10, 12, 16, 32, 64]\n for bytes in ibytes:\n bits = 8*bytes\n _add_array_type('int', bits)\n _add_array_type('uint', bits)\n for bytes in fbytes:\n bits = 8*bytes\n _add_array_type('float', bits)\n _add_array_type('complex', bits)\n_set_array_types()\n\ngenericTypeRank = ['bool', 'int8', 'uint8', 'int16', 'uint16',\n 'int32', 'uint32', 'int64', 'uint64', 'int128',\n 'uint128', 'float16',\n 'float32', 'float64', 'float80', 'float96', 'float128',\n 'float256',\n 'complex32', 'complex64', 'complex128', 'complex160',\n 'complex192', 'complex256', 'complex512', 'object']\n\ndef maximum_dtype(t):\n \"\"\"returns the type of highest precision of the same general kind as 't'\"\"\"\n g = obj2dtype(t)\n if g is None:\n return t\n t = g\n name = t.__name__[:-8]\n base, bits = _evalname(name)\n if bits == 0:\n return t\n else:\n return arraytypes[base][-1]\n\n_python_types = {int : 'int_',\n float: 'float_',\n complex: 'complex_',\n bool: 'bool_',\n str: 'string',\n unicode: 'unicode_',\n _types.BufferType: 'void',\n }\ndef _python_type(t):\n \"\"\"returns the type corresponding to a certain Python type\"\"\"\n if not isinstance(t, _types.TypeType):\n t = type(t)\n return allTypes[_python_types.get(t, 'object_')]\n\ndef isdtype(rep):\n \"\"\"Determines whether the given object represents\n a numeric array type.\"\"\"\n try:\n char = dtype2char(rep)\n return True\n except (KeyError, ValueError):\n return False\n\ndef obj2dtype(rep, default=None):\n try:\n if issubclass(rep, generic):\n return rep\n except TypeError:\n pass\n if isinstance(rep, type):\n return _python_type(rep)\n if isinstance(rep, ndarray):\n return rep.dtype\n res = typeDict.get(rep, default)\n return res\n\n\n# This dictionary allows look up based on any alias for a type\nclass _typedict(dict):\n def __getitem__(self, obj):\n return dict.__getitem__(self, obj2dtype(obj))\n\nnbytes = _typedict()\n_alignment = _typedict()\n_maxvals = _typedict()\n_minvals = _typedict()\ndef _construct_lookups():\n for name, val in typeinfo.iteritems():\n if not isinstance(val, tuple):\n continue\n obj = val[-1]\n nbytes[obj] = val[2] / 8\n _alignment[obj] = val[3]\n if (len(val) > 5):\n _maxvals[obj] = val[4]\n _minvals[obj] = val[5]\n else:\n _maxvals[obj] = None\n _minvals[obj] = None\n\n_construct_lookups()\n\ndef dtype2char(dtype):\n dtype = obj2dtype(dtype)\n if dtype is None:\n raise ValueError, \"unrecognized type\"\n return _dtype2char_dict[dtype]\n\n# Create dictionary of casting functions that wrap sequences\n# indexed by type or type character\n\n\ncast = _typedict()\nScalarType = [_types.IntType, _types.FloatType,\n _types.ComplexType, _types.LongType, _types.BooleanType,\n _types.StringType, _types.UnicodeType, _types.BufferType]\nScalarType.extend(_dtype2char_dict.keys())\nScalarType = tuple(ScalarType)\nfor key in _dtype2char_dict.keys():\n cast[key] = lambda x, k=key : array(x, copy=False).astype(k)\n\n\n_unicodesize = array('u','U').itemsize\n\n# Create the typestring lookup dictionary\n_typestr = _typedict()\nfor key in _dtype2char_dict.keys():\n if issubclass(key, allTypes['flexible']):\n _typestr[key] = _dtype2char_dict[key]\n else:\n _typestr[key] = empty((1,),key).dtypestr[1:]\n\n# Now add the types we've determined to this module\nfor key in allTypes:\n globals()[key] = allTypes[key]\n __all__.append(key)\n\ndel key\n\n", + "methods": [ + { + "name": "_evalname", + "long_name": "_evalname( name )", + "filename": "numerictypes.py", + "nloc": 12, + "complexity": 4, + "token_count": 51, + "parameters": [ + "name" + ], + "start_line": 94, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "bitname", + "long_name": "bitname( obj )", + "filename": "numerictypes.py", + "nloc": 31, + "complexity": 9, + "token_count": 154, + "parameters": [ + "obj" + ], + "start_line": 107, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "_add_types", + "long_name": "_add_types( )", + "filename": "numerictypes.py", + "nloc": 34, + "complexity": 8, + "token_count": 276, + "parameters": [], + "start_line": 147, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "_set_up_aliases", + "long_name": "_set_up_aliases( )", + "filename": "numerictypes.py", + "nloc": 26, + "complexity": 4, + "token_count": 157, + "parameters": [], + "start_line": 196, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "_construct_char_code_lookup", + "long_name": "_construct_char_code_lookup( )", + "filename": "numerictypes.py", + "nloc": 6, + "complexity": 4, + "token_count": 53, + "parameters": [], + "start_line": 227, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_add_array_type", + "long_name": "_add_array_type( typename , bits )", + "filename": "numerictypes.py", + "nloc": 7, + "complexity": 2, + "token_count": 36, + "parameters": [ + "typename", + "bits" + ], + "start_line": 242, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_set_array_types", + "long_name": "_set_array_types( )", + "filename": "numerictypes.py", + "nloc": 11, + "complexity": 3, + "token_count": 84, + "parameters": [], + "start_line": 250, + "end_line": 260, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "maximum_dtype", + "long_name": "maximum_dtype( t )", + "filename": "numerictypes.py", + "nloc": 11, + "complexity": 3, + "token_count": 58, + "parameters": [ + "t" + ], + "start_line": 271, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "_python_type", + "long_name": "_python_type( t )", + "filename": "numerictypes.py", + "nloc": 4, + "complexity": 2, + "token_count": 35, + "parameters": [ + "t" + ], + "start_line": 292, + "end_line": 296, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "isdtype", + "long_name": "isdtype( rep )", + "filename": "numerictypes.py", + "nloc": 6, + "complexity": 2, + "token_count": 25, + "parameters": [ + "rep" + ], + "start_line": 298, + "end_line": 305, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "obj2dtype", + "long_name": "obj2dtype( rep , default = None )", + "filename": "numerictypes.py", + "nloc": 12, + "complexity": 5, + "token_count": 62, + "parameters": [ + "rep", + "default" + ], + "start_line": 307, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , obj )", + "filename": "numerictypes.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "obj" + ], + "start_line": 323, + "end_line": 324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_construct_lookups", + "long_name": "_construct_lookups( )", + "filename": "numerictypes.py", + "nloc": 13, + "complexity": 4, + "token_count": 94, + "parameters": [], + "start_line": 330, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dtype2char", + "long_name": "dtype2char( dtype )", + "filename": "numerictypes.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "dtype" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_evalname", + "long_name": "_evalname( name )", + "filename": "numerictypes.py", + "nloc": 12, + "complexity": 4, + "token_count": 51, + "parameters": [ + "name" + ], + "start_line": 94, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "bitname", + "long_name": "bitname( obj )", + "filename": "numerictypes.py", + "nloc": 31, + "complexity": 9, + "token_count": 154, + "parameters": [ + "obj" + ], + "start_line": 107, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "_add_types", + "long_name": "_add_types( )", + "filename": "numerictypes.py", + "nloc": 34, + "complexity": 8, + "token_count": 276, + "parameters": [], + "start_line": 147, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "_set_up_aliases", + "long_name": "_set_up_aliases( )", + "filename": "numerictypes.py", + "nloc": 26, + "complexity": 4, + "token_count": 157, + "parameters": [], + "start_line": 196, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "_construct_char_code_lookup", + "long_name": "_construct_char_code_lookup( )", + "filename": "numerictypes.py", + "nloc": 6, + "complexity": 4, + "token_count": 53, + "parameters": [], + "start_line": 227, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_add_array_type", + "long_name": "_add_array_type( typename , bits )", + "filename": "numerictypes.py", + "nloc": 7, + "complexity": 2, + "token_count": 36, + "parameters": [ + "typename", + "bits" + ], + "start_line": 242, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_set_array_types", + "long_name": "_set_array_types( )", + "filename": "numerictypes.py", + "nloc": 11, + "complexity": 3, + "token_count": 84, + "parameters": [], + "start_line": 250, + "end_line": 260, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "maximum_dtype", + "long_name": "maximum_dtype( t )", + "filename": "numerictypes.py", + "nloc": 11, + "complexity": 3, + "token_count": 58, + "parameters": [ + "t" + ], + "start_line": 271, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "_python_type", + "long_name": "_python_type( t )", + "filename": "numerictypes.py", + "nloc": 4, + "complexity": 2, + "token_count": 35, + "parameters": [ + "t" + ], + "start_line": 292, + "end_line": 296, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "isdtype", + "long_name": "isdtype( rep )", + "filename": "numerictypes.py", + "nloc": 6, + "complexity": 2, + "token_count": 25, + "parameters": [ + "rep" + ], + "start_line": 298, + "end_line": 305, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "obj2dtype", + "long_name": "obj2dtype( rep , default = None )", + "filename": "numerictypes.py", + "nloc": 12, + "complexity": 5, + "token_count": 62, + "parameters": [ + "rep", + "default" + ], + "start_line": 307, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , obj )", + "filename": "numerictypes.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "obj" + ], + "start_line": 323, + "end_line": 324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_construct_lookups", + "long_name": "_construct_lookups( )", + "filename": "numerictypes.py", + "nloc": 13, + "complexity": 4, + "token_count": 94, + "parameters": [], + "start_line": 330, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dtype2char", + "long_name": "dtype2char( dtype )", + "filename": "numerictypes.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "dtype" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 316, + "complexity": 53, + "token_count": 1574, + "diff_parsed": { + "added": [ + " number" + ], + "deleted": [ + " numeric" + ] + } + }, + { + "old_path": "numpy/lib/convertcode.py", + "new_path": "numpy/lib/convertcode.py", + "filename": "convertcode.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -95,10 +95,10 @@ def fromstr(filestr):\n 'numpy.core.multiarray')\n filestr, fromall1 = changeimports(filestr, 'umath',\n 'numpy.core.umath')\n- filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy.core')\n- filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy.core')\n- filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy.core')\n- filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.core.mlab')\n+ filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy')\n+ filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy')\n+ filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy')\n+ filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab')\n filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.linalg')\n filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random')\n", + "added_lines": 4, + "deleted_lines": 4, + "source_code": "\n# This module converts code written for Numeric to run with numpy.base\n\n# Makes the following changes:\n# * Converts typecharacters\n# * Changes import statements (warns of use of from Numeric import *)\n# * Changes import statements (using numerix) ...\n# * Makes search and replace changes to:\n# - .typecode()\n# - .iscontiguous()\n# - .byteswapped()\n# - .itemsize()\n# * Converts .flat to .ravel() except for .flat = xxx or .flat[xxx]\n# * Change typecode= to dtype=\n# * Eliminates savespace=xxx\n# * Replace xxx.spacesaver() with True\n# * Convert xx.savespace(?) to pass + ## xx.savespace(?)\n# #### -- not * Convert a.shape = ? to a.reshape(?) \n# * Prints warning for use of bool, int, float, copmlex, object, and unicode\n#\n\n__all__ = ['fromfile', 'fromstr']\n\nimport sys\nimport os\nimport re\nimport glob\n\nflatindex_re = re.compile('([.]flat(\\s*?[[=]))')\n\ndef replacetypechars(astr):\n# astr = astr.replace(\"'s'\",\"'h'\")\n# astr = astr.replace(\"'c'\",\"'S1'\")\n astr = astr.replace(\"'b'\",\"'B'\")\n astr = astr.replace(\"'1'\",\"'b'\")\n# astr = astr.replace(\"'w'\",\"'H'\")\n astr = astr.replace(\"'u'\",\"'I'\")\n return astr\n\ndef changeimports(fstr, name, newname):\n importstr = 'import %s' % name\n importasstr = 'import %s as ' % name\n fromstr = 'from %s import ' % name\n fromall=0\n\n fstr = fstr.replace(importasstr, 'import %s as ' % newname)\n fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name))\n\n ind = 0\n Nlen = len(fromstr)\n Nlen2 = len(\"from %s import \" % newname)\n while 1:\n found = fstr.find(fromstr,ind)\n if (found < 0):\n break\n ind = found + Nlen\n if fstr[ind] == '*':\n continue\n fstr = \"%sfrom %s import %s\" % (fstr[:found], newname, fstr[ind:])\n ind += Nlen2 - Nlen\n return fstr, fromall\n\ndef replaceattr(astr):\n astr = astr.replace(\".typecode()\",\".dtypechar\")\n astr = astr.replace(\".iscontiguous()\",\".flags.contiguous\")\n astr = astr.replace(\".byteswapped()\",\".byteswap()\")\n astr = astr.replace(\".toscalar()\", \".item()\")\n astr = astr.replace(\".itemsize()\",\".itemsize\")\n # preserve uses of flat that should be o.k.\n tmpstr = flatindex_re.sub(\"@@@@\\\\2\",astr)\n # replace other uses of flat\n tmpstr = tmpstr.replace(\".flat\",\".ravel()\")\n # put back .flat where it was valid\n astr = tmpstr.replace(\"@@@@\", \".flat\")\n return astr\n\nsvspc = re.compile(r'(\\S+\\s*[(].+),\\s*savespace\\s*=.+\\s*[)]')\nsvspc2 = re.compile(r'([^,(\\s]+[.]spacesaver[(][)])')\nsvspc3 = re.compile(r'(\\S+[.]savespace[(].*[)])')\n#shpe = re.compile(r'(\\S+\\s*)[.]shape\\s*=[^=]\\s*(.+)')\ndef replaceother(astr):\n astr = astr.replace(\"typecode=\",\"dtype=\")\n astr = astr.replace(\"UserArray\",\"ndarray\")\n astr = svspc.sub('\\\\1)',astr)\n astr = svspc2.sub('True',astr)\n astr = svspc3.sub('pass ## \\\\1', astr)\n #astr = shpe.sub('\\\\1=\\\\1.reshape(\\\\2)', astr)\n return astr\n\nimport datetime\ndef fromstr(filestr):\n filestr = replacetypechars(filestr)\n filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy')\n filestr, fromall1 = changeimports(filestr, 'multiarray',\n 'numpy.core.multiarray')\n filestr, fromall1 = changeimports(filestr, 'umath',\n 'numpy.core.umath')\n filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy')\n filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab')\n filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.linalg')\n filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft')\n filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma')\n fromall = fromall1 or fromall2 or fromall3\n filestr = replaceattr(filestr)\n filestr = replaceother(filestr)\n today = datetime.date.today().strftime('%b %d, %Y')\n name = os.path.split(sys.argv[0])[-1]\n filestr = '## Automatically adapted for '\\\n 'numpy %s by %s\\n\\n%s' % (today, name, filestr)\n return filestr\n\ndef makenewfile(name, filestr):\n fid = file(name, 'w')\n fid.write(filestr)\n fid.close()\n\ndef getandcopy(name):\n fid = file(name)\n filestr = fid.read()\n fid.close()\n base, ext = os.path.splitext(name)\n makenewfile(base+'.orig', filestr)\n return filestr\n\ndef fromfile(filename):\n filestr = getandcopy(filename)\n filestr = fromstr(filestr)\n makenewfile(filename, filestr)\n \ndef fromargs(args):\n filename = args[1]\n fromfile(filename)\n\ndef convertall(direc=''):\n files = glob.glob(os.path.join(direc,'*.py'))\n for afile in files:\n fromfile(afile)\n\nif __name__ == '__main__':\n fromargs(sys.argv)\n \n \n\n", + "source_code_before": "\n# This module converts code written for Numeric to run with numpy.base\n\n# Makes the following changes:\n# * Converts typecharacters\n# * Changes import statements (warns of use of from Numeric import *)\n# * Changes import statements (using numerix) ...\n# * Makes search and replace changes to:\n# - .typecode()\n# - .iscontiguous()\n# - .byteswapped()\n# - .itemsize()\n# * Converts .flat to .ravel() except for .flat = xxx or .flat[xxx]\n# * Change typecode= to dtype=\n# * Eliminates savespace=xxx\n# * Replace xxx.spacesaver() with True\n# * Convert xx.savespace(?) to pass + ## xx.savespace(?)\n# #### -- not * Convert a.shape = ? to a.reshape(?) \n# * Prints warning for use of bool, int, float, copmlex, object, and unicode\n#\n\n__all__ = ['fromfile', 'fromstr']\n\nimport sys\nimport os\nimport re\nimport glob\n\nflatindex_re = re.compile('([.]flat(\\s*?[[=]))')\n\ndef replacetypechars(astr):\n# astr = astr.replace(\"'s'\",\"'h'\")\n# astr = astr.replace(\"'c'\",\"'S1'\")\n astr = astr.replace(\"'b'\",\"'B'\")\n astr = astr.replace(\"'1'\",\"'b'\")\n# astr = astr.replace(\"'w'\",\"'H'\")\n astr = astr.replace(\"'u'\",\"'I'\")\n return astr\n\ndef changeimports(fstr, name, newname):\n importstr = 'import %s' % name\n importasstr = 'import %s as ' % name\n fromstr = 'from %s import ' % name\n fromall=0\n\n fstr = fstr.replace(importasstr, 'import %s as ' % newname)\n fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name))\n\n ind = 0\n Nlen = len(fromstr)\n Nlen2 = len(\"from %s import \" % newname)\n while 1:\n found = fstr.find(fromstr,ind)\n if (found < 0):\n break\n ind = found + Nlen\n if fstr[ind] == '*':\n continue\n fstr = \"%sfrom %s import %s\" % (fstr[:found], newname, fstr[ind:])\n ind += Nlen2 - Nlen\n return fstr, fromall\n\ndef replaceattr(astr):\n astr = astr.replace(\".typecode()\",\".dtypechar\")\n astr = astr.replace(\".iscontiguous()\",\".flags.contiguous\")\n astr = astr.replace(\".byteswapped()\",\".byteswap()\")\n astr = astr.replace(\".toscalar()\", \".item()\")\n astr = astr.replace(\".itemsize()\",\".itemsize\")\n # preserve uses of flat that should be o.k.\n tmpstr = flatindex_re.sub(\"@@@@\\\\2\",astr)\n # replace other uses of flat\n tmpstr = tmpstr.replace(\".flat\",\".ravel()\")\n # put back .flat where it was valid\n astr = tmpstr.replace(\"@@@@\", \".flat\")\n return astr\n\nsvspc = re.compile(r'(\\S+\\s*[(].+),\\s*savespace\\s*=.+\\s*[)]')\nsvspc2 = re.compile(r'([^,(\\s]+[.]spacesaver[(][)])')\nsvspc3 = re.compile(r'(\\S+[.]savespace[(].*[)])')\n#shpe = re.compile(r'(\\S+\\s*)[.]shape\\s*=[^=]\\s*(.+)')\ndef replaceother(astr):\n astr = astr.replace(\"typecode=\",\"dtype=\")\n astr = astr.replace(\"UserArray\",\"ndarray\")\n astr = svspc.sub('\\\\1)',astr)\n astr = svspc2.sub('True',astr)\n astr = svspc3.sub('pass ## \\\\1', astr)\n #astr = shpe.sub('\\\\1=\\\\1.reshape(\\\\2)', astr)\n return astr\n\nimport datetime\ndef fromstr(filestr):\n filestr = replacetypechars(filestr)\n filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy')\n filestr, fromall1 = changeimports(filestr, 'multiarray',\n 'numpy.core.multiarray')\n filestr, fromall1 = changeimports(filestr, 'umath',\n 'numpy.core.umath')\n filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy.core')\n filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy.core')\n filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy.core')\n filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.core.mlab')\n filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.linalg')\n filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft')\n filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma')\n fromall = fromall1 or fromall2 or fromall3\n filestr = replaceattr(filestr)\n filestr = replaceother(filestr)\n today = datetime.date.today().strftime('%b %d, %Y')\n name = os.path.split(sys.argv[0])[-1]\n filestr = '## Automatically adapted for '\\\n 'numpy %s by %s\\n\\n%s' % (today, name, filestr)\n return filestr\n\ndef makenewfile(name, filestr):\n fid = file(name, 'w')\n fid.write(filestr)\n fid.close()\n\ndef getandcopy(name):\n fid = file(name)\n filestr = fid.read()\n fid.close()\n base, ext = os.path.splitext(name)\n makenewfile(base+'.orig', filestr)\n return filestr\n\ndef fromfile(filename):\n filestr = getandcopy(filename)\n filestr = fromstr(filestr)\n makenewfile(filename, filestr)\n \ndef fromargs(args):\n filename = args[1]\n fromfile(filename)\n\ndef convertall(direc=''):\n files = glob.glob(os.path.join(direc,'*.py'))\n for afile in files:\n fromfile(afile)\n\nif __name__ == '__main__':\n fromargs(sys.argv)\n \n \n\n", + "methods": [ + { + "name": "replacetypechars", + "long_name": "replacetypechars( astr )", + "filename": "convertcode.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "astr" + ], + "start_line": 31, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "changeimports", + "long_name": "changeimports( fstr , name , newname )", + "filename": "convertcode.py", + "nloc": 20, + "complexity": 4, + "token_count": 135, + "parameters": [ + "fstr", + "name", + "newname" + ], + "start_line": 40, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "replaceattr", + "long_name": "replaceattr( astr )", + "filename": "convertcode.py", + "nloc": 10, + "complexity": 1, + "token_count": 87, + "parameters": [ + "astr" + ], + "start_line": 63, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "replaceother", + "long_name": "replaceother( astr )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 57, + "parameters": [ + "astr" + ], + "start_line": 81, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fromstr", + "long_name": "fromstr( filestr )", + "filename": "convertcode.py", + "nloc": 24, + "complexity": 3, + "token_count": 222, + "parameters": [ + "filestr" + ], + "start_line": 91, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "makenewfile", + "long_name": "makenewfile( name , filestr )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "name", + "filestr" + ], + "start_line": 116, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getandcopy", + "long_name": "getandcopy( name )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 45, + "parameters": [ + "name" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "fromfile", + "long_name": "fromfile( filename )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "filename" + ], + "start_line": 129, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "fromargs", + "long_name": "fromargs( args )", + "filename": "convertcode.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "args" + ], + "start_line": 134, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "convertall", + "long_name": "convertall( direc = '' )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 2, + "token_count": 33, + "parameters": [ + "direc" + ], + "start_line": 138, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "replacetypechars", + "long_name": "replacetypechars( astr )", + "filename": "convertcode.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "astr" + ], + "start_line": 31, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "changeimports", + "long_name": "changeimports( fstr , name , newname )", + "filename": "convertcode.py", + "nloc": 20, + "complexity": 4, + "token_count": 135, + "parameters": [ + "fstr", + "name", + "newname" + ], + "start_line": 40, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "replaceattr", + "long_name": "replaceattr( astr )", + "filename": "convertcode.py", + "nloc": 10, + "complexity": 1, + "token_count": 87, + "parameters": [ + "astr" + ], + "start_line": 63, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "replaceother", + "long_name": "replaceother( astr )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 57, + "parameters": [ + "astr" + ], + "start_line": 81, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fromstr", + "long_name": "fromstr( filestr )", + "filename": "convertcode.py", + "nloc": 24, + "complexity": 3, + "token_count": 222, + "parameters": [ + "filestr" + ], + "start_line": 91, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "makenewfile", + "long_name": "makenewfile( name , filestr )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "name", + "filestr" + ], + "start_line": 116, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getandcopy", + "long_name": "getandcopy( name )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 45, + "parameters": [ + "name" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "fromfile", + "long_name": "fromfile( filename )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "filename" + ], + "start_line": 129, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "fromargs", + "long_name": "fromargs( args )", + "filename": "convertcode.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "args" + ], + "start_line": 134, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "convertall", + "long_name": "convertall( direc = '' )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 2, + "token_count": 33, + "parameters": [ + "direc" + ], + "start_line": 138, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "fromstr", + "long_name": "fromstr( filestr )", + "filename": "convertcode.py", + "nloc": 24, + "complexity": 3, + "token_count": 222, + "parameters": [ + "filestr" + ], + "start_line": 91, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + } + ], + "nloc": 100, + "complexity": 16, + "token_count": 753, + "diff_parsed": { + "added": [ + " filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy')", + " filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy')", + " filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy')", + " filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab')" + ], + "deleted": [ + " filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy.core')", + " filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy.core')", + " filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy.core')", + " filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.core.mlab')" + ] + } + } + ] + }, + { + "hash": "605f8a5533071a0939fb5cbbc94dafede8006074", + "msg": "More documentation updates", + "author": { + "name": "edschofield", + "email": "edschofield@localhost" + }, + "committer": { + "name": "edschofield", + "email": "edschofield@localhost" + }, + "author_date": "2006-01-05T00:27:06+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T00:27:06+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "6a0653c0eabcc39a1a45565fc9dd21857c465aba" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 34, + "insertions": 40, + "lines": 74, + "files": 7, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "README.txt", + "new_path": "README.txt", + "filename": "README.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -1,10 +1,11 @@\n \n-Scipy Core is a replacement of Numeric Python that adds the features\n-of numarray. To install:\n+NumPy (previously called SciPy core) is a replacement of Numeric Python that\n+adds the features of numarray. To install:\n \n python setup.py install\n \n-The setup.py script will take advantage of fast BLAS on your system if it can find it. You can help the process with a site.cfg file.\n+The setup.py script will take advantage of fast BLAS on your system if it can\n+find it. You can help the process with a site.cfg file.\n \n If fast BLAS and LAPACK cannot be found, then a slower default version is used. \n \n", + "added_lines": 4, + "deleted_lines": 3, + "source_code": "\nNumPy (previously called SciPy core) is a replacement of Numeric Python that\nadds the features of numarray. To install:\n\npython setup.py install\n\nThe setup.py script will take advantage of fast BLAS on your system if it can\nfind it. You can help the process with a site.cfg file.\n\nIf fast BLAS and LAPACK cannot be found, then a slower default version is used. \n\nThe current version is always available from a Subversion repostiory:\n\nhttp://svn.numpy.org/svn/numpy_core/trunk \n\n", + "source_code_before": "\nScipy Core is a replacement of Numeric Python that adds the features\nof numarray. To install:\n\npython setup.py install\n\nThe setup.py script will take advantage of fast BLAS on your system if it can find it. You can help the process with a site.cfg file.\n\nIf fast BLAS and LAPACK cannot be found, then a slower default version is used. \n\nThe current version is always available from a Subversion repostiory:\n\nhttp://svn.numpy.org/svn/numpy_core/trunk \n\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "NumPy (previously called SciPy core) is a replacement of Numeric Python that", + "adds the features of numarray. To install:", + "The setup.py script will take advantage of fast BLAS on your system if it can", + "find it. You can help the process with a site.cfg file." + ], + "deleted": [ + "Scipy Core is a replacement of Numeric Python that adds the features", + "of numarray. To install:", + "The setup.py script will take advantage of fast BLAS on your system if it can find it. You can help the process with a site.cfg file." + ] + } + }, + { + "old_path": "benchmarks/sorting.py", + "new_path": "benchmarks/sorting.py", + "filename": "sorting.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,7 +7,7 @@\n \n print \"1-D length = \", N\n print \"Numarray: \", t1.repeat(3,100)\n-print \"SciPy: \", t2.repeat(3,100)\n+print \"NumPy: \", t2.repeat(3,100)\n print \"Numeric: \", t3.repeat(3,100)\n \n N1,N2 = 100,100\n@@ -17,7 +17,7 @@\n \n print \"2-D shape = (%d,%d), last-axis\" % (N1,N2)\n print \"Numarray: \", t1.repeat(3,100)\n-print \"SciPy: \", t2.repeat(3,100)\n+print \"NumPy: \", t2.repeat(3,100)\n print \"Numeric: \", t3.repeat(3,100)\n \n N1,N2 = 100,100\n@@ -27,7 +27,7 @@\n \n print \"2-D shape = (%d,%d), first-axis\" % (N1,N2)\n print \"Numarray: \", t1.repeat(3,100)\n-print \"SciPy: \", t2.repeat(3,100)\n+print \"NumPy: \", t2.repeat(3,100)\n print \"Numeric: \", t3.repeat(3,100)\n \n \n", + "added_lines": 3, + "deleted_lines": 3, + "source_code": "import timeit\n\nN = 10000\nt1 = timeit.Timer('a=array(None,shape=%d);a.sort()'%N,'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=%d);a.sort()'%N,'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=%d);sort(a)'%N,'from Numeric import empty,sort')\n\nprint \"1-D length = \", N\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"NumPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\nN1,N2 = 100,100\nt1 = timeit.Timer('a=array(None,shape=(%d,%d));a.sort()'%(N1,N2),'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=(%d,%d));a.sort()'%(N1,N2),'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=(%d,%d));sort(a)'%(N1,N2),'from Numeric import empty,sort')\n\nprint \"2-D shape = (%d,%d), last-axis\" % (N1,N2)\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"NumPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\nN1,N2 = 100,100\nt1 = timeit.Timer('a=array(None,shape=(%d,%d));a.sort(0)'%(N1,N2),'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=(%d,%d));a.sort(0)'%(N1,N2),'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=(%d,%d));sort(a,0)'%(N1,N2),'from Numeric import empty,sort')\n\nprint \"2-D shape = (%d,%d), first-axis\" % (N1,N2)\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"NumPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\n\n\n\n\n", + "source_code_before": "import timeit\n\nN = 10000\nt1 = timeit.Timer('a=array(None,shape=%d);a.sort()'%N,'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=%d);a.sort()'%N,'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=%d);sort(a)'%N,'from Numeric import empty,sort')\n\nprint \"1-D length = \", N\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"SciPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\nN1,N2 = 100,100\nt1 = timeit.Timer('a=array(None,shape=(%d,%d));a.sort()'%(N1,N2),'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=(%d,%d));a.sort()'%(N1,N2),'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=(%d,%d));sort(a)'%(N1,N2),'from Numeric import empty,sort')\n\nprint \"2-D shape = (%d,%d), last-axis\" % (N1,N2)\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"SciPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\nN1,N2 = 100,100\nt1 = timeit.Timer('a=array(None,shape=(%d,%d));a.sort(0)'%(N1,N2),'from numarray import array')\nt2 = timeit.Timer('a=empty(shape=(%d,%d));a.sort(0)'%(N1,N2),'from numpy import empty')\nt3 = timeit.Timer('a=empty(shape=(%d,%d));sort(a,0)'%(N1,N2),'from Numeric import empty,sort')\n\nprint \"2-D shape = (%d,%d), first-axis\" % (N1,N2)\nprint \"Numarray: \", t1.repeat(3,100)\nprint \"SciPy: \", t2.repeat(3,100)\nprint \"Numeric: \", t3.repeat(3,100)\n\n\n\n\n\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 25, + "complexity": 0, + "token_count": 270, + "diff_parsed": { + "added": [ + "print \"NumPy: \", t2.repeat(3,100)", + "print \"NumPy: \", t2.repeat(3,100)", + "print \"NumPy: \", t2.repeat(3,100)" + ], + "deleted": [ + "print \"SciPy: \", t2.repeat(3,100)", + "print \"SciPy: \", t2.repeat(3,100)", + "print \"SciPy: \", t2.repeat(3,100)" + ] + } + }, + { + "old_path": "numpy/core/src/arrayobject.c", + "new_path": "numpy/core/src/arrayobject.c", + "filename": "arrayobject.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -5863,7 +5863,7 @@ static PyObject *\n array_fromobject(PyObject *op, PyArray_Descr *newtype, int min_depth, \n \t\t int max_depth, int flags) \n {\n- /* This is the main code to make a SciPy array from a Python\n+ /* This is the main code to make a NumPy array from a Python\n Object. It is called from lot's of different places which\n is why there are so many checks. The comments try to\n explain some of the checks. */\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "/*\n Provide multidimensional arrays as a basic object type in python. \n\nBased on Original Numeric implementation\nCopyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu\n\nwith contributions from many Numeric Python developers 1995-2004 \n\nHeavily modified in 2005 with inspiration from Numarray \n\nby\n\nTravis Oliphant\nAssistant Professor at\nBrigham Young University \n\nmaintainer email: oliphant.travis@ieee.org\n\nNumarray design (which provided guidance) by \nSpace Science Telescope Institute \n (J. Todd Miller, Perry Greenfield, Rick White)\n\n*/\n\n/* Helper functions */\n\n#define error_converting(x) (((x) == -1) && PyErr_Occurred())\n\n/*OBJECT_API*/\nstatic intp\nPyArray_PyIntAsIntp(PyObject *o)\n{\n\tlonglong long_value = -1;\n\tPyObject *obj;\n\tstatic char *msg = \"an integer is required\";\n\tPyObject *arr=NULL;\n\tPyArray_Descr *descr;\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\tdescr = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_Check(o)) {\n\t\tif (PyArray_SIZE(o)!=1 || !PyArray_ISINTEGER(o)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\tPy_DECREF(descr);\n\t\t\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, descr, 0);\n\t}\n\telse if (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, descr);\n\t}\n\tif (arr != NULL) {\n\t\tret = *((intp *)PyArray_DATA(arr));\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\t\t\n\tif (PyInt_Check(o)) {\n\t\tlong_value = (longlong) PyInt_AS_LONG(o);\n\t} else if (PyLong_Check(o)) {\n\t\tlong_value = (longlong) PyLong_AsLongLong(o);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_long != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_long(o);\n\t\tif (obj != NULL) {\n\t\t\tlong_value = (longlong) PyLong_AsLongLong(obj);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_int != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_int(o);\n\t\tif (obj != NULL) {\n\t\t\tlong_value = (longlong) PyLong_AsLongLong(obj);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t} else {\n\t\tPyErr_SetString(PyExc_NotImplementedError,\"\");\n\t}\n\t\n\tif error_converting(long_value) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\t\n#if (SIZEOF_LONGLONG != SIZEOF_PY_INTPTR_T)\n\tif ((long_value < MIN_INTP) || (long_value > MAX_INTP)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"integer won't fit into a C intp\");\n\t\treturn -1;\n\t}\n#endif\n\treturn (intp) long_value;\n}\n\n\nstatic PyObject *array_int(PyArrayObject *v);\n\n/*OBJECT_API*/\nstatic int\nPyArray_PyIntAsInt(PyObject *o)\n{\n\tlong long_value = -1;\n\tPyObject *obj;\n\tstatic char *msg = \"an integer is required\";\n\tPyObject *arr=NULL;\n\tPyArray_Descr *descr;\n\tint ret;\n\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\tdescr = PyArray_DescrFromType(PyArray_INT);\n\tif (PyArray_Check(o)) {\n\t\tif (PyArray_SIZE(o)!=1 || !PyArray_ISINTEGER(o)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\tPy_DECREF(descr);\n\t\t\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, descr, 0);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, descr);\n\t}\n\tif (arr != NULL) {\n\t\tret = *((int *)PyArray_DATA(arr));\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\t\t\n\tif (PyInt_Check(o)) {\n\t\tlong_value = (long) PyInt_AS_LONG(o);\n\t} else if (PyLong_Check(o)) {\n\t\tlong_value = (long) PyLong_AsLong(o);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_long != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_long(o);\n\t\tif (obj == NULL) return -1;\n\t\tlong_value = (long) PyLong_AsLong(obj);\n\t\tPy_DECREF(obj);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_int != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_int(o);\n\t\tif (obj == NULL) return -1;\n\t\tlong_value = (long) PyLong_AsLong(obj);\n\t\tPy_DECREF(obj);\n\t} else {\n\t\tPyErr_SetString(PyExc_NotImplementedError,\"\");\n\t}\n\tif error_converting(long_value) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\t\n#if (SIZEOF_LONG != SIZEOF_INT)\n\tif ((long_value < INT_MIN) || (long_value > INT_MAX)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"integer won't fit into a C int\");\n\t\treturn -1;\n\t}\n#endif\n\treturn (int) long_value;\n}\n\n\n/*OBJECT_API\n Get Priority from object\n*/\nstatic double\nPyArray_GetPriority(PyObject *obj, double default_) \n{\n PyObject *ret;\n double priority=PyArray_PRIORITY;\n\n\tif (PyArray_CheckExact(obj))\n\t\treturn priority;\n if (PyBigArray_CheckExact(obj)) \n return PyArray_BIG_PRIORITY;\n\n ret = PyObject_GetAttrString(obj, \"__array_priority__\");\n if (ret != NULL) priority = PyFloat_AsDouble(ret);\n if (PyErr_Occurred()) {\n PyErr_Clear(); \n priority = default_;\n }\n Py_XDECREF(ret);\n return priority; \n}\n\n/* Backward compatibility only */\n/* In both Zero and One\n\n ***You must free the memory once you are done with it\n using PyDataMem_FREE(ptr) or you create a memory leak***\n\n If arr is an Object array you are getting a \n BORROWED reference to Zero or One.\n Do not DECREF.\n Please INCREF if you will be hanging on to it.\n\n The memory for the ptr still must be freed in any case;\n*/\n\n\n/*OBJECT_API\n Get pointer to zero of correct type for array.\n*/\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n char *zeroval;\n int ret, storeflags;\n PyObject *obj;\n\n zeroval = PyDataMem_NEW(arr->descr->elsize);\n if (zeroval == NULL) {\n PyErr_SetNone(PyExc_MemoryError);\n return NULL;\n }\n\n\tobj=PyInt_FromLong((long) 0);\n if (PyArray_ISOBJECT(arr)) {\n memcpy(zeroval, &obj, sizeof(PyObject *));\n Py_DECREF(obj);\n return zeroval;\n }\n\tstoreflags = arr->flags;\n\tarr->flags |= BEHAVED_FLAGS;\n ret = arr->descr->f->setitem(obj, zeroval, arr);\n\tarr->flags = storeflags;\n\tPy_DECREF(obj);\n\tif (ret < 0) {\n\t\tPyDataMem_FREE(zeroval);\n\t\treturn NULL;\n\t}\n return zeroval;\n}\n\n/*OBJECT_API\n Get pointer to one of correct type for array\n*/\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n char *oneval;\n int ret, storeflags;\n PyObject *obj;\n\n oneval = PyDataMem_NEW(arr->descr->elsize);\n if (oneval == NULL) {\n PyErr_SetNone(PyExc_MemoryError);\n return NULL;\n }\n\n obj = PyInt_FromLong((long) 1);\n if (PyArray_ISOBJECT(arr)) {\n memcpy(oneval, &obj, sizeof(PyObject *));\n Py_DECREF(obj);\n return oneval;\n } \n\n\tstoreflags = arr->flags;\n\tarr->flags |= BEHAVED_FLAGS;\n ret = arr->descr->f->setitem(obj, oneval, arr);\n\tarr->flags = storeflags;\n Py_DECREF(obj);\n if (ret < 0) {\n PyDataMem_FREE(oneval);\n return NULL;\n }\n return oneval;\n}\n\n/* End deprecated */\n\n\nstatic int \ndo_sliced_copy(char *dest, intp *dest_strides, intp *dest_dimensions,\n\t int dest_nd, char *src, intp *src_strides, \n\t intp *src_dimensions, int src_nd, int elsize, \n\t int copies) {\n intp i, j;\n\t\n if (src_nd == 0 && dest_nd == 0) {\n for(j=0; j src_nd) {\n for(i=0; i<*dest_dimensions; i++, dest += *dest_strides) {\n if (do_sliced_copy(dest, dest_strides+1, \n dest_dimensions+1, dest_nd-1,\n src, src_strides, \n src_dimensions, src_nd, \n elsize, copies) == -1) \n return -1;\n }\n return 0;\n }\n\t\n if (dest_nd == 1) {\n if (*dest_dimensions != *src_dimensions) {\n PyErr_SetString(PyExc_ValueError, \n \"matrices are not aligned for copy\");\n return -1;\n }\n for(i=0; i<*dest_dimensions; i++, src += *src_strides) {\n for(j=0; j 0) {\n if (((*dest_strides)[*dest_nd-1] == *elsize) && \n ((*src_strides)[*src_nd-1] == *elsize)) {\n if ((*dest_dimensions)[*dest_nd-1] != \n (*src_dimensions)[*src_nd-1]) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"matrices are not aligned\");\n return -1;\n }\n *elsize *= (*dest_dimensions)[*dest_nd-1];\n *dest_nd-=1; *src_nd-=1;\n } else {\n break;\n }\n }\n if (*src_nd == 0) {\n while (*dest_nd > 0) {\n if (((*dest_strides)[*dest_nd-1] == *elsize)) {\n *copies *= (*dest_dimensions)[*dest_nd-1];\n *dest_nd-=1;\n } else {\n break;\n }\n }\n }\n return 0;\n}\n\nstatic char *\ncontiguous_data(PyArrayObject *src) \n{\n intp dest_strides[MAX_DIMS], *dest_strides_ptr;\n intp *dest_dimensions=src->dimensions;\n int dest_nd=src->nd;\n intp *src_strides = src->strides;\n intp *src_dimensions=src->dimensions;\n int src_nd=src->nd;\n int elsize=src->descr->elsize;\n int copies=1;\n int ret, i;\n intp stride=elsize;\n char *new_data;\n\t\n for(i=dest_nd-1; i>=0; i--) {\n dest_strides[i] = stride;\n stride *= dest_dimensions[i];\n }\n\t\n dest_strides_ptr = dest_strides;\n\t\n if (optimize_slices(&dest_strides_ptr, &dest_dimensions, &dest_nd,\n &src_strides, &src_dimensions, &src_nd,\n &elsize, &copies) == -1) \n return NULL;\n\t\n new_data = (char *)_pya_malloc(stride);\n\t\n ret = do_sliced_copy(new_data, dest_strides_ptr, dest_dimensions, \n dest_nd, src->data, src_strides, \n src_dimensions, src_nd, elsize, copies);\n\t\n if (ret != -1) { return new_data; }\n else { _pya_free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n int, intp *, void *, int, int, PyObject *);\n\n/* C-API functions */\n\n/* Used for arrays of python objects to increment the reference count of */\n/* every python object in the array. */\n/*OBJECT_API\n For object arrays, increment all internal references.\n*/\nstatic int \nPyArray_INCREF(PyArrayObject *mp) \n{\n\tintp i, n;\n\n PyObject **data, **data2;\n\t\n if (mp->descr->type_num != PyArray_OBJECT) return 0;\n\t\n if (PyArray_ISONESEGMENT(mp)) {\n data = (PyObject **)mp->data;\n } else {\n if ((data = (PyObject **)contiguous_data(mp)) == NULL) \n return -1;\n }\n\t\n n = PyArray_SIZE(mp);\n data2 = data;\n for(i=0; idescr->type_num != PyArray_OBJECT) return 0;\n\t\n if (PyArray_ISONESEGMENT(mp)) {\n data = (PyObject **)mp->data;\n } else {\n if ((data = (PyObject **)contiguous_data(mp)) == NULL) \n return -1;\n }\n\t\n n = PyArray_SIZE(mp);\n data2 = data; \n for(i=0; i 0; n--, a += 1) {\n b = a + 1;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n case 4:\n for (a = (char*)p ; n > 0; n--, a += 2) {\n b = a + 3;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n case 8:\n for (a = (char*)p ; n > 0; n--, a += 4) {\n b = a + 7;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n default:\n m = size / 2;\n for (a = (char *)p ; n > 0; n--, a += m) {\n b = a + (size-1);\n for (j=0; j 1, then dst must be contiguous */\nstatic void\ncopy_and_swap(void *dst, void *src, int itemsize, intp numitems,\n intp srcstrides, int swap) \n{\n int i;\n char *s1 = (char *)src;\n char *d1 = (char *)dst;\n \n\n if ((numitems == 1) || (itemsize == srcstrides)) \n memcpy(d1, s1, itemsize*numitems);\n else { \n for (i = 0; i < numitems; i++) {\n memcpy(d1, s1, itemsize);\n d1 += itemsize;\n s1 += srcstrides;\n } \n }\n\n if (swap)\n byte_swap_vector(d1, numitems, itemsize);\n}\n\nstatic PyArray_Descr **userdescrs=NULL;\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, intp i) \n{\n\tif(mp->nd == 0) {\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"0-d arrays can't be indexed\");\n\t\treturn NULL;\n\t}\n\tif (i==0 && mp->dimensions[0] > 0)\n\t\treturn mp->data;\n\t\n if (mp->nd>0 && i>0 && i < mp->dimensions[0]) {\n return mp->data+i*mp->strides[0];\n }\n PyErr_SetString(PyExc_IndexError,\"index out of bounds\");\n return NULL;\n}\n\n/*OBJECT_API\n Compute the size of an array (in number of items)\n*/\nstatic intp \nPyArray_Size(PyObject *op) \n{\n if (PyArray_Check(op)) {\n return PyArray_SIZE((PyArrayObject *)op);\n } \n\telse {\n return 0;\n }\n}\n\n/* If destination is not the right type, then src \n will be cast to destination. \n*/\n\n/* Does a flat iterator-based copy. \n\n The arrays are assumed to have the same number of elements\n They can be different sizes and have different types however. \n*/\n\n/*OBJECT_API\n Copy an Array into another array.\n*/\nstatic int\nPyArray_CopyInto(PyArrayObject *dest, PyArrayObject *src)\n{\n intp dsize, ssize, sbytes, ncopies;\n\tint elsize, index;\n PyArrayIterObject *dit=NULL;\n PyArrayIterObject *sit=NULL;\n\tchar *dptr;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n PyArray_CopySwapNFunc *copyswapn;\n \n if (!PyArray_ISWRITEABLE(dest)) {\n PyErr_SetString(PyExc_RuntimeError, \n \"cannot write to array\");\n return -1;\n }\n\n if (!PyArray_EquivArrTypes(dest, src)) {\n return PyArray_CastTo(dest, src);\n }\n\n dsize = PyArray_SIZE(dest);\n ssize = PyArray_SIZE(src);\n\tif (ssize == 0) return 0;\n if (dsize % ssize != 0) {\n PyErr_SetString(PyExc_ValueError, \n \"number of elements in destination must be \"\\\n \"integer multiple of number of \"\\\n \"elements in source\");\n return -1;\n }\n ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->f->copyswap;\n\tcopyswapn = dest->descr->f->copyswapn;\n\n elsize = dest->descr->elsize;\n\n if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src))\t\\\n\t || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n \n PyArray_XDECREF(dest);\n dptr = dest->data;\n sbytes = ssize * src->descr->elsize;\n while(ncopies--) {\n memmove(dptr, src->data, sbytes);\n dptr += sbytes;\n }\n\t\tif (swap)\n\t\t\tcopyswapn(dest->data, NULL, dsize, 1, elsize);\n PyArray_INCREF(dest);\n return 0;\n }\n\n dit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)dest);\n sit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)src);\n\n if ((dit == NULL) || (sit == NULL)) {\n Py_XDECREF(dit);\n Py_XDECREF(sit);\n return -1;\n }\n\n PyArray_XDECREF(dest);\n while(ncopies--) {\n index = ssize;\n while(index--) {\n memmove(dit->dataptr, sit->dataptr, elsize);\n\t\t\tif (swap)\n\t\t\t\tcopyswap(dit->dataptr, NULL, 1, elsize);\n PyArray_ITER_NEXT(dit);\n PyArray_ITER_NEXT(sit);\n }\n PyArray_ITER_RESET(sit);\n } \n PyArray_INCREF(dest);\n Py_DECREF(dit);\n Py_DECREF(sit);\n\treturn 0;\n}\n\n\nstatic int \nPyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) \n{\n PyArrayObject *src;\n int ret;\n\n\tPy_INCREF(dest->descr);\n src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t dest->descr, 0,\n\t\t\t\t\t dest->nd, FORTRAN_IF(dest));\n if (src == NULL) return -1;\n\n ret = PyArray_CopyInto(dest, src);\n Py_DECREF(src);\n return ret;\n}\n\n\n/* These are also old calls (should use PyArray_New) */\n\n/* They all zero-out the memory as previously done */\n\n/* steals reference to descr -- and enforces native byteorder on it.*/\n/*OBJECT_API\n Like FromDimsAndData but uses the Descr structure instead of typecode\n as input.\n*/\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n PyArray_Descr *descr,\n char *data)\n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n#endif\n\n\tif (!PyArray_ISNBO(descr->byteorder))\n\t\tdescr->byteorder = '=';\n\t\n#if SIZEOF_INTP != SIZEOF_INT\n\tfor (i=0; itype_num != PyArray_OBJECT)) {\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_NBYTES(ret));\n\t}\n\treturn ret;\n}\n\n/* end old calls */\n\n/*OBJECT_API\n Copy an array.\n*/\nstatic PyObject *\nPyArray_NewCopy(PyArrayObject *m1, int fortran)\n{\n\tPyArrayObject *ret;\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(m1);\n\t\n\tPy_INCREF(m1->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(m1->ob_type, \n\t\t\t\t\t\t m1->descr,\n\t\t\t\t\t\t m1->nd, \n\t\t\t\t\t\t m1->dimensions,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t fortran, \n\t\t\t\t\t\t (PyObject *)m1);\n\tif (ret == NULL) return NULL;\n if (PyArray_CopyInto(ret, m1) == -1) {\n Py_DECREF(ret);\n return NULL;\n }\n\t\n return (PyObject *)ret;\t\n}\n\nstatic PyObject *array_big_item(PyArrayObject *, intp);\n\n/* Does nothing with descr (cannot be NULL) */\n/*OBJECT_API\n Get scalar-equivalent to a region of memory described by a descriptor.\n*/\nstatic PyObject *\nPyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)\n{\n\tPyTypeObject *type;\n\tPyObject *obj;\n void *destptr;\n PyArray_CopySwapFunc *copyswap;\n\tint type_num;\n\tint itemsize;\n\tint swap;\n\n\ttype_num = descr->type_num;\n\titemsize = descr->elsize;\n type = descr->typeobj;\n copyswap = descr->f->copyswap;\n\tswap = !PyArray_ISNBO(descr->byteorder);\n\tif (type->tp_itemsize != 0) /* String type */\n\t\tobj = type->tp_alloc(type, itemsize);\n\telse\n\t\tobj = type->tp_alloc(type, 0);\n\tif (obj == NULL) return NULL;\n\tif PyTypeNum_ISEXTENDED(type_num) { \n\t\tif (type_num == PyArray_STRING) {\n\t\t\tdestptr = PyString_AS_STRING(obj);\n\t\t\t((PyStringObject *)obj)->ob_shash = -1;\n\t\t\t((PyStringObject *)obj)->ob_sstate =\t\\\n\t\t\t\tSSTATE_NOT_INTERNED; \n\t\t}\n\t\telse if (type_num == PyArray_UNICODE) {\n\t\t\tPyUnicodeObject *uni = (PyUnicodeObject*)obj;\n\t\t\tint length = itemsize / sizeof(Py_UNICODE);\n\t\t\t/* Need an extra slot and need to use \n\t\t\t Python memory manager */\n\t\t\tuni->str = NULL;\n\t\t\tdestptr = PyMem_NEW(Py_UNICODE, length+1);\n\t\t\tif (destptr == NULL) {\n Py_DECREF(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tuni->str = (Py_UNICODE *)destptr;\n\t\t\tuni->str[0] = 0;\n\t\t\tuni->str[length] = 0;\n\t\t\tuni->length = length;\n\t\t\tuni->hash = -1;\n\t\t\tuni->defenc = NULL;\n\t\t}\n\t\telse { \n\t\t\tPyVoidScalarObject *vobj = (PyVoidScalarObject *)obj;\n\t\t\tvobj->base = NULL;\n\t\t\tvobj->descr = descr;\n\t\t\tPy_INCREF(descr);\n\t\t\tvobj->obval = NULL;\n\t\t\tvobj->ob_size = itemsize;\n\t\t\tvobj->flags = BEHAVED_FLAGS | OWNDATA;\n\t\t\tswap = 0;\n\t\t\tif (descr->fields) {\n\t\t\t\tif (base) {\n\t\t\t\t\tPy_INCREF(base);\n\t\t\t\t\tvobj->base = base;\n\t\t\t\t\tvobj->flags = PyArray_FLAGS(base);\n\t\t\t\t\tvobj->flags &= ~OWNDATA;\n\t\t\t\t\tvobj->obval = data;\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n Py_DECREF(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tvobj->obval = destptr;\n\t\t}\n\t}\n\telse {\n\t\tdestptr = _SOFFSET_(obj, type_num);\n\t}\n\t/* copyswap for OBJECT increments the reference count */\n copyswap(destptr, data, swap, itemsize);\n\treturn obj;\n}\n\n/* returns an Array-Scalar Object of the type of arr\n from the given pointer to memory -- main Scalar creation function\n default new method calls this. \n*/\n\n/* Ideally, here the descriptor would contain all the information needed.\n So, that we simply need the data and the descriptor, and perhaps\n a flag \n*/\n\n/*OBJECT_API\n Get scalar-equivalent to 0-d array\n*/\nstatic PyObject *\nPyArray_ToScalar(void *data, PyArrayObject *arr)\n{\n\treturn PyArray_Scalar(data, arr->descr, (PyObject *)arr);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\n/*OBJECT_API\n Return either an array or the appropriate Python object if the array\n is 0d and matches a Python type.\n*/\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n \n\n\tif (mp == NULL) return NULL;\n\n if (PyErr_Occurred()) {\n Py_XDECREF(mp);\n return NULL;\n }\n\n\tif (mp->nd == 0) {\n\t\tPyObject *ret;\n\t\tret = PyArray_ToScalar(mp->data, mp);\n\t\tPy_DECREF(mp);\n\t\treturn ret;\n\t}\n\telse {\n\t\treturn (PyObject *)mp;\n\t}\n}\n\n/*\n returns typenum to associate with this type >=PyArray_USERDEF.\n Also creates a copy of the VOID_DESCR table inserting it's typeobject in\n and it's typenum in the appropriate place.\n \n needs the userdecrs table and PyArray_NUMUSER variables\n defined in arratypes.inc\n*/\n/*OBJECT_API\n Register Data type\n*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\n\tPyObject *obj;\n\tint typenum;\n\tint i;\n\t\n\tif ((type == &PyVoidArrType_Type) ||\t\t\t\\\n\t !PyType_IsSubtype(type, &PyVoidArrType_Type)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"can only register void subtypes\");\n\t\treturn -1;\n\t}\n\t/* See if this type is already registered */\n\tfor (i=0; itypeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = PyArray_DescrNewFromType(PyArray_VOID);\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n descr->typeobj = type;\n\tobj = PyObject_GetAttrString((PyObject *)type,\"itemsize\");\n\tif (obj) {\n\t\ti = PyInt_AsLong(obj);\n\t\tif ((i < 0) && (PyErr_Occurred())) PyErr_Clear();\n\t\telse descr->elsize = i;\n\t\tPy_DECREF(obj);\n\t}\n\tPy_INCREF(type);\n\tuserdescrs = realloc(userdescrs, \n\t\t\t (PyArray_NUMUSERTYPES+1)*sizeof(void *));\n if (userdescrs == NULL) {\n PyErr_SetString(PyExc_MemoryError, \"RegisterDataType\");\n\t\tPy_DECREF(descr);\n return -1;\n }\n\tuserdescrs[PyArray_NUMUSERTYPES++] = descr;\n\treturn typenum;\n}\n\n\n/* \n copyies over from the old descr table for anything\n NULL or zero in what is given. \n DECREF's the Descr already there.\n places a pointer to the new one into the slot.\n*/\n\n/* steals a reference to descr */\n/*OBJECT_API\n Insert Descr Table\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"data type not registered\");\n\t\tPy_DECREF(descr);\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n\tif (descr->f == NULL) descr->f = old->f;\n\tif (descr->fields == NULL) {\n\t\tdescr->fields = old->fields;\n\t\tPy_XINCREF(descr->fields);\n\t}\n\tif (descr->subarray == NULL && old->subarray) {\n\t\tdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tmemcpy(descr->subarray, old->subarray, \n\t\t sizeof(PyArray_ArrayDescr));\n\t\tPy_INCREF(descr->subarray->shape);\n\t\tPy_INCREF(descr->subarray->base);\n\t}\n Py_XINCREF(descr->typeobj);\n\n#define _ZERO_CHECK(member) \\\n\tif (descr->member == 0) descr->member = old->member\n\n\t_ZERO_CHECK(kind);\n\t_ZERO_CHECK(type);\n _ZERO_CHECK(byteorder);\n\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tPy_DECREF(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\n\n/*OBJECT_API\n To File\n*/\nstatic int\nPyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format) \n{\n intp size;\n intp n, n2;\n int n3, n4;\n PyArrayIterObject *it;\n PyObject *obj, *strobj, *tupobj;\n\n\tn3 = (sep ? strlen((const char *)sep) : 0);\n\tif (n3 == 0) { /* binary data */\n if (PyArray_ISOBJECT(self)) {\n PyErr_SetString(PyExc_ValueError, \"cannot write \"\\\n\t\t\t\t\t\"object arrays to a file in \"\t\\\n\t\t\t\t\t\"binary mode\");\n return -1;\n }\n\n if (PyArray_ISCONTIGUOUS(self)) {\n size = PyArray_SIZE(self);\n if ((n=fwrite((const void *)self->data, \n (size_t) self->descr->elsize,\n (size_t) size, fp)) < size) {\n PyErr_Format(PyExc_ValueError, \n \"%ld requested and %ld written\",\n (long) size, (long) n);\n return -1;\n }\n }\n else {\n it=(PyArrayIterObject *) \\\n PyArray_IterNew((PyObject *)self);\n while(it->index < it->size) {\n if (fwrite((const void *)it->dataptr, \n (size_t) self->descr->elsize,\n 1, fp) < 1) {\n PyErr_Format(PyExc_IOError, \n \"problem writing element\"\\\n \" %d to file\", \n\t\t\t\t\t\t (int)it->index);\n Py_DECREF(it);\n return -1;\n }\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n } \n }\n else { /* text data */\n it=(PyArrayIterObject *) \\\n PyArray_IterNew((PyObject *)self);\n\t\tn4 = (format ? strlen((const char *)format) : 0);\n while(it->index < it->size) {\n obj = self->descr->f->getitem(it->dataptr, self);\n if (obj == NULL) {Py_DECREF(it); return -1;}\n\t\t\tif (n4 == 0) { /* standard writing */\n\t\t\t\tstrobj = PyObject_Str(obj);\n\t\t\t\tPy_DECREF(obj);\n\t\t\t\tif (strobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t}\n\t\t\telse { /* use format string */\n\t\t\t\ttupobj = PyTuple_New(1);\n\t\t\t\tif (tupobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t\tPyTuple_SET_ITEM(tupobj,0,obj);\n\t\t\t\tobj = PyString_FromString((const char *)format);\n\t\t\t\tif (obj == NULL) {Py_DECREF(tupobj); \n\t\t\t\t\tPy_DECREF(it); return -1;}\n\t\t\t\tstrobj = PyString_Format(obj, tupobj);\n\t\t\t\tPy_DECREF(obj);\n\t\t\t\tPy_DECREF(tupobj);\n\t\t\t\tif (strobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t}\n if ((n=fwrite(PyString_AS_STRING(strobj), \n 1, n2=PyString_GET_SIZE(strobj),\n fp)) < n2) {\n PyErr_Format(PyExc_IOError,\n \"problem writing element %d\"\\\n \" to file\", \n\t\t\t\t\t (int) it->index);\n Py_DECREF(strobj);\n Py_DECREF(it);\n return -1;\n }\n /* write separator for all but last one */\n if (it->index != it->size-1) \n fwrite(sep, 1, n3, fp);\n Py_DECREF(strobj);\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n }\n return 0;\n}\n\n/*OBJECT_API\n To List\n*/\nstatic PyObject *\nPyArray_ToList(PyArrayObject *self) \n{\n PyObject *lp;\n PyArrayObject *v;\n intp sz, i;\n\t\n if (!PyArray_Check(self)) return (PyObject *)self;\n\n if (self->nd == 0) \n\t\treturn self->descr->f->getitem(self->data,self);\n\t\n sz = self->dimensions[0];\n lp = PyList_New(sz);\n\t\n for (i=0; ind >= self->nd) {\n\t\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\t\"array_item not returning smaller-\" \\\n\t\t\t\t\t\"dimensional array\");\n Py_DECREF(v);\n\t\t\tPy_DECREF(lp);\n\t\t\treturn NULL;\n\t\t}\n PyList_SetItem(lp, i, PyArray_ToList(v));\n\t\tPy_DECREF(v);\n }\n\t\n return lp;\n}\n\nstatic PyObject *\nPyArray_ToString(PyArrayObject *self)\n{\n intp numbytes;\n intp index;\n char *dptr;\n int elsize;\n PyObject *ret;\n PyArrayIterObject *it;\n \n\t/* if (PyArray_TYPE(self) == PyArray_OBJECT) {\n\t\t PyErr_SetString(PyExc_ValueError, \"a string for the data\" \\\n\t\t \"in an object array is not appropriate\");\n\t\t return NULL;\n\t\t }\n\t*/\n\n numbytes = PyArray_NBYTES(self);\n if (PyArray_ISONESEGMENT(self)) {\n ret = PyString_FromStringAndSize(self->data, (int) numbytes);\n }\n else {\n it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n if (it==NULL) return NULL;\n ret = PyString_FromStringAndSize(NULL, (int) numbytes);\n if (ret == NULL) {Py_DECREF(it); return NULL;}\n dptr = PyString_AS_STRING(ret);\n index = it->size;\n elsize = self->descr->elsize;\n while(index--) {\n memcpy(dptr, it->dataptr, elsize);\n dptr += elsize;\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n }\n\treturn ret;\n}\n\n\n/*********************** end C-API functions **********************/\n\n\n/* array object functions */\n\nstatic void \narray_dealloc(PyArrayObject *self) {\n\n if (self->weakreflist != NULL)\n PyObject_ClearWeakRefs((PyObject *)self);\n\n if(self->base) {\n\t\t/* UPDATEIFCOPY means that base points to an \n\t\t array that should be updated with the contents\n\t\t of this array upon destruction.\n self->base->flags must have been WRITEABLE \n (checked previously) and it was locked here\n thus, unlock it.\n\t\t*/\n\t\tif (self->flags & UPDATEIFCOPY) {\n ((PyArrayObject *)self->base)->flags |= WRITEABLE;\n\t\t\tPy_INCREF(self); /* hold on to self in next call */\n PyArray_CopyInto((PyArrayObject *)self->base, self);\n\t\t\t/* Don't need to DECREF -- because we are deleting\n\t\t\t self already... */\n\t\t}\n\t\t/* In any case base is pointing to something that we need\n\t\t to DECREF -- either a view or a buffer object */\n Py_DECREF(self->base);\n }\n \n if ((self->flags & OWN_DATA) && self->data) {\n\t\t/* Free internal references if an Object array */\n\t\tif (PyArray_ISOBJECT(self))\n\t\t\tPyArray_XDECREF(self);\n PyDataMem_FREE(self->data);\n }\n\t\n\tPyDimMem_FREE(self->dimensions);\n\n\tPy_DECREF(self->descr);\n\t\n self->ob_type->tp_free((PyObject *)self);\n}\n\n/*************************************************************************\n **************** Implement Mapping Protocol ***************************\n *************************************************************************/\n\nstatic int \narray_length(PyArrayObject *self) \n{\n if (self->nd != 0) {\n return self->dimensions[0];\n } else {\n\t\tPyErr_SetString(PyExc_TypeError, \"len() of unsized object\");\n\t\treturn -1;\n }\n}\n\nstatic PyObject *\narray_big_item(PyArrayObject *self, intp i) \n{\n\tchar *item;\n\tPyArrayObject *r;\n\t\t\n\tif(self->nd == 0) {\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"0-d arrays can't be indexed\");\n\t\treturn NULL;\n\t}\n if ((item = index2ptr(self, i)) == NULL) return NULL;\n\t\n\tPy_INCREF(self->descr);\n\tr = (PyArrayObject *)PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t\t\t self->descr,\n\t\t\t\t\t\t self->nd-1, \n\t\t\t\t\t\t self->dimensions+1, \n\t\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t\t self->flags,\n\t\t\t\t\t\t (PyObject *)self);\n\tif (r == NULL) return NULL;\n\tPy_INCREF(self);\n\tr->base = (PyObject *)self;\n PyArray_UpdateFlags(r, CONTIGUOUS | FORTRAN);\n\treturn (PyObject *)r;\n}\n\nstatic PyObject *\narray_item_nice(PyArrayObject *self, int i) \n{\n\treturn PyArray_Return((PyArrayObject *)array_big_item(self, (intp) i));\n}\n\n\nstatic int \narray_ass_big_item(PyArrayObject *self, intp i, PyObject *v) \n{\n PyArrayObject *tmp;\n char *item;\n int ret;\n\n if (v == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"can't delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return -1;\n }\n\n if (i < 0) i = i+self->dimensions[0];\n\n if (self->nd > 1) {\n if((tmp = (PyArrayObject *)array_big_item(self, i)) == NULL)\n return -1;\n ret = PyArray_CopyObject(tmp, v);\n Py_DECREF(tmp);\n return ret; \n }\n\t\n if ((item = index2ptr(self, i)) == NULL) return -1;\n if (self->descr->f->setitem(v, item, self) == -1) return -1;\n return 0;\n}\n\n#if SIZEOF_INT == SIZEOF_INTP\n#define array_ass_item array_ass_big_item\n#else\nstatic int\narray_ass_item(PyArrayObject *self, int i, PyObject *v)\n{\n\treturn array_ass_big_item(self, (intp) i, v);\n}\n#endif\n\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, intp *v)\n{\n\t*v = PyArray_PyIntAsIntp(o);\n\tif (error_converting(*v)) {\n\t\tPyErr_Clear();\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n\n/* This is basically PySlice_GetIndicesEx, but with our coercion\n * of indices to integers (plus, that function is new in Python 2.3) */\nstatic int\nslice_GetIndices(PySliceObject *r, intp length,\n intp *start, intp *stop, intp *step,\n intp *slicelength)\n{\n\tintp defstart, defstop;\n\t\n\tif (r->step == Py_None) {\n\t\t*step = 1;\n\t} else {\n\t\tif (!slice_coerce_index(r->step, step)) return -1;\n\t\tif (*step == 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"slice step cannot be zero\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\t\n\tdefstart = *step < 0 ? length - 1 : 0;\n\tdefstop = *step < 0 ? -1 : length;\n\t\n\tif (r->start == Py_None) {\n\t\t*start = *step < 0 ? length-1 : 0;\n\t} else {\n\t\tif (!slice_coerce_index(r->start, start)) return -1;\n\t\tif (*start < 0) *start += length;\n\t\tif (*start < 0) *start = (*step < 0) ? -1 : 0;\n\t\tif (*start >= length) {\n\t\t\t*start = (*step < 0) ? length - 1 : length;\n\t\t}\n\t}\n\t\n\tif (r->stop == Py_None) {\n\t\t*stop = defstop;\n\t} else {\n\t\tif (!slice_coerce_index(r->stop, stop)) return -1;\n\t\tif (*stop < 0) *stop += length;\n if (*stop < 0) *stop = -1;\n if (*stop > length) *stop = length;\n\t}\n\t\n\tif ((*step < 0 && *stop >= *start) || \\\n\t (*step > 0 && *start >= *stop)) {\n\t\t*slicelength = 0;\n\t} else if (*step < 0) {\n\t\t*slicelength = (*stop - *start + 1) / (*step) + 1;\n\t} else {\n\t\t*slicelength = (*stop - *start - 1) / (*step) + 1;\n\t}\n\t\n\treturn 0;\n}\n\n#define PseudoIndex -1\n#define RubberIndex -2\n#define SingleIndex -3\n\nstatic intp\nparse_subindex(PyObject *op, intp *step_size, intp *n_steps, intp max)\n{\n\tintp index;\n\t\n\tif (op == Py_None) {\n\t\t*n_steps = PseudoIndex;\n\t\tindex = 0;\n\t} else if (op == Py_Ellipsis) {\n\t\t*n_steps = RubberIndex;\n\t\tindex = 0;\n\t} else if (PySlice_Check(op)) {\n\t\tintp stop;\n\t\tif (slice_GetIndices((PySliceObject *)op, max,\n\t\t\t\t &index, &stop, step_size, n_steps) < 0) {\n\t\t\tif (!PyErr_Occurred()) {\n\t\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\t\"invalid slice\");\n\t\t\t}\n\t\t\tgoto fail;\n\t\t}\n\t\tif (*n_steps <= 0) {\n\t\t\t*n_steps = 0;\n\t\t\t*step_size = 1;\n\t\t\tindex = 0;\n\t\t}\n\t} else {\n\t\tindex = PyArray_PyIntAsIntp(op);\n\t\tif (error_converting(index)) {\n\t\t\tPyErr_SetString(PyExc_IndexError,\n\t\t\t\t\t\"each subindex must be either a \"\\\n\t\t\t\t\t\"slice, an integer, Ellipsis, or \"\\\n\t\t\t\t\t\"newaxis\");\n\t\t\tgoto fail;\n\t\t}\n\t\t*n_steps = SingleIndex;\n\t\t*step_size = 0;\n\t\tif (index < 0) index += max;\n\t\tif (index >= max || index < 0) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \"invalid index\");\n\t\t\tgoto fail;\n\t\t}\n\t}\n\treturn index;\n fail:\n\treturn -1;\n}\n\n\nstatic int \nparse_index(PyArrayObject *self, PyObject *op, \n intp *dimensions, intp *strides, intp *offset_ptr)\n{\n int i, j, n;\n int nd_old, nd_new, n_add, n_pseudo;\n\tintp n_steps, start, offset, step_size;\n PyObject *op1=NULL;\n int is_slice;\n\n\n if (PySlice_Check(op) || op == Py_Ellipsis || op == Py_None) {\n n = 1;\n op1 = op;\n Py_INCREF(op);\t\n /* this relies on the fact that n==1 for loop below */\n is_slice = 1;\n }\n else {\n if (!PySequence_Check(op)) {\n PyErr_SetString(PyExc_IndexError, \n \"index must be either an int \"\\\n \"or a sequence\");\n return -1;\n }\n n = PySequence_Length(op);\n is_slice = 0;\n }\n\t\n nd_old = nd_new = 0;\n\t\n offset = 0;\n for(i=0; ind ? \\\n self->dimensions[nd_old] : 0);\n Py_DECREF(op1);\n if (start == -1) break;\n\t\t\n if (n_steps == PseudoIndex) {\n dimensions[nd_new] = 1; strides[nd_new] = 0; nd_new++;\n } else {\n if (n_steps == RubberIndex) {\n for(j=i+1, n_pseudo=0; jnd-(n-i-n_pseudo-1+nd_old);\n if (n_add < 0) {\n PyErr_SetString(PyExc_IndexError, \n \"too many indices\");\n return -1;\n }\n for(j=0; jdimensions[nd_old];\n strides[nd_new] = \\\n self->strides[nd_old];\n nd_new++; nd_old++;\n }\n } else {\n if (nd_old >= self->nd) {\n PyErr_SetString(PyExc_IndexError, \n \"too many indices\");\n return -1;\n }\n offset += self->strides[nd_old]*start;\n nd_old++;\n if (n_steps != SingleIndex) {\n dimensions[nd_new] = n_steps;\n strides[nd_new] = step_size * \\\n self->strides[nd_old-1];\n nd_new++;\n }\n }\n }\n }\n if (i < n) return -1;\n n_add = self->nd-nd_old;\n for(j=0; jdimensions[nd_old];\n strides[nd_new] = self->strides[nd_old];\n nd_new++; nd_old++;\n }\t \n *offset_ptr = offset;\n return nd_new;\n}\n\nstatic void\n_swap_axes(PyArrayMapIterObject *mit, PyArrayObject **ret)\n{\n\tPyObject *new;\n\tint n1, n2, n3, val;\n\tint i;\n\tPyArray_Dims permute;\n\tintp d[MAX_DIMS];\n\n\tpermute.ptr = d;\n\tpermute.len = mit->nd;\n\n\t/* tuple for transpose is \n\t (n1,..,n1+n2-1,0,..,n1-1,n1+n2,...,n3-1)\n\t n1 is the number of dimensions of \n\t the broadcasted index array \n\t n2 is the number of dimensions skipped at the\n\t start\n\t n3 is the number of dimensions of the \n\t result \n\t*/\n\tn1 = mit->iters[0]->nd_m1 + 1;\n\tn2 = mit->iteraxes[0];\n\tn3 = mit->nd;\n\tval = n1;\n\ti = 0;\n\twhile(val < n1+n2) \n\t\tpermute.ptr[i++] = val++;\n\tval = 0;\n\twhile(val < n1)\n\t\tpermute.ptr[i++] = val++;\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tpermute.ptr[i++] = val++;\n\n\tnew = PyArray_Transpose(*ret, &permute);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n/* Prototypes for Mapping calls --- not part of the C-API\n because only useful as part of a getitem call. \n*/\n\nstatic void PyArray_MapIterReset(PyArrayMapIterObject *);\nstatic void PyArray_MapIterNext(PyArrayMapIterObject *);\nstatic void PyArray_MapIterBind(PyArrayMapIterObject *, PyArrayObject *);\nstatic PyObject* PyArray_MapIterNew(PyObject *, int);\n\nstatic PyObject *\nPyArray_GetMap(PyArrayMapIterObject *mit)\n{\n\n\tPyArrayObject *ret, *temp;\n\tPyArrayIterObject *it;\n\tint index;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound map iterator --- Bind should have been called */\n\tif (mit->ait == NULL) return NULL;\n\n\t/* This relies on the map iterator object telling us the shape\n\t of the new array in nd and dimensions.\n\t*/\n\ttemp = mit->ait->ao;\n\tPy_INCREF(temp->descr);\n\tret = (PyArrayObject *)\\\n\t\tPyArray_NewFromDescr(temp->ob_type, \n\t\t\t\t temp->descr,\n\t\t\t\t mit->nd, mit->dimensions, \n\t\t\t\t NULL, NULL, \n\t\t\t\t PyArray_ISFORTRAN(temp),\n\t\t\t\t (PyObject *)temp);\n\tif (ret == NULL) return NULL;\n\n\t/* Now just iterate through the new array filling it in\n\t with the next object from the original array as\n\t defined by the mapping iterator */\n\n\tif ((it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ret)) \n\t == NULL) {\n\t\tPy_DECREF(ret);\n\t\treturn NULL;\n\t}\n\tindex = it->size;\n\tswap = (PyArray_ISNOTSWAPPED(temp) != PyArray_ISNOTSWAPPED(ret));\n copyswap = ret->descr->f->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n copyswap(it->dataptr, mit->dataptr, swap, ret->descr->elsize);\n\t\tPyArray_MapIterNext(mit);\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\tPy_DECREF(it);\n\t\n\t/* check for consecutive axes */\n\tif ((mit->subspace != NULL) && (mit->consec)) {\n\t\tif (mit->iteraxes[0] > 0) { /* then we need to swap */\n\t\t\t_swap_axes(mit, &ret);\n\t\t}\n\t}\n\treturn (PyObject *)ret;\n}\n\nstatic int\nPyArray_SetMap(PyArrayMapIterObject *mit, PyObject *op)\n{\n\tPyObject *arr=NULL;\n\tPyArrayIterObject *it;\n\tint index;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\tPyArray_Descr *descr;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\tdescr = mit->ait->ao->descr;\n\tPy_INCREF(descr);\n\tarr = PyArray_FromAny(op, descr, 0, 0, FORCECAST);\n\tif (arr == NULL) return -1;\n\n\tif ((mit->subspace != NULL) && (mit->consec)) {\n\t\tif (mit->iteraxes[0] > 0) { /* then we need to swap */\n\t\t\t_swap_axes(mit, (PyArrayObject **)&arr);\n\t\t}\n\t}\n\t\n\tif ((it = (PyArrayIterObject *)PyArray_IterNew(arr))==NULL) {\n\t\tPy_DECREF(arr);\n\t\treturn -1;\n\t}\n\n\tindex = mit->size;\n\tswap = (PyArray_ISNOTSWAPPED(mit->ait->ao) != \\\n\t\t(PyArray_ISNOTSWAPPED(arr)));\n\n copyswap = PyArray_DESCR(arr)->f->copyswap;\n\tPyArray_MapIterReset(mit);\n /* Need to decref OBJECT arrays */\n if (PyTypeNum_ISOBJECT(descr->type_num)) {\n while (index--) {\n Py_XDECREF(*((PyObject **)mit->dataptr));\n Py_INCREF(*((PyObject **)it->dataptr));\n memmove(mit->dataptr, it->dataptr, sizeof(PyObject *));\n PyArray_MapIterNext(mit);\n PyArray_ITER_NEXT(it);\n if (it->index == it->size)\n PyArray_ITER_RESET(it);\n }\n\t\tPy_DECREF(arr);\n\t\tPy_DECREF(it);\n return 0;\n }\n\twhile(index--) {\n\t\tmemmove(mit->dataptr, it->dataptr, PyArray_ITEMSIZE(arr));\n copyswap(mit->dataptr, NULL, swap, PyArray_ITEMSIZE(arr));\n\t\tPyArray_MapIterNext(mit);\n\t\tPyArray_ITER_NEXT(it);\n\t\tif (it->index == it->size)\n\t\t\tPyArray_ITER_RESET(it);\n\t}\t\t\n\tPy_DECREF(arr);\n\tPy_DECREF(it);\n\treturn 0;\n}\n\n/* Called when treating array object like a mapping -- called first from \n Python when using a[object] unless object is a standard slice object\n (not an extended one). \n\n*/\n\n/* There are two situations: \n\n 1 - the subscript is a standard view and a reference to the \n array can be returned\n\n 2 - the subscript uses Boolean masks or integer indexing and\n therefore a new array is created and returned. \n\n*/\n\n/* Always returns arrays */\n\nstatic PyObject *iter_subscript(PyArrayIterObject *, PyObject *); \n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n int nd, oned;\n\tintp i;\n PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n\tif (PyString_Check(op) || PyUnicode_Check(op)) {\n\t\tif (self->descr->fields) {\n\t\t\tPyObject *obj;\n\t\t\tobj = PyDict_GetItem(self->descr->fields, op);\n\t\t\tif (obj != NULL) {\n\t\t\t\tPyArray_Descr *descr;\n\t\t\t\tint offset;\n\t\t\t\tPyObject *title;\n\t\t\t\t\n\t\t\t\tif (PyArg_ParseTuple(obj, \"Oi|O\",\n\t\t\t\t\t\t &descr, &offset, &title)) {\n\t\t\t\t\tPy_INCREF(descr);\n\t\t\t\t\treturn PyArray_GetField(self, descr, \n\t\t\t\t\t\t\t\toffset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"field named %s not found.\",\n\t\t\t PyString_AsString(op));\n\t\treturn NULL;\n\t}\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return NULL;\n }\n if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n PyLong_Check(op)) {\n intp value;\n value = PyArray_PyIntAsIntp(op);\n\t\tif (PyErr_Occurred())\n\t\t\tPyErr_Clear();\n else if (value >= 0) {\n\t\t\treturn array_big_item(self, value);\n }\n else /* (value < 0) */ {\n\t\t\tvalue += self->dimensions[0];\n\t\t\treturn array_big_item(self, value);\n\t\t}\n }\n\n\toned = ((self->nd == 1) && !(PyTuple_Check(op) && PyTuple_GET_SIZE(op) > 1));\n\n\t/* wrap arguments into a mapiter object */\n mit = (PyArrayMapIterObject *)PyArray_MapIterNew(op, oned);\n if (mit == NULL) return NULL;\n if (!mit->view) { /* fancy indexing */\n\t\tif (oned) {\n\t\t\tPyArrayIterObject *it;\n\t\t\tPyObject *rval;\n\t\t\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\t\t\tif (it == NULL) {Py_DECREF(mit); return NULL;}\n\t\t\trval = iter_subscript(it, mit->indexobj);\n\t\t\tPy_DECREF(it);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn rval;\n\t\t}\n PyArray_MapIterBind(mit, self);\n other = (PyArrayObject *)PyArray_GetMap(mit);\n Py_DECREF(mit);\n return (PyObject *)other;\n }\n Py_DECREF(mit);\n\n\ti = PyArray_PyIntAsIntp(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_big_item(self, i);\n\t}\n\tPyErr_Clear();\n\n\t/* Standard (view-based) Indexing */\n if ((nd = parse_index(self, op, dimensions, strides, &offset)) \n == -1) \n return NULL;\n\n\t/* This will only work if new array will be a view */\n\tPy_INCREF(self->descr);\n\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t PyArray_NewFromDescr(self->ob_type, self->descr,\n\t\t\t\t nd, dimensions,\n\t\t\t\t strides, self->data+offset, \n\t\t\t\t self->flags,\n\t\t\t\t (PyObject *)self)) == NULL) \n\t\treturn NULL;\n\n\n\tother->base = (PyObject *)self;\n\tPy_INCREF(self);\n\t\n\tPyArray_UpdateFlags(other, UPDATE_ALL_FLAGS);\n\t\n\treturn (PyObject *)other;\n}\n\n\n/* Another assignment hacked by using CopyObject. */\n\n/* This only works if subscript returns a standard view. */\n\n/* Again there are two cases. In the first case, PyArray_CopyObject\n can be used. In the second case, a new indexing function has to be \n used.\n*/\n\nstatic int iter_ass_subscript(PyArrayIterObject *, PyObject *, PyObject *); \n\nstatic int \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n int ret, oned;\n\tintp i;\n PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n if (op == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"cannot delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n\t\n if (PyArray_IsScalar(index, Integer) || PyInt_Check(index) ||\t\\\n PyLong_Check(index)) {\n intp value;\n value = PyArray_PyIntAsIntp(index);\n if (PyErr_Occurred())\n PyErr_Clear();\n\t\telse\n\t\t\treturn array_ass_big_item(self, value, op);\n }\n\n\tif (PyString_Check(index) || PyUnicode_Check(index)) {\n\t\tif (self->descr->fields) {\n\t\t\tPyObject *obj;\n\t\t\tobj = PyDict_GetItem(self->descr->fields, index);\n\t\t\tif (obj != NULL) {\n\t\t\t\tPyArray_Descr *descr;\n\t\t\t\tint offset;\n\t\t\t\tPyObject *title;\n\t\t\t\t\n\t\t\t\tif (PyArg_ParseTuple(obj, \"Oi|O\",\n\t\t\t\t\t\t &descr, &offset, &title)) {\n\t\t\t\t\tPy_INCREF(descr);\n\t\t\t\t\treturn PyArray_SetField(self, descr, \n\t\t\t\t\t\t\t\toffset, op);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"field named %s not found.\",\n\t\t\t PyString_AsString(index));\n\t\treturn -1;\n\t}\n\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return -1;\n }\n\n\toned = ((self->nd == 1) && !(PyTuple_Check(op) && PyTuple_GET_SIZE(op) > 1));\n\n mit = (PyArrayMapIterObject *)PyArray_MapIterNew(index, oned);\n if (mit == NULL) return -1;\n if (!mit->view) {\n\t\tif (oned) {\n\t\t\tPyArrayIterObject *it;\n\t\t\tint rval;\n\t\t\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\t\t\tif (it == NULL) {Py_DECREF(mit); return -1;}\n\t\t\trval = iter_ass_subscript(it, mit->indexobj, op);\n\t\t\tPy_DECREF(it);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn rval;\n\t\t}\n PyArray_MapIterBind(mit, self);\n ret = PyArray_SetMap(mit, op);\n Py_DECREF(mit);\n return ret;\n }\n Py_DECREF(mit);\n\n\ti = PyArray_PyIntAsIntp(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_big_item(self, i, op);\n\t}\n\tPyErr_Clear();\n\t\n\t/* Rest of standard (view-based) indexing */\n\n if ((tmp = (PyArrayObject *)array_subscript(self, index)) == NULL)\n return -1; \n\tif (PyArray_ISOBJECT(self) && (tmp->nd == 0)) {\n\t\tret = tmp->descr->f->setitem(op, tmp->data, tmp);\n\t}\n\telse {\n\t\tret = PyArray_CopyObject(tmp, op);\n\t}\n\tPy_DECREF(tmp);\n return ret;\n}\n\n/* There are places that require that array_subscript return a PyArrayObject\n and not possibly a scalar. Thus, this is the function exposed to \n Python so that 0-dim arrays are passed as scalars\n*/\n\nstatic PyObject *\narray_subscript_nice(PyArrayObject *self, PyObject *op) \n{\n\treturn PyArray_Return((PyArrayObject *)array_subscript(self, op));\n}\n\n\nstatic PyMappingMethods array_as_mapping = {\n (inquiry)array_length,\t\t /*mp_length*/\n (binaryfunc)array_subscript_nice,\t/*mp_subscript*/\n (objobjargproc)array_ass_sub,\t /*mp_ass_subscript*/\n};\n\n/****************** End of Mapping Protocol ******************************/\n\n\n/*************************************************************************\n **************** Implement Buffer Protocol ****************************\n *************************************************************************/\n\n/* removed multiple segment interface */\n\nstatic int \narray_getsegcount(PyArrayObject *self, int *lenp) \n{\n if (lenp)\n *lenp = PyArray_NBYTES(self);\n\n if (PyArray_ISONESEGMENT(self)) {\n return 1;\n }\n\n if (lenp)\n *lenp = 0;\n return 0;\n}\n\nstatic int \narray_getreadbuf(PyArrayObject *self, int segment, void **ptrptr) \n{\n if (segment != 0) {\n PyErr_SetString(PyExc_ValueError, \n \"accessing non-existing array segment\");\n return -1;\n }\n \n if (PyArray_ISONESEGMENT(self)) {\n *ptrptr = self->data;\n return PyArray_NBYTES(self);\n }\n PyErr_SetString(PyExc_ValueError, \"array is not a single segment\");\n *ptrptr = NULL;\n return -1;\n}\n\n\nstatic int \narray_getwritebuf(PyArrayObject *self, int segment, void **ptrptr) \n{\n if (PyArray_CHKFLAGS(self, WRITEABLE)) \n return array_getreadbuf(self, segment, (void **) ptrptr);\n else {\n PyErr_SetString(PyExc_ValueError, \"array cannot be \"\\\n \"accessed as a writeable buffer\");\n return -1;\n }\n}\n\nstatic int \narray_getcharbuf(PyArrayObject *self, int segment, const char **ptrptr) \n{\n if (self->descr->type_num == PyArray_STRING || \\\n\t self->descr->type_num == PyArray_UNICODE)\n return array_getreadbuf(self, segment, (void **) ptrptr);\n else {\n PyErr_SetString(PyExc_TypeError, \n \"non-character array cannot be interpreted \"\\\n \"as character buffer\");\n return -1;\n }\n}\n\nstatic PyBufferProcs array_as_buffer = {\n (getreadbufferproc)array_getreadbuf, /*bf_getreadbuffer*/\n (getwritebufferproc)array_getwritebuf, /*bf_getwritebuffer*/\n (getsegcountproc)array_getsegcount,\t /*bf_getsegcount*/\n (getcharbufferproc)array_getcharbuf, /*bf_getcharbuffer*/\n};\n\n/****************** End of Buffer Protocol *******************************/\n\n\n/*************************************************************************\n **************** Implement Number Protocol ****************************\n *************************************************************************/\n\n\ntypedef struct {\n PyObject *add,\n *subtract,\n *multiply,\n *divide,\n *remainder,\n *power,\n\t\t*sqrt,\n *negative,\n *absolute,\n *invert,\n *left_shift,\n *right_shift,\n *bitwise_and,\n *bitwise_xor,\n *bitwise_or,\n *less,\n *less_equal,\n *equal,\n *not_equal,\n *greater,\n *greater_equal,\n *floor_divide,\n *true_divide,\n\t\t*logical_or,\n\t\t*logical_and,\n\t\t*floor,\n\t\t*ceil,\n\t\t*maximum,\n\t\t*minimum;\t\n\t\n} NumericOps;\n\nstatic NumericOps n_ops = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \n NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,\n NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,\n NULL, NULL, NULL, NULL, NULL};\n\n/* Dictionary can contain any of the numeric operations, by name. \n Those not present will not be changed\n */\n\n#define SET(op) temp=PyDict_GetItemString(dict, #op);\t\\\n\tif (temp != NULL) {\t\t\t\t\\\n\t\tif (!(PyCallable_Check(temp))) return -1; \\\n Py_XDECREF(n_ops.op); \\\n\t\tn_ops.op = temp; \\\n\t}\n\n \n/*OBJECT_API\n Set internal structure with number functions that all arrays will use\n*/\nint \nPyArray_SetNumericOps(PyObject *dict) \n{\n PyObject *temp = NULL;\n SET(add);\n SET(subtract);\n SET(multiply);\n SET(divide);\n SET(remainder);\n SET(power);\n\tSET(sqrt);\n SET(negative);\n SET(absolute);\n SET(invert);\n SET(left_shift);\n SET(right_shift);\n SET(bitwise_and);\n SET(bitwise_or);\n SET(bitwise_xor);\n SET(less);\t \n SET(less_equal);\n SET(equal);\n SET(not_equal);\n SET(greater);\n SET(greater_equal);\n SET(floor_divide);\t\n SET(true_divide);\t\n\tSET(logical_or);\n\tSET(logical_and);\n\tSET(floor);\n\tSET(ceil);\n\tSET(maximum);\n\tSET(minimum);\n return 0;\n}\n\n#define GET(op) if (n_ops.op &&\t\t\t\t\t\t\\\n\t\t (PyDict_SetItemString(dict, #op, n_ops.op)==-1))\t\\\n\t\tgoto fail;\n\n/*OBJECT_API\n Get dictionary showing number functions that all arrays will use\n*/\nstatic PyObject *\nPyArray_GetNumericOps(void) \n{\n\tPyObject *dict;\n\tif ((dict = PyDict_New())==NULL) \n\t\treturn NULL;\t\n\tGET(add);\n GET(subtract);\n GET(multiply);\n GET(divide);\n GET(remainder);\n GET(power);\n\tGET(sqrt);\n GET(negative);\n GET(absolute);\n GET(invert);\n GET(left_shift);\n GET(right_shift);\n GET(bitwise_and);\n GET(bitwise_or);\n GET(bitwise_xor);\n GET(less);\t \n GET(less_equal);\n GET(equal);\n GET(not_equal);\n GET(greater);\n GET(greater_equal);\n GET(floor_divide); \n GET(true_divide); \n\tGET(logical_or);\n\tGET(logical_and);\n\tGET(floor);\n\tGET(ceil);\n\tGET(maximum);\n\tGET(minimum);\n\treturn dict;\t\n\n fail:\n\tPy_DECREF(dict);\n\treturn NULL;\t\t\n}\n\nstatic PyObject *\nPyArray_GenericReduceFunction(PyArrayObject *m1, PyObject *op, int axis,\n\t\t\t int rtype)\n{\n\tPyObject *args, *ret=NULL, *meth;\n\tif (op == NULL) {\n\t\tPy_INCREF(Py_NotImplemented);\n\t\treturn Py_NotImplemented;\n\t}\n\tif (rtype == PyArray_NOTYPE) \n\t\targs = Py_BuildValue(\"(Oi)\", m1, axis);\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(rtype);\n\t\targs = Py_BuildValue(\"(Oic)\", m1, axis, descr->type);\n\t\tPy_DECREF(descr);\n\t}\n\tmeth = PyObject_GetAttrString(op, \"reduce\");\n\tif (meth && PyCallable_Check(meth)) {\n\t\tret = PyObject_Call(meth, args, NULL);\n\t}\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn ret;\n}\t\n\n\nstatic PyObject *\nPyArray_GenericAccumulateFunction(PyArrayObject *m1, PyObject *op, int axis,\n\t\t\t\t int rtype)\n{\n\tPyObject *args, *ret=NULL, *meth;\n\tif (op == NULL) {\n\t\tPy_INCREF(Py_NotImplemented);\n\t\treturn Py_NotImplemented;\n\t}\n\tif (rtype == PyArray_NOTYPE) \n\t\targs = Py_BuildValue(\"(Oi)\", m1, axis);\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(rtype);\n\t\targs = Py_BuildValue(\"(Oic)\", m1, axis, descr->type);\n\t\tPy_DECREF(descr);\n\t}\n\tmeth = PyObject_GetAttrString(op, \"accumulate\");\n\tif (meth && PyCallable_Check(meth)) {\n\t\tret = PyObject_Call(meth, args, NULL);\n\t}\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn ret;\n}\t\n\n\nstatic PyObject *\nPyArray_GenericBinaryFunction(PyArrayObject *m1, PyObject *m2, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"OO\", m1, m2);\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"(O)\", m1);\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t PyObject *m2, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"OOO\", m1, m2, m1);\n}\n\nstatic PyObject *\narray_add(PyArrayObject *m1, PyObject *m2) \n{ \n return PyArray_GenericBinaryFunction(m1, m2, n_ops.add); \n}\n\nstatic PyObject *\narray_subtract(PyArrayObject *m1, PyObject *m2) \n{\n\treturn PyArray_GenericBinaryFunction(m1, m2, n_ops.subtract);\n}\n\nstatic PyObject *\narray_multiply(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.multiply);\n}\n\nstatic PyObject *\narray_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.divide);\n}\n\nstatic PyObject *\narray_remainder(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.remainder);\n}\n\nstatic PyObject *\narray_power(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.power);\n}\n\nstatic PyObject *\narray_negative(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.negative);\n}\n\nstatic PyObject *\narray_absolute(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.absolute);\n}\n\nstatic PyObject *\narray_invert(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.invert);\n}\n\nstatic PyObject *\narray_left_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.left_shift);\n}\n\nstatic PyObject *\narray_right_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.right_shift);\n}\n\nstatic PyObject *\narray_bitwise_and(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_and);\n}\n\nstatic PyObject *\narray_bitwise_or(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_or);\n}\n\nstatic PyObject *\narray_bitwise_xor(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_xor);\n}\n\nstatic PyObject *\narray_inplace_add(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.add);\n}\n\nstatic PyObject *\narray_inplace_subtract(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.subtract);\n}\n\nstatic PyObject *\narray_inplace_multiply(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.multiply);\n}\n\nstatic PyObject *\narray_inplace_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.divide);\n}\n\nstatic PyObject *\narray_inplace_remainder(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.remainder);\n}\n\nstatic PyObject *\narray_inplace_power(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.power);\n}\n\nstatic PyObject *\narray_inplace_left_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.left_shift);\n}\n\nstatic PyObject *\narray_inplace_right_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.right_shift);\n}\n\nstatic PyObject *\narray_inplace_bitwise_and(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_and);\n}\n\nstatic PyObject *\narray_inplace_bitwise_or(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_or);\n}\n\nstatic PyObject *\narray_inplace_bitwise_xor(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_xor);\n}\n\nstatic PyObject *\narray_floor_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.floor_divide);\n}\n\nstatic PyObject *\narray_true_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.true_divide);\n}\n\nstatic PyObject *\narray_inplace_floor_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, \n\t\t\t\t\t\t n_ops.floor_divide);\n}\n\nstatic PyObject *\narray_inplace_true_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, \n\t\t\t\t\t\t n_ops.true_divide);\n}\n\n/* Array evaluates as \"TRUE\" if any of the elements are non-zero*/\nstatic int \narray_any_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = FALSE;\n\t\n\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)mp);\n\tif (it==NULL) return anyTRUE;\n\tindex = it->size;\n\twhile(index--) {\n\t\tif (mp->descr->f->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\tPy_DECREF(it);\n\treturn anyTRUE;\n}\n\nstatic int\n_array_nonzero(PyArrayObject *mp)\n{\n\tintp n;\n\tn = PyArray_SIZE(mp);\n\tif (n == 1) {\n\t\treturn mp->descr->f->nonzero(mp->data, mp);\n\t}\n\telse if (n == 0) {\n\t\treturn 0;\n\t}\n\telse {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"The truth value of an array \" \\\n\t\t\t\t\"with more than one element is ambiguous. \" \\\n\t\t\t\t\"Use a.any() or a.all()\");\n\t\treturn -1;\n\t}\n}\n\n\n\nstatic PyObject *\narray_divmod(PyArrayObject *op1, PyObject *op2) \n{\n PyObject *divp, *modp, *result;\n\n divp = array_floor_divide(op1, op2);\n if (divp == NULL) return NULL;\n modp = array_remainder(op1, op2);\n if (modp == NULL) {\n Py_DECREF(divp);\n return NULL;\n }\n result = Py_BuildValue(\"OO\", divp, modp);\n Py_DECREF(divp);\n Py_DECREF(modp);\n return result;\n}\n\n\nstatic PyObject *\narray_int(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can be\"\\\n\t\t\t\t\" converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv == NULL) return NULL;\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n Py_DECREF(pv);\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_int == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to int\");\n Py_DECREF(pv);\n return NULL;\n }\n\n pv2 = pv->ob_type->tp_as_number->nb_int(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_float(PyArrayObject *v) \n{\n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv == NULL) return NULL;\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an \"\\\n\t\t\t\t\"int; scalar object is not a number\");\n Py_DECREF(pv);\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_float == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to float\");\n Py_DECREF(pv);\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_float(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_long(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_long == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to long\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_long(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_oct(PyArrayObject *v) \n{\t \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_oct == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to oct\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_oct(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_hex(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_hex == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to hex\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_hex(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\n_array_copy_nice(PyArrayObject *self)\n{\n\treturn PyArray_Return((PyArrayObject *)\t\t\\\n\t\t\t PyArray_Copy(self));\n}\n\nstatic PyNumberMethods array_as_number = {\n (binaryfunc)array_add,\t\t /*nb_add*/\n (binaryfunc)array_subtract,\t\t /*nb_subtract*/\n (binaryfunc)array_multiply,\t\t /*nb_multiply*/\n (binaryfunc)array_divide,\t\t /*nb_divide*/\n (binaryfunc)array_remainder,\t /*nb_remainder*/\n (binaryfunc)array_divmod,\t\t /*nb_divmod*/\n (ternaryfunc)array_power,\t\t /*nb_power*/\n (unaryfunc)array_negative, /*nb_neg*/\t\n (unaryfunc)_array_copy_nice,\t\t /*nb_pos*/ \n (unaryfunc)array_absolute,\t\t /*(unaryfunc)array_abs,*/\n (inquiry)_array_nonzero,\t\t /*nb_nonzero*/\n (unaryfunc)array_invert,\t\t /*nb_invert*/\n (binaryfunc)array_left_shift,\t /*nb_lshift*/\n (binaryfunc)array_right_shift,\t /*nb_rshift*/\n (binaryfunc)array_bitwise_and,\t /*nb_and*/\n (binaryfunc)array_bitwise_xor,\t /*nb_xor*/\n (binaryfunc)array_bitwise_or,\t /*nb_or*/\n 0,\t\t /*nb_coerce*/\n (unaryfunc)array_int,\t\t /*nb_int*/\n (unaryfunc)array_long,\t\t /*nb_long*/\n (unaryfunc)array_float,\t\t /*nb_float*/\n (unaryfunc)array_oct,\t\t /*nb_oct*/\n (unaryfunc)array_hex,\t\t /*nb_hex*/\n\n /*This code adds augmented assignment functionality*/\n /*that was made available in Python 2.0*/\n (binaryfunc)array_inplace_add,\t /*inplace_add*/\n (binaryfunc)array_inplace_subtract,\t /*inplace_subtract*/\n (binaryfunc)array_inplace_multiply,\t /*inplace_multiply*/\n (binaryfunc)array_inplace_divide,\t /*inplace_divide*/\n (binaryfunc)array_inplace_remainder, /*inplace_remainder*/\n (ternaryfunc)array_inplace_power,\t /*inplace_power*/\n (binaryfunc)array_inplace_left_shift, /*inplace_lshift*/\n (binaryfunc)array_inplace_right_shift, /*inplace_rshift*/\n (binaryfunc)array_inplace_bitwise_and, /*inplace_and*/\n (binaryfunc)array_inplace_bitwise_xor, /*inplace_xor*/\n (binaryfunc)array_inplace_bitwise_or, /*inplace_or*/\n\n (binaryfunc)array_floor_divide,\t /*nb_floor_divide*/\n (binaryfunc)array_true_divide,\t /*nb_true_divide*/\n (binaryfunc)array_inplace_floor_divide, /*nb_inplace_floor_divide*/\n (binaryfunc)array_inplace_true_divide, /*nb_inplace_true_divide*/\n\n};\n\n/****************** End of Buffer Protocol *******************************/\n\n\n/*************************************************************************\n **************** Implement Sequence Protocol **************************\n *************************************************************************/\n\n/* Some of this is repeated in the array_as_mapping protocol. But\n we fill it in here so that PySequence_XXXX calls work as expected \n*/\n\n\nstatic PyObject * \narray_slice(PyArrayObject *self, int ilow, int ihigh) \n{\n PyArrayObject *r;\n int l;\n char *data;\n\n if (self->nd == 0) {\n PyErr_SetString(PyExc_ValueError, \"cannot slice a scalar\");\n return NULL;\n }\n \t\n l=self->dimensions[0];\n if (ihigh < 0) ihigh += l;\n if (ilow < 0) ilow += l;\n if (ilow < 0) ilow = 0;\n else if (ilow > l) ilow = l;\n if (ihigh < 0) ihigh = 0;\n else if (ihigh > l) ihigh = l;\n if (ihigh < ilow) ihigh = ilow;\n\n if (ihigh != ilow) {\n data = index2ptr(self, ilow);\n if (data == NULL) return NULL;\n } else {\n data = self->data;\n }\n\n self->dimensions[0] = ihigh-ilow;\n\tPy_INCREF(self->descr);\n r = (PyArrayObject *)\t\t\t\t\t\t\\\n\t\tPyArray_NewFromDescr(self->ob_type, self->descr,\n\t\t\t\t self->nd, self->dimensions, \n\t\t\t\t self->strides, data,\n\t\t\t\t self->flags, (PyObject *)self);\n\n self->dimensions[0] = l;\n r->base = (PyObject *)self;\n Py_INCREF(self);\n\tPyArray_UpdateFlags(r, UPDATE_ALL_FLAGS); \n return (PyObject *)r;\n}\n\n\nstatic int \narray_ass_slice(PyArrayObject *self, int ilow, int ihigh, PyObject *v) {\n int ret;\n PyArrayObject *tmp;\n\t\n if (v == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"cannot delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n if ((tmp = (PyArrayObject *)array_slice(self, ilow, ihigh)) \\\n == NULL) \n return -1; \n ret = PyArray_CopyObject(tmp, v);\n Py_DECREF(tmp);\n\t\n return ret;\n}\n\nstatic int\narray_contains(PyArrayObject *self, PyObject *el)\n{\n /* equivalent to (self == el).any() */\n\n PyObject *res; \n int ret;\n\n res = PyArray_EnsureArray(PyObject_RichCompare((PyObject *)self, el, Py_EQ));\n if (res == NULL) return -1;\n ret = array_any_nonzero((PyArrayObject *)res);\n Py_DECREF(res);\n return ret;\n}\n\n\nstatic PySequenceMethods array_as_sequence = {\n (inquiry)array_length,\t\t/*sq_length*/\n (binaryfunc)NULL, /* sq_concat is handled by nb_add*/\n (intargfunc)NULL, /* sq_repeat is handled nb_multiply*/\n (intargfunc)array_item_nice,\t\t/*sq_item*/\n (intintargfunc)array_slice,\t\t/*sq_slice*/\n (intobjargproc)array_ass_item,\t/*sq_ass_item*/\n (intintobjargproc)array_ass_slice,\t/*sq_ass_slice*/\n\t(objobjproc) array_contains, /* sq_contains */\n\t(binaryfunc) NULL, /* sg_inplace_concat */\n\t(intargfunc) NULL /* sg_inplace_repeat */\n};\n\n\n/****************** End of Sequence Protocol ****************************/\n\n\nstatic int \ndump_data(char **string, int *n, int *max_n, char *data, int nd, \n intp *dimensions, intp *strides, PyArrayObject* self) \n{\n PyArray_Descr *descr=self->descr;\n PyObject *op, *sp;\n char *ostring;\n int i, N;\n\t\n#define CHECK_MEMORY if (*n >= *max_n-16) { *max_n *= 2; \\\n\t\t*string = (char *)_pya_realloc(*string, *max_n); }\n\t\n if (nd == 0) {\n\t\t\n if ((op = descr->f->getitem(data, self)) == NULL) return -1;\n sp = PyObject_Repr(op);\n if (sp == NULL) {Py_DECREF(op); return -1;}\n ostring = PyString_AsString(sp);\n N = PyString_Size(sp)*sizeof(char);\n *n += N;\n CHECK_MEMORY\n memmove(*string+(*n-N), ostring, N);\n Py_DECREF(sp);\n Py_DECREF(op);\n return 0;\n } else {\n CHECK_MEMORY\n (*string)[*n] = '[';\n *n += 1;\n for(i=0; idata, \n\t\t self->nd, self->dimensions, \n self->strides, self) < 0) { \n\t\t_pya_free(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISEXTENDED(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->descr->elsize);\n\t\tsprintf(string+n, \", '%c%s')\", self->descr->type, buf);\n\t\tret = PyString_FromStringAndSize(string, n+6+strlen(buf));\n\t}\n\telse {\n\t\tsprintf(string+n, \", '%c')\", self->descr->type);\n\t\tret = PyString_FromStringAndSize(string, n+6);\n\t}\n\t\n\n _pya_free(string);\n return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\n\n/*OBJECT_API\n Set the array print function to be a Python function.\n*/\nstatic void \nPyArray_SetStringFunction(PyObject *op, int repr) \n{\n if (repr) {\n\t\t/* Dispose of previous callback */\n Py_XDECREF(PyArray_ReprFunction); \n\t\t/* Add a reference to new callback */\n Py_XINCREF(op); \n\t\t/* Remember new callback */\n PyArray_ReprFunction = op; \n } else {\n\t\t/* Dispose of previous callback */\n Py_XDECREF(PyArray_StrFunction); \n\t\t/* Add a reference to new callback */\n Py_XINCREF(op); \n\t\t/* Remember new callback */\n PyArray_StrFunction = op; \n }\n}\n\nstatic PyObject *\narray_repr(PyArrayObject *self) \n{\n PyObject *s, *arglist;\n\t\n if (PyArray_ReprFunction == NULL) {\n s = array_repr_builtin(self);\n } else {\n arglist = Py_BuildValue(\"(O)\", self);\n s = PyEval_CallObject(PyArray_ReprFunction, arglist);\n Py_DECREF(arglist); \n }\n return s;\n}\n\nstatic PyObject *\narray_str(PyArrayObject *self) \n{\n PyObject *s, *arglist;\n\t\n if (PyArray_StrFunction == NULL) {\n s = array_repr(self);\n } else {\n arglist = Py_BuildValue(\"(O)\", self);\n s = PyEval_CallObject(PyArray_StrFunction, arglist);\n Py_DECREF(arglist); \n }\n return s;\n}\n\nstatic PyObject *\narray_richcompare(PyArrayObject *self, PyObject *other, int cmp_op) \n{\n PyObject *array_other, *result;\n\n switch (cmp_op) \n {\n case Py_LT:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.less);\n case Py_LE:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.less_equal);\n case Py_EQ:\n /* Try to convert other to an array */\n array_other = PyArray_FromObject(other, \n\t\t\t\t\t\t\t PyArray_NOTYPE, 0, 0);\n /* If not successful, then return the integer\n\t\t\t object 0. This fixes code that used to\n\t\t\t allow equality comparisons between arrays\n\t\t\t and other objects which would give a result\n\t\t\t of 0\n */\n if ((array_other == NULL) || \\\n\t\t\t (array_other == Py_None)) {\n Py_XDECREF(array_other);\n PyErr_Clear();\n Py_INCREF(Py_False);\n return Py_False;\n }\n result = PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t array_other, \n\t\t\t\t\t\t\t n_ops.equal);\n /* If the comparison results in NULL, then the \n\t\t\t two array objects can not be compared together so \n\t\t\t return zero \n */\n Py_DECREF(array_other);\n if (result == NULL) {\n PyErr_Clear();\n Py_INCREF(Py_False);\n return Py_False;\n }\n return result;\n case Py_NE:\n /* Try to convert other to an array */\n array_other = PyArray_FromObject(other, \n\t\t\t\t\t\t\t PyArray_NOTYPE, 0, 0);\n /* If not successful, then objects cannot be \n\t\t\t compared and cannot be equal, therefore, \n\t\t\t return True;\n */\n if ((array_other == NULL) || \\\n\t\t\t (array_other == Py_None)) {\n Py_XDECREF(array_other);\n PyErr_Clear();\n Py_INCREF(Py_True);\n return Py_True;\n }\n result = PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t array_other, \n\t\t\t\t\t\t\t n_ops.not_equal);\n Py_DECREF(array_other);\n if (result == NULL) {\n PyErr_Clear();\n Py_INCREF(Py_True);\n return Py_True;\n }\n return result;\n case Py_GT:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.greater);\n case Py_GE:\n return PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t other, \n\t\t\t\t\t \t n_ops.greater_equal);\n }\n return NULL;\n}\n\nstatic PyObject *\n_check_axis(PyArrayObject *arr, int *axis, int flags)\n{\n\tPyObject *temp;\n\tint n = arr->nd;\n\n\tif ((*axis >= MAX_DIMS) || (n==0)) {\n\t\ttemp = PyArray_Ravel(arr,0);\n\t\t*axis = 0;\n\t\treturn temp;\n\t}\n\telse {\n\t\tif (flags) {\n\t\t\ttemp = PyArray_FromAny((PyObject *)arr, NULL, \n\t\t\t\t\t 0, 0, flags);\n\t\t\tif (temp == NULL) return NULL;\n\t\t}\n\t\telse {\n\t\t\tPy_INCREF(arr);\n\t\t\ttemp = (PyObject *)arr;\n\t\t}\n\t}\n\tif (*axis < 0) *axis += n;\n\tif ((*axis < 0) || (*axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", *axis);\n\t\tPy_DECREF(temp);\n\t\treturn NULL;\n\t}\n\treturn temp;\n}\n\n#include \"arraymethods.c\"\n\n/* Lifted from numarray */\nstatic PyObject *\nPyArray_IntTupleFromIntp(int len, intp *vals)\n{\n\tint i;\n PyObject *intTuple = PyTuple_New(len);\n if (!intTuple) goto fail;\n for(i=0; ind == 0) return 1;\n\tsd = ap->descr->elsize;\n\tif (ap->nd == 1) return sd == ap->strides[0];\n\tfor (i = ap->nd-1; i >= 0; --i) {\n\t\t/* contiguous by definition */\n\t\tif (ap->dimensions[i] == 0) return 1; \n\t\t\n\t\tif (ap->strides[i] != sd) return 0;\n\t\tsd *= ap->dimensions[i];\n\t}\n\treturn 1;\n}\n\n\nstatic int \n_IsFortranContiguous(PyArrayObject *ap) \n{\n\tintp sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->descr->elsize;\n\tif (ap->nd == 1) return sd == ap->strides[0];\n\tfor (i=0; i< ap->nd; ++i) {\n\t\t/* contiguous by definition */\n\t\tif (ap->dimensions[i] == 0) return 1; \n\t\t\n\t\tif (ap->strides[i] != sd) return 0;\n\t\tsd *= ap->dimensions[i];\n\t}\n\treturn 1;\n}\n\nstatic int\n_IsAligned(PyArrayObject *ap) \n{\n\tint i, alignment, aligned=1;\n\tintp ptr;\n\tint type = ap->descr->type_num;\n\n\tif ((type == PyArray_STRING) || (type == PyArray_VOID))\n\t\treturn 1;\n\n\talignment = ap->descr->alignment;\n\tif (alignment == 1) return 1;\n\n\tptr = (intp) ap->data;\n aligned = (ptr % alignment) == 0;\n for (i=0; i nd; i++)\n aligned &= ((ap->strides[i] % alignment) == 0);\n return aligned != 0;\n}\n\nstatic Bool\n_IsWriteable(PyArrayObject *ap)\n{\n\tPyObject *base=ap->base;\n\tvoid *dummy;\n\tint n;\n\n\t/* If we own our own data, then no-problem */\n\tif ((base == NULL) || (ap->flags & OWN_DATA)) return TRUE;\n\n\t/* Get to the final base object \n\t If it is a writeable array, then return TRUE\n\t If we can find an array object \n\t or a writeable buffer object as the final base object\n\t or a string object (for pickling support memory savings).\n\t - this last could be removed if a proper pickleable \n\t buffer was added to Python.\n\t*/\n\n\twhile(PyArray_Check(base)) {\n\t\tif (PyArray_CHKFLAGS(base, OWN_DATA)) \n\t\t\treturn (Bool) (PyArray_ISWRITEABLE(base));\n\t\tbase = PyArray_BASE(base);\n\t}\n\n\t/* here so pickle support works seamlessly \n\t and unpickled array can be set and reset writeable \n\t -- could be abused -- */\n\tif PyString_Check(base) return TRUE;\n\n\tif (PyObject_AsWriteBuffer(base, &dummy, &n) < 0)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\n\n/*OBJECT_API\n Update Several Flags at once.\n*/\nstatic void\nPyArray_UpdateFlags(PyArrayObject *ret, int flagmask)\n{\n\n\tif (flagmask & FORTRAN) {\n\t\tif (_IsFortranContiguous(ret)) {\n\t\t\tret->flags |= FORTRAN;\n\t\t\tif (ret->nd > 1) ret->flags &= ~CONTIGUOUS;\n\t\t}\n\t\telse ret->flags &= ~FORTRAN;\n\t}\n\tif (flagmask & CONTIGUOUS) {\n\t\tif (_IsContiguous(ret)) {\n\t\t\tret->flags |= CONTIGUOUS;\n\t\t\tif (ret->nd > 1) ret->flags &= ~FORTRAN;\n\t\t}\n\t\telse ret->flags &= ~CONTIGUOUS;\n\t}\n\tif (flagmask & ALIGNED) {\n\t\tif (_IsAligned(ret)) ret->flags |= ALIGNED;\n\t\telse ret->flags &= ~ALIGNED;\n\t}\n\t/* This is not checked by default WRITEABLE is not part of UPDATE_ALL_FLAGS */\n\tif (flagmask & WRITEABLE) {\n\t if (_IsWriteable(ret)) ret->flags |= WRITEABLE;\n\t \telse ret->flags &= ~WRITEABLE;\t\n }\n\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by a single segment array of the provided \n dimensions and element size. If numbytes is 0 it will be calculated from \n the provided shape and element size.\n*/\n/*OBJECT_API*/\nstatic Bool\nPyArray_CheckStrides(int elsize, int nd, intp numbytes, \n\t\t intp *dims, intp *newstrides)\n{\n\tint i;\n\t\n\tif (numbytes == 0) \n\t\tnumbytes = PyArray_MultiplyList(dims, nd) * elsize;\n\t\n\tfor (i=0; i numbytes) {\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\treturn TRUE;\n\t\n}\n\n\n/* This is the main array creation routine. */\n\n/* Flags argument has multiple related meanings \n depending on data and strides: \n\n If data is given, then flags is flags associated with data. \n If strides is not given, then a contiguous strides array will be created\n and the CONTIGUOUS bit will be set. If the flags argument \n has the FORTRAN bit set, then a FORTRAN-style strides array will be\n created (and of course the FORTRAN flag bit will be set). \n\n If data is not given but created here, then flags will be DEFAULT_FLAGS\n and a non-zero flags argument can be used to indicate a FORTRAN style\n array is desired. \n*/\n\nstatic intp\n_array_fill_strides(intp *strides, intp *dims, int nd, intp itemsize, \n\t\t int inflag, int *objflags) \n{\n\tint i;\n\t/* Only make Fortran strides if not contiguous as well */\n\tif ((inflag & FORTRAN) && !(inflag & CONTIGUOUS)) {\n\t\tfor (i=0; i 1) *objflags &= ~CONTIGUOUS;\n\t\telse *objflags |= CONTIGUOUS;\n\t}\n\telse {\n\t\tfor (i=nd-1;i>=0;i--) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= CONTIGUOUS;\n\t\tif (nd > 1) *objflags &= ~FORTRAN;\n\t\telse *objflags |= FORTRAN;\n\t}\n\treturn itemsize;\n}\n\n/*OBJECT_API\n Generic new array creation routine.\n*/\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n intp *strides, void *data, int itemsize, int flags,\n\t PyObject *obj)\n{\n\tPyArray_Descr *descr;\n\tPyObject *new;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\t\n\tif (descr->elsize == 0) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"data type must provide an itemsize\");\n\t\t\tPy_DECREF(descr);\n\t\t\treturn NULL;\n\t\t}\n\t\tPyArray_DESCR_REPLACE(descr);\n\t\tdescr->elsize = itemsize;\n\t}\n\tnew = PyArray_NewFromDescr(subtype, descr, nd, dims, strides,\n\t\t\t\t data, flags, obj);\n\treturn new;\n}\n\n/* Change a sub-array field to the base descriptor */\nstatic int\n_update_descr_and_dimensions(PyArray_Descr **des, intp *newdims, \n\t\t\t intp *newstrides, int oldnd)\n{\n\tPyArray_Descr *old;\n\tint newnd;\n\tint numnew;\n\tintp *mydim;\n\tint i;\n\t\n\told = *des;\n\t*des = old->subarray->base;\n\n\tmydim = newdims + oldnd;\n\tif (PyTuple_Check(old->subarray->shape)) {\n\t\tnumnew = PyTuple_GET_SIZE(old->subarray->shape);\n\t\t\n\t\tfor (i=0; isubarray->shape, i));\n\t\t}\n\t}\n\telse {\n\t\tnumnew = 1;\n\t\tmydim[0] = (intp) PyInt_AsLong(old->subarray->shape);\n\t}\n\t\n\tnewnd = oldnd + numnew;\n\n\tif (newstrides) {\n\t\tintp tempsize;\n\t\tintp *mystrides;\n\t\tmystrides = newstrides + oldnd;\n\t\t/* Make new strides */\n\t\ttempsize = (*des)->elsize;\n\t\tfor (i=numnew-1; i>=0; i--) {\n\t\t\tmystrides[i] = tempsize;\n\t\t\ttempsize *= mydim[i] ? mydim[i] : 1;\n\t\t}\n\t}\n\tPy_INCREF(*des); \n\tPy_DECREF(old); \n\treturn newnd;\n}\n\n\n/* steals a reference to descr (even on failure) */\n/*OBJECT_API\n Generic new array creation routine.\n*/\nstatic PyObject *\nPyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, \n\t\t intp *dims, intp *strides, void *data, \n\t\t int flags, PyObject *obj)\n{\t\n\tPyArrayObject *self;\n\tregister int i;\n\tintp sd;\n\n\tif (descr->subarray) {\n\t\tPyObject *ret;\n\t\tintp newdims[2*MAX_DIMS];\n\t\tintp *newstrides=NULL;\n\t\tmemcpy(newdims, dims, nd*sizeof(intp));\n\t\tif (strides) {\n\t\t\tnewstrides = newdims + MAX_DIMS;\n\t\t\tmemcpy(newstrides, strides, nd*sizeof(intp));\n\t\t}\n\t\tnd =_update_descr_and_dimensions(&descr, newdims, \n\t\t\t\t\t\t newstrides, nd);\n\t\tret = PyArray_NewFromDescr(subtype, descr, nd, newdims, \n\t\t\t\t\t newstrides,\n\t\t\t\t\t data, flags, obj);\n\t\treturn ret;\n\t}\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\n\t\tPy_DECREF(descr);\n\t\treturn NULL;\n\t}\n if (nd > MAX_DIMS) {\n PyErr_Format(PyExc_ValueError,\n \"maximum number of dimensions is %d\", MAX_DIMS);\n\t\tPy_DECREF(descr);\n return NULL;\n\t}\n\n\t/* Check dimensions */\n\tfor (i=nd-1;i>=0;i--) {\n\t\tif (dims[i] < 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"negative dimensions \"\t\\\n\t\t\t\t\t\"are not allowed\");\n\t\t\tPy_DECREF(descr);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) {\n\t\tPy_DECREF(descr);\n\t\treturn NULL;\t\n\t}\n\tself->dimensions = NULL;\n\tif (data == NULL) { /* strides is NULL too */\n\t\tself->flags = DEFAULT_FLAGS;\n\t\tif (flags) {\n\t\t\tself->flags |= FORTRAN; \n\t\t\tif (nd > 1) self->flags &= ~CONTIGUOUS;\n\t\t\tflags = FORTRAN;\n\t\t}\n\t}\n\telse self->flags = (flags & ~UPDATEIFCOPY);\n\t\t\n\tsd = descr->elsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\tgoto fail;\n\t\t}\n\t\tself->strides = self->dimensions + nd;\n\t\tmemcpy(self->dimensions, dims, sizeof(intp)*nd);\n\t\tif (strides == NULL) { /* fill it in */\n\t\t\tsd = _array_fill_strides(self->strides, dims, nd, sd,\n\t\t\t\t\t\t flags, &(self->flags));\n\t\t}\n\t\telse {\n\t\t\tif (data == NULL) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"if 'strides' is given in \" \\\n\t\t\t\t\t\t\"array creation, data must \" \\\n\t\t\t\t\t\t\"be given too\");\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\t\treturn NULL;\n\t\t\t}\t\t\t\t\n\t\t\tmemcpy(self->strides, strides, sizeof(intp)*nd);\n\t\t}\n\t}\n \t\n\tself->descr = descr;\n\n\t\t\n\tif (data == NULL) {\n\n\t\t/* Allocate something even for zero-space arrays \n\t\t e.g. shape=(0,) -- otherwise buffer exposure \n\t\t (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\tgoto fail;\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\tif (descr == &OBJECT_Descr) {\n\t\t\tmemset(data, 0, sd);\n\t\t}\n\t}\n\telse {\n self->flags &= ~OWN_DATA; /* If data is passed in, \n\t\t\t\t\t this object won't own it \n\t\t\t\t\t by default.\n\t\t\t\t\t Caller must arrange for \n\t\t\t\t\t this to be reset if truly\n\t\t\t\t\t desired */\n }\n self->data = data;\n\tself->nd = nd;\n\tself->base = (PyObject *)NULL;\n self->weakreflist = (PyObject *)NULL;\n\n /* call the __array_finalize__\n\t method if a subtype and some object passed in */\n\tif ((obj != NULL) && (subtype != &PyArray_Type) && \n\t (subtype != &PyBigArray_Type)) {\n\t\tPyObject *res;\n\t\tif (!(self->flags & OWNDATA)) { /* did not allocate own data */\n\t\t\t /* update flags before calling back into\n\t\t\t Python */\n\t\t\tPyArray_UpdateFlags(self, UPDATE_ALL_FLAGS);\n\t\t}\n\t\tres = PyObject_CallMethod((PyObject *)self, \n\t\t\t\t\t \"__array_finalize__\",\n\t\t\t\t\t \"O\", obj);\n\t\tif (res == NULL) {\n\t\t\tif (self->flags & OWNDATA) PyDataMem_FREE(self);\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t/* theoretically should free self\n\t\t\t but this causes segmentation faults...\n\t\t\t Not sure why */\n\t\t\treturn NULL;\n\t\t}\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n\n fail:\n\tPy_DECREF(descr);\n\tPyDimMem_FREE(self->dimensions);\n\tsubtype->tp_free((PyObject *)self);\n\treturn NULL;\n\n}\n\n\n\n/*OBJECT_API\n Resize (reallocate data). Only works if nothing else is referencing\n this array and it is contiguous.\n*/\nstatic PyObject * \nPyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape)\n{\n intp oldsize, newsize;\n int new_nd=newshape->len, k, n, elsize;\n int refcnt;\n intp* new_dimensions=newshape->ptr;\n intp new_strides[MAX_DIMS];\n intp sd;\n intp *dimptr;\n char *new_data;\n\t\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \n \"resize only works on contiguous arrays\");\n return NULL;\n }\n\n\n newsize = PyArray_MultiplyList(new_dimensions, new_nd);\n\n if (newsize == 0) {\n PyErr_SetString(PyExc_ValueError, \n \"newsize is zero; cannot delete an array \"\\\n \"in this way\");\n return NULL;\n }\n oldsize = PyArray_SIZE(self);\n \n\tif (oldsize != newsize) {\n\t\tif (!(self->flags & OWN_DATA)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"cannot resize this array: \"\t\\\n\t\t\t\t\t\"it does not own its data\");\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\trefcnt = REFCOUNT(self);\n\t\tif ((refcnt > 2) || (self->base != NULL) || \\\n\t\t (self->weakreflist != NULL)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"cannot resize an array that has \"\\\n\t\t\t\t\t\"been referenced or is referencing\\n\"\\\n\t\t\t\t\t\"another array in this way. Use the \"\\\n\t\t\t\t\t\"resize function\");\n\t\t\treturn NULL;\n\t\t} \n\t\t\n\t\t/* Reallocate space if needed */\n\t\tnew_data = PyDataMem_RENEW(self->data, \n\t\t\t\t\t newsize*(self->descr->elsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"cannot allocate memory for array\");\n\t\t\treturn NULL;\n\t\t}\n\t\tself->data = new_data;\n\t}\n \n if ((newsize > oldsize) && PyArray_ISWRITEABLE(self)) { \n\t\t/* Fill new memory with zeros */\n elsize = self->descr->elsize;\n\t\tif ((PyArray_TYPE(self) == PyArray_OBJECT)) {\n\t\t\tPyObject *zero = PyInt_FromLong(0);\n PyObject **optr;\n\t\t\toptr = ((PyObject **)self->data) + oldsize;\n\t\t\tn = newsize - oldsize;\n\t\t\tfor (k=0; kdata+oldsize*elsize, 0, \n\t\t\t (newsize-oldsize)*elsize);\n\t\t}\n\t}\n \n if (self->nd != new_nd) { /* Different number of dimensions. */\n self->nd = new_nd;\n \n /* Need new dimensions and strides arrays */\n dimptr = PyDimMem_RENEW(self->dimensions, 2*new_nd);\n if (dimptr == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n \"cannot allocate memory for array \" \\\n \"(array may be corrupted)\");\n return NULL;\n }\n self->dimensions = dimptr;\n\t\tself->strides = dimptr + new_nd;\n }\n\n /* make new_strides variable */\n sd = (intp) self->descr->elsize;\n sd = _array_fill_strides(new_strides, new_dimensions, new_nd, sd,\n 0, &(self->flags));\n\n \n memmove(self->dimensions, new_dimensions, new_nd*sizeof(intp));\n memmove(self->strides, new_strides, new_nd*sizeof(intp));\n\n Py_INCREF(Py_None);\t\n return Py_None;\n \n}\n\n\n/* Assumes contiguous */\n/*OBJECT_API*/\nstatic void\nPyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj)\n{\n PyObject **optr;\n intp i,n;\n optr = (PyObject **)(arr->data);\n n = PyArray_SIZE(arr);\n if (obj == NULL) {\n for (i=0; ielsize;\n\tPy_INCREF(descr);\n\tnewarr = PyArray_FromAny(obj, descr, 0,0, ALIGNED);\n\tif (newarr == NULL) return -1;\n\tfromptr = PyArray_DATA(newarr);\n\tsize=PyArray_SIZE(arr);\n\tswap=!PyArray_ISNOTSWAPPED(arr);\n\tcopyswap = arr->descr->f->copyswap;\n\tif (PyArray_ISONESEGMENT(arr)) {\n\t\tchar *toptr=PyArray_DATA(arr);\n\t\twhile (size--) {\n\t\t\tcopyswap(toptr, fromptr, swap, itemsize);\n\t\t\ttoptr += itemsize;\n\t\t}\n\t}\n\telse {\n\t\tPyArrayIterObject *iter;\n\t\t\n\t\titer = (PyArrayIterObject *)\\\n\t\t\tPyArray_IterNew((PyObject *)arr);\n\t\tif (iter == NULL) {\n\t\t\tPy_DECREF(newarr);\n\t\t\treturn -1;\n\t\t}\n\t\twhile(size--) {\n\t\t\tcopyswap(iter->dataptr, fromptr, swap, itemsize);\n\t\t\tPyArray_ITER_NEXT(iter);\n\t\t}\n\t\tPy_DECREF(iter);\n\t}\n\tPy_DECREF(newarr);\n\treturn 0;\n}\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \n\t\t\t\t \"offset\", \"strides\",\n\t\t\t\t \"fortran\", NULL};\n\tPyArray_Descr *descr=NULL;\n\tint type_num;\n\tint itemsize;\n PyArray_Dims dims = {NULL, 0};\n PyArray_Dims strides = {NULL, 0};\n PyArray_Chunk buffer;\n\tlonglong offset=0;\n\tint fortran = 0;\n\tPyArrayObject *ret;\n\n\tbuffer.ptr = NULL; \n /* Usually called with shape and type\n but can also be called with buffer, strides, and swapped info\n */\n\n\t/* For now, let's just use this to create an empty, contiguous \n\t array of a specific type and shape. \n\t*/\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&LO&i\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &dims, \n PyArray_DescrConverter,\n\t\t\t\t\t &descr,\n PyArray_BufferConverter,\n &buffer,\n\t\t\t\t\t &offset,\n &PyArray_IntpConverter, \n &strides,\n &fortran)) \n\t\tgoto fail;\n\t\n\ttype_num = descr->type_num;\n\titemsize = descr->elsize;\t\n\n if (dims.ptr == NULL) {\n PyErr_SetString(PyExc_ValueError, \"need to give a \"\\\n \"valid shape as the first argument\");\n goto fail;\n }\n if (buffer.ptr == NULL) {\n ret = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(subtype, descr,\n\t\t\t\t\t (int)dims.len, \n\t\t\t\t\t dims.ptr, \n\t\t\t\t\t NULL, NULL, fortran, NULL);\n if (ret == NULL) {descr=NULL;goto fail;}\n if (type_num == PyArray_OBJECT) { /* place Py_None */\n PyArray_FillObjectArray(ret, Py_None);\n }\n }\n else { /* buffer given -- use it */\n\t\tbuffer.len -= offset;\n\t\tbuffer.ptr += offset;\n if (dims.len == 1 && dims.ptr[0] == -1) {\n dims.ptr[0] = buffer.len / itemsize;\n }\n else if (buffer.len < itemsize* \\\n PyArray_MultiplyList(dims.ptr, dims.len)) {\n PyErr_SetString(PyExc_TypeError, \n \"buffer is too small for \" \\\n \"requested array\");\n goto fail;\n }\n if (strides.ptr != NULL) {\n\t\t\tif (strides.len != dims.len) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"strides, if given, must be \"\\\n\t\t\t\t\t\t\"the same length as shape\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tif (!PyArray_CheckStrides(itemsize, strides.len, \n\t\t\t\t\t\t buffer.len,\n\t\t\t\t\t\t dims.ptr, strides.ptr)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"strides is incompatible \"\\\n\t\t\t\t\t\t\"with shape of requested\"\\\n\t\t\t\t\t\t\"array and size of buffer\");\n\t\t\t\tgoto fail;\n\t\t\t}\n }\n if (type_num == PyArray_OBJECT) {\n PyErr_SetString(PyExc_TypeError, \"cannot construct \"\\\n \"an object array from buffer data\");\n goto fail;\n }\n /* get writeable and aligned */\n if (fortran) buffer.flags |= FORTRAN;\n ret = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(subtype, descr,\n\t\t\t\t\t dims.len, dims.ptr,\n\t\t\t\t\t strides.ptr,\n\t\t\t\t\t (char *)buffer.ptr, \n\t\t\t\t\t buffer.flags, NULL); \n if (ret == NULL) {descr=NULL; goto fail;}\n PyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n ret->base = buffer.base;\n Py_INCREF(buffer.base); \n }\n\n PyDimMem_FREE(dims.ptr);\n if (strides.ptr) PyDimMem_FREE(strides.ptr);\n return (PyObject *)ret;\n \n fail:\n\tPy_XDECREF(descr);\n if (dims.ptr) PyDimMem_FREE(dims.ptr);\n if (strides.ptr) PyDimMem_FREE(strides.ptr);\n return NULL;\n}\n\n\nstatic PyObject *\narray_iter(PyArrayObject *arr)\n{\n\tif (arr->nd == 0) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"iteration over a scalar (0-dim array)\");\n\t\treturn NULL;\n\t}\n\treturn PySeqIter_New((PyObject *)arr);\n}\n\n\n/******************* array attribute get and set routines ******************/\n\nstatic PyObject *\narray_ndim_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong(self->nd);\n}\n\nstatic PyObject *\narray_flags_get(PyArrayObject *self)\n{\n return PyObject_CallMethod(_numpy_internal, \"flagsobj\", \"Oii\", \n self, self->flags, 0);\n}\n\nstatic PyObject *\narray_shape_get(PyArrayObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->dimensions);\n}\n\n\nstatic int\narray_shape_set(PyArrayObject *self, PyObject *val)\n{\n \tint nd;\n\tPyObject *ret;\n\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\n\t/* Free old dimensions and strides */\n\tPyDimMem_FREE(self->dimensions);\n\tnd = PyArray_NDIM(ret);\n\tself->nd = nd;\n\tif (nd > 0) { /* create new dimensions and strides */\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPy_DECREF(ret);\n\t\t\tPyErr_SetString(PyExc_MemoryError,\"\");\n\t\t\treturn -1;\n\t\t}\n\t\tself->strides = self->dimensions + nd;\n\t\tmemcpy(self->dimensions, PyArray_DIMS(ret), \n\t\t nd*sizeof(intp));\n\t\tmemcpy(self->strides, PyArray_STRIDES(ret), \n\t\t nd*sizeof(intp));\n\t}\n\telse {self->dimensions=NULL; self->strides=NULL;}\n\tPy_DECREF(ret);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\n}\n\n\nstatic PyObject *\narray_strides_get(PyArrayObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->strides);\n}\n\nstatic int\narray_strides_set(PyArrayObject *self, PyObject *obj)\n{\n\tPyArray_Dims newstrides = {NULL, 0};\n\tPyArrayObject *new;\n\tintp numbytes;\n\n\tif (!PyArray_IntpConverter(obj, &newstrides) || \\\n\t newstrides.ptr == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \"invalid strides\");\n\t\treturn -1;\n\t}\n\tif (newstrides.len != self->nd) {\n\t\tPyErr_Format(PyExc_ValueError, \"strides must be \"\t\\\n\t\t\t \" same length as shape (%d)\", self->nd);\n\t\tgoto fail;\n\t}\n\tnew = self;\n\twhile(new->base != NULL) {\n\t\tif (PyArray_Check(new->base)) \n\t\t\tnew = (PyArrayObject *)new->base;\n\t}\n\tnumbytes = PyArray_MultiplyList(new->dimensions, \n\t\t\t\t\tnew->nd)*new->descr->elsize;\n\t\n\tif (!PyArray_CheckStrides(self->descr->elsize, self->nd, numbytes, \n\t\t\t\t self->dimensions, newstrides.ptr)) {\n\t\tPyErr_SetString(PyExc_ValueError, \"strides is not \"\\\n\t\t\t\t\"compatible with available memory\");\n\t\tgoto fail;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\tPyDimMem_FREE(newstrides.ptr);\n\treturn 0;\n\n fail:\n\tPyDimMem_FREE(newstrides.ptr);\n\treturn -1;\n}\n\n\nstatic PyObject *\narray_protocol_strides_get(PyArrayObject *self)\n{\n\tif PyArray_ISCONTIGUOUS(self) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn PyArray_IntTupleFromIntp(self->nd, self->strides);\n}\n\nstatic PyObject *\narray_priority_get(PyArrayObject *self)\n{\n\tif (PyArray_CheckExact(self)) \n\t\treturn PyFloat_FromDouble(PyArray_PRIORITY);\n\telse if (PyBigArray_CheckExact(self)) \n\t\treturn PyFloat_FromDouble(PyArray_BIG_PRIORITY);\n\telse\n\t\treturn PyFloat_FromDouble(PyArray_SUBTYPE_PRIORITY);\n}\n\n\nstatic PyObject *\narray_dataptr_get(PyArrayObject *self)\n{\n\treturn Py_BuildValue(\"NO\",\n\t\t\t PyString_FromFormat(\"%p\", self->data),\n\t\t\t (self->flags & WRITEABLE ? Py_False :\n\t\t\t Py_True));\n}\n\nstatic PyObject *\narray_data_get(PyArrayObject *self)\n{\n\tintp nbytes;\n\tif (!(PyArray_ISONESEGMENT(self))) {\n\t\tPyErr_SetString(PyExc_AttributeError, \"cannot get single-\"\\\n\t\t\t\t\"segment buffer for discontiguous array\");\n\t\treturn NULL;\n\t}\t\t\n\tnbytes = PyArray_NBYTES(self);\n\tif PyArray_ISWRITEABLE(self) \n\t\treturn PyBuffer_FromReadWriteObject((PyObject *)self, 0, \n\t\t\t\t\t\t (int) nbytes);\n\telse\n\t\treturn PyBuffer_FromObject((PyObject *)self, 0, (int) nbytes);\n}\n\nstatic int\narray_data_set(PyArrayObject *self, PyObject *op)\n{\n\tvoid *buf;\n\tint buf_len;\n\tint writeable=1;\n\n\tif (PyObject_AsWriteBuffer(op, &buf, &buf_len) < 0) {\n\t\twriteable = 0;\n\t\tif (PyObject_AsReadBuffer(op, (const void **)&buf, \n\t\t\t\t\t &buf_len) < 0) {\n\t\t\tPyErr_SetString(PyExc_AttributeError, \n\t\t\t\t\t\"object does not have single-segment \" \\\n\t\t\t\t\t\"buffer interface\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\tif (!PyArray_ISONESEGMENT(self)) {\n\t\tPyErr_SetString(PyExc_AttributeError, \"cannot set single-\" \\\n\t\t\t\t\"segment buffer for discontiguous array\");\n\t\treturn -1;\n\t}\n\tif (PyArray_NBYTES(self) > buf_len) {\n\t\tPyErr_SetString(PyExc_AttributeError, \n\t\t\t\t\"not enough data for array\");\n\t\treturn -1;\n\t}\n\tif (self->flags & OWN_DATA) {\n\t\tPyArray_XDECREF(self);\n\t\tPyDataMem_FREE(self->data);\n\t}\n\tif (self->base) {\n\t\tif (self->flags & UPDATEIFCOPY) {\n\t\t\t((PyArrayObject *)self->base)->flags |= WRITEABLE;\n\t\t\tself->flags &= ~UPDATEIFCOPY;\n\t\t}\n\t\tPy_DECREF(self->base);\n\t}\n\tPy_INCREF(op);\n\tself->base = op;\n\tself->data = buf;\n\tself->flags = CARRAY_FLAGS;\n\tif (!writeable)\n\t\tself->flags &= ~WRITEABLE;\n\treturn 0;\n}\n\n\nstatic PyObject *\narray_itemsize_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->elsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tintp size=PyArray_SIZE(self);\n#if SIZEOF_INTP <= SIZEOF_LONG\n return PyInt_FromLong((long) size);\n#else\n\tif (size > MAX_LONG || size < MIN_LONG)\n\t\treturn PyLong_FromLongLong(size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n#endif\n}\n\nstatic PyObject *\narray_nbytes_get(PyArrayObject *self)\n{\n intp nbytes = PyArray_NBYTES(self);\n#if SIZEOF_INTP <= SIZEOF_LONG\n return PyInt_FromLong((long) nbytes);\n#else\n\tif (nbytes > MAX_LONG || nbytes < MIN_LONG)\n\t\treturn PyLong_FromLongLong(nbytes);\n\telse \n\t\treturn PyInt_FromLong((long) nbytes);\n#endif\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISEXTENDED(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t self->descr->elsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *arraydescr_protocol_typestr_get(PyArray_Descr *);\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\treturn arraydescr_protocol_typestr_get(self->descr);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self) \n{\n\tPy_INCREF(self->descr);\n\treturn (PyObject *)self->descr;\n}\n\n\n/* If the type is changed. \n Also needing change: strides, itemsize\n\n Either itemsize is exactly the same\n or the array is single-segment (contiguous or fortran) with\n compatibile dimensions\n\n The shape and strides will be adjusted in that case as well.\n*/\n\nstatic int\narray_descr_set(PyArrayObject *self, PyObject *arg)\n{\n PyArray_Descr *newtype=NULL;\n intp newdim;\n int index;\n char *msg = \"new type not compatible with array.\";\n\n if (!(PyArray_DescrConverter(arg, &newtype)) ||\n newtype == NULL) {\n PyErr_SetString(PyExc_TypeError, \"invalid type for array\");\n\t\treturn -1;\n }\n\tif (newtype->type_num == PyArray_OBJECT || \\\n\t self->descr->type_num == PyArray_OBJECT) {\n\t\tPyErr_SetString(PyExc_TypeError, \\\n\t\t\t\t\"Cannot change descriptor for object\"\\\n\t\t\t\t\"array.\");\n\t\tPy_DECREF(newtype);\n\t\treturn -1;\n\t}\n\n\tif ((newtype->elsize != self->descr->elsize) &&\t\t\\\n\t (self->nd == 0 || !PyArray_ISONESEGMENT(self) || \\\n\t newtype->subarray)) goto fail;\n\t\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\t\n\tif (newtype->elsize < self->descr->elsize) {\n\t\t/* if it is compatible increase the size of the \n\t\t dimension at end (or at the front for FORTRAN)\n\t\t*/\n\t\tif (self->descr->elsize % newtype->elsize != 0) \n\t\t\tgoto fail;\n\t\tnewdim = self->descr->elsize / newtype->elsize;\n\t\tself->dimensions[index] *= newdim;\n\t\tself->strides[index] = newtype->elsize;\n\t}\n\t\n\telse if (newtype->elsize > self->descr->elsize) {\n\t\t\n\t\t/* Determine if last (or first if FORTRAN) dimension\n\t\t is compatible */\n\t\t\n\t\tnewdim = self->dimensions[index] * self->descr->elsize;\n\t\tif ((newdim % newtype->elsize) != 0) goto fail;\n\t\t\n\t\tself->dimensions[index] = newdim / newtype->elsize;\n\t\tself->strides[index] = newtype->elsize;\n\t}\n\n /* fall through -- adjust type*/\n\n\tPy_DECREF(self->descr);\n\tif (newtype->subarray) {\n\t\t/* create new array object from data and update \n\t\t dimensions, strides and descr from it */\n\t\tPyArrayObject *temp;\n\n\t\ttemp = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(&PyArray_Type, newtype, self->nd,\n\t\t\t\t\t self->dimensions, self->strides,\n\t\t\t\t\t self->data, self->flags, NULL);\n\t\tPyDimMem_FREE(self->dimensions);\n\t\tself->dimensions = temp->dimensions;\n\t\tself->nd = temp->nd;\n\t\tself->strides = temp->strides;\n\t\tPy_DECREF(newtype);\n\t\tnewtype = temp->descr;\n\t\t/* Fool deallocator */\n\t\ttemp->nd = 0;\n\t\ttemp->dimensions = NULL;\n\t\ttemp->descr = NULL;\n\t\tPy_DECREF(temp);\n\t}\n\n\tself->descr = newtype; \n\tPyArray_UpdateFlags(self, UPDATE_ALL_FLAGS);\n\t\n return 0;\n\n fail:\n\tPyErr_SetString(PyExc_ValueError, msg);\n\tPy_DECREF(newtype);\n\treturn -1;\n}\n\nstatic PyObject *\narray_protocol_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\t\n\tres = PyObject_GetAttrString((PyObject *)self->descr, \"arrdescr\");\n\tif (res) return res;\n\tPyErr_Clear();\n\n\t/* get default */\n\tdobj = PyTuple_New(2);\n\tif (dobj == NULL) return NULL;\n\tPyTuple_SET_ITEM(dobj, 0, PyString_FromString(\"\"));\n\tPyTuple_SET_ITEM(dobj, 1, array_typestr_get(self));\n\tres = PyList_New(1);\n\tif (res == NULL) {Py_DECREF(dobj); return NULL;}\n\tPyList_SET_ITEM(res, 0, dobj);\n\treturn res;\n}\n\nstatic PyObject *\narray_struct_get(PyArrayObject *self)\n{\n PyArrayInterface *inter;\n \n inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface));\n inter->version = 2;\n inter->nd = self->nd;\n inter->typekind = self->descr->kind;\n inter->itemsize = self->descr->elsize;\n inter->flags = self->flags;\n /* reset unused flags */\n\tinter->flags &= ~(UPDATEIFCOPY | OWNDATA); \n\tif (PyArray_ISNOTSWAPPED(self)) inter->flags |= NOTSWAPPED;\n inter->strides = self->strides;\n inter->shape = self->dimensions;\n inter->data = self->data;\n\tPy_INCREF(self);\n return PyCObject_FromVoidPtrAndDesc(inter, self, gentype_struct_free);\n}\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n Py_INCREF(self->descr->typeobj);\n return (PyObject *)self->descr->typeobj;\n}\n\n\n\nstatic PyObject *\narray_base_get(PyArrayObject *self)\n{\n\tif (self->base == NULL) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\telse {\n\t\tPy_INCREF(self->base);\n\t\treturn self->base;\n\t}\n}\n\n\nstatic PyObject *\narray_real_get(PyArrayObject *self)\n{\n\tPyArrayObject *ret;\n\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n\t\t\t\t\t\t self->data,\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) return NULL;\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\treturn (PyObject *)ret;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *)self;\n\t}\n}\n\n\nstatic int\narray_real_set(PyArrayObject *self, PyObject *val)\n{\n\tPyArrayObject *ret;\n\tPyArrayObject *new;\n\tint rint;\n\n\tnew = (PyArrayObject *)PyArray_FromAny(val, NULL, 0, 0, 0);\n\tif (new == NULL) return -1;\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n\t\t\t\t\t\t self->data,\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) {Py_DECREF(new); return -1;}\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\tret = self;\n\t}\t\n\trint = PyArray_CopyInto(ret, new);\n\tPy_DECREF(ret);\n\tPy_DECREF(new);\n\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n PyArray_Descr *type;\n\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\ttype = PyArray_DescrFromType(self->descr->type_num - \n\t\t\t\t\t PyArray_NUM_FLOATTYPE);\n\t\tret = (PyArrayObject *)\t\t\t\t\\\n\t\t\tPyArray_NewFromDescr(self->ob_type,\n\t\t\t\t\t type,\n\t\t\t\t\t self->nd,\n\t\t\t\t\t self->dimensions,\n\t\t\t\t\t self->strides,\n\t\t\t\t\t self->data + type->elsize,\n\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) return NULL;\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\treturn (PyObject *) ret;\n\t}\n\telse {\n\t\ttype = self->descr;\n\t\tPy_INCREF(type);\n\t\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t type, \n\t\t\t\t\t\t PyArray_ISFORTRAN(self));\n\t\tret->flags &= ~WRITEABLE;\n\t\treturn (PyObject *)ret;\n\t}\n}\n\nstatic int\narray_imag_set(PyArrayObject *self, PyObject *val)\n{\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tPyArrayObject *ret;\n\t\tPyArrayObject *new;\n\t\tint rint;\n\n\t\tnew = (PyArrayObject *)PyArray_FromAny(val, NULL, 0, 0, 0); \n\t\tif (new == NULL) return -1;\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n \t\t\t\t\t\t self->data +\t\t\\\n\t\t\t\t\t\t (self->descr->elsize >> 1),\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) {\n\t\t\tPy_DECREF(new); \n\t\t\treturn -1;\n\t\t}\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\trint = PyArray_CopyInto(ret, new);\n\t\tPy_DECREF(ret);\t\t\n\t\tPy_DECREF(new);\n\t\treturn rint;\n\t}\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError, \"does not have imaginary \" \\\n\t\t\t\t\"part to set\");\n\t\treturn -1;\n\t}\n}\n\nstatic PyObject *\narray_flat_get(PyArrayObject *self)\n{\n return PyArray_IterNew((PyObject *)self);\n}\n\nstatic int \narray_flat_set(PyArrayObject *self, PyObject *val)\n{\n\tPyObject *arr=NULL;\n\tint retval = -1;\n\tPyArrayIterObject *selfit=NULL, *arrit=NULL;\n\tPyArray_Descr *typecode;\n int swap;\n PyArray_CopySwapFunc *copyswap;\n\n\ttypecode = self->descr;\n\tPy_INCREF(typecode);\n\tarr = PyArray_FromAny(val, typecode, \n\t\t\t 0, 0, FORCECAST | FORTRAN_IF(self));\n\tif (arr == NULL) return -1;\n\tarrit = (PyArrayIterObject *)PyArray_IterNew(arr);\n\tif (arrit == NULL) goto exit;\n\tselfit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\tif (selfit == NULL) goto exit;\n\n swap = PyArray_ISNOTSWAPPED(self) != PyArray_ISNOTSWAPPED(arr);\n copyswap = self->descr->f->copyswap;\n if (PyArray_ISOBJECT(self)) {\n while(selfit->index < selfit->size) {\n Py_XDECREF(*((PyObject **)selfit->dataptr));\n Py_INCREF(*((PyObject **)arrit->dataptr)); \n memmove(selfit->dataptr, arrit->dataptr, \n sizeof(PyObject *));\n PyArray_ITER_NEXT(selfit);\n PyArray_ITER_NEXT(arrit);\n if (arrit->index == arrit->size) \n PyArray_ITER_RESET(arrit);\n }\n retval = 0; \n goto exit;\n }\n\n\twhile(selfit->index < selfit->size) {\n\t\tmemmove(selfit->dataptr, arrit->dataptr, self->descr->elsize);\n copyswap(selfit->dataptr, NULL, swap, self->descr->elsize);\n\t\tPyArray_ITER_NEXT(selfit);\n\t\tPyArray_ITER_NEXT(arrit);\n\t\tif (arrit->index == arrit->size) \n\t\t\tPyArray_ITER_RESET(arrit);\n\t}\n\tretval = 0;\n exit:\n\tPy_XDECREF(selfit);\n\tPy_XDECREF(arrit);\n\tPy_XDECREF(arr);\n\treturn retval;\n}\n\nstatic PyGetSetDef array_getsetlist[] = {\n {\"ndim\", \n\t (getter)array_ndim_get, \n\t NULL, \n\t \"number of array dimensions\"},\n {\"flags\", \n\t (getter)array_flags_get, \n NULL,\n\t \"special dictionary of flags\"},\n {\"shape\", \n\t (getter)array_shape_get, \n\t (setter)array_shape_set, \n\t \"tuple of array dimensions\"},\n {\"strides\", \n\t (getter)array_strides_get, \n\t (setter)array_strides_set,\n\t \"tuple of bytes steps in each dimension\"},\n {\"data\", \n\t (getter)array_data_get, \n\t (setter)array_data_set, \n\t \"pointer to start of data\"},\n {\"itemsize\", \n\t (getter)array_itemsize_get, \n\t NULL,\n\t \"length of one element in bytes\"},\n {\"size\",\n (getter)array_size_get,\n\t NULL,\n \"number of elements in the array\"},\n {\"nbytes\",\n (getter)array_nbytes_get,\n NULL,\n \"number of bytes in the array\"},\n\t{\"base\",\n\t (getter)array_base_get,\n\t NULL,\n\t \"base object\"},\n {\"dtype\", \n\t (getter)array_type_get, \n\t NULL,\n\t \"get array type class\"},\n\t{\"dtypechar\",\n\t (getter)array_typechar_get,\n\t NULL,\n\t \"get array type character code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\n\t{\"dtypedescr\", \n\t (getter)array_descr_get,\n\t (setter)array_descr_set,\n\t \"get(set) data-type-descriptor for array\"},\n {\"real\", \n\t (getter)array_real_get, \n\t (setter)array_real_set, \n\t \"real part of array\"},\n {\"imag\", \n\t (getter)array_imag_get, \n\t (setter)array_imag_set, \n\t \"imaginary part of array\"},\n\t{\"flat\", \n\t (getter)array_flat_get, \n\t (setter)array_flat_set, \n\t \"a 1-d view of a contiguous array\"}, \n\t{\"__array_data__\", \n\t (getter)array_dataptr_get,\n\t NULL,\n\t \"Array protocol: data\"},\n\t{\"__array_typestr__\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"Array protocol: typestr\"},\n\t{\"__array_descr__\",\n\t (getter)array_protocol_descr_get,\n\t NULL,\n\t \"Array protocol: descr\"},\n\t{\"__array_shape__\", \n\t (getter)array_shape_get,\n\t NULL,\n\t \"Array protocol: shape\"},\n\t{\"__array_strides__\",\n\t (getter)array_protocol_strides_get,\n\t NULL,\n\t \"Array protocol: strides\"},\n {\"__array_struct__\",\n (getter)array_struct_get,\n NULL,\n \"Array protocol: struct\"},\n\t{\"__array_priority__\",\n\t (getter)array_priority_get,\n\t NULL,\n\t \"Array priority\"},\n \t{NULL, NULL, NULL, NULL}, /* Sentinel */\n};\n\n/****************** end of attribute get and set routines *******************/\n\n\nstatic PyObject *\narray_alloc(PyTypeObject *type, int nitems)\n{\n PyObject *obj;\n /* nitems will always be 0 */ \n obj = (PyObject *)_pya_malloc(sizeof(PyArrayObject));\n PyObject_Init(obj, type);\n return obj;\n}\n\n\nstatic char Arraytype__doc__[] = \n \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\" of fixed-size items. An associated data-type-descriptor object\\n\"\n\t\" details the data-type in an array (including byteorder and any\\n\"\n\t\" fields). An array can be constructed using the numpy.array\\n\"\n\t\" command. Arrays are sequence, mapping and numeric objects.\\n\"\n\t\" More information is available in the numpy module and by looking\\n\"\n\t\" at the methods and attributes of an array.\\n\\n\"\n\t\" ndarray.__new__(subtype, shape=, dtype=int_, buffer=None, \\n\"\n\t\" offset=0, strides=None, fortran=False)\\n\\n\"\n\t\" There are two modes of creating an array using __new__:\\n\"\n\t\" 1) If buffer is None, then only shape, dtype, and fortran \\n\"\n\t\" are used\\n\"\n\t\" 2) If buffer is an object exporting the buffer interface, then\\n\"\n\t\" all keywords are interpreted.\\n\"\n\t\" The dtype parameter can be any object that can be interpreted \\n\"\n\t\" as a numpy.dtypedescr object.\\n\\n\"\n\t\" No __init__ method is needed because the array is fully \\n\"\n\t\" initialized after the __new__ method.\";\n\t\nstatic PyTypeObject PyBigArray_Type = { \n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /*ob_size*/\n \"numpy.bigndarray\",\t\t /*tp_name*/\n sizeof(PyArrayObject),\t\t /*tp_basicsize*/\n 0,\t\t\t\t\t /*tp_itemsize*/\n /* methods */\n (destructor)array_dealloc,\t\t /*tp_dealloc */\n (printfunc)NULL,\t\t\t /*tp_print*/\n 0,\t\t\t\t\t /*tp_getattr*/\n 0,\t\t\t\t\t /*tp_setattr*/\n (cmpfunc)0, \t\t /*tp_compare*/\n (reprfunc)array_repr,\t\t /*tp_repr*/\n &array_as_number,\t\t\t /*tp_as_number*/\n NULL, \t\t\t /*tp_as_sequence*/\n &array_as_mapping,\t\t\t /*tp_as_mapping*/\n (hashfunc)0,\t\t\t /*tp_hash*/\n (ternaryfunc)0,\t\t\t /*tp_call*/\n (reprfunc)array_str, \t /*tp_str*/\n\t\t\n (getattrofunc)0,\t\t\t /*tp_getattro*/\n (setattrofunc)0,\t\t\t /*tp_setattro*/\n NULL, \t /*tp_as_buffer*/\n (Py_TPFLAGS_DEFAULT \n | Py_TPFLAGS_BASETYPE\n | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/\n /*Documentation string */\n Arraytype__doc__,\t\t\t /*tp_doc*/\n\n (traverseproc)0,\t\t\t /*tp_traverse */\n (inquiry)0,\t\t\t /*tp_clear */\n (richcmpfunc)array_richcompare,\t \n offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */\n\n /* Iterator support (use standard) */\n\n (getiterfunc)array_iter, \t /* tp_iter */\n (iternextfunc)0,\t\t\t /* tp_iternext */\n\n /* Sub-classing (new-style object) support */\n\n array_methods,\t\t\t /* tp_methods */\n 0,\t\t\t\t\t /* tp_members */\n array_getsetlist,\t\t /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n array_alloc,\t /* tp_alloc */ \n (newfunc)array_new,\t\t /* tp_new */\n _pya_free, \t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n\n/* A standard array will subclass from the Big Array and \n add the array_as_sequence table\n and the array_as_buffer table\n */\n\nstatic PyTypeObject PyArray_Type = { \n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /*ob_size*/\n \"numpy.ndarray\",\t\t\t /*tp_name*/\n sizeof(PyArrayObject),\t\t /*tp_basicsize*/\n 0,\t\t\t\t\t /*tp_itemsize*/\n};\n\n\n/* The rest of this code is to build the right kind of array from a python */\n/* object. */\n\nstatic int \ndiscover_depth(PyObject *s, int max, int stop_at_string, int stop_at_tuple) \n{\n int d=0;\n PyObject *e;\n\t\n if(max < 1) return -1;\n\n if(! PySequence_Check(s) || PyInstance_Check(s) || \\\n\t PySequence_Length(s) < 0) {\n PyErr_Clear(); return 0;\n }\n if (PyArray_Check(s))\n\t\treturn PyArray_NDIM(s);\n if(PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s))\n\t\treturn stop_at_string ? 0:1;\n\tif (stop_at_tuple && PyTuple_Check(s)) return 0;\n\tif ((e=PyObject_GetAttrString(s, \"__array_shape__\")) != NULL) {\n\t\tif (PyTuple_Check(e)) d=PyTuple_GET_SIZE(e);\n\t\telse d=-1;\n\t\tPy_DECREF(e);\n\t\tif (d>-1) return d;\n\t}\n\telse PyErr_Clear();\n\n if (PySequence_Length(s) == 0) \n\t\treturn 1;\t\n if ((e=PySequence_GetItem(s,0)) == NULL) return -1;\n if(e!=s) {\n\t\td=discover_depth(e, max-1, stop_at_string, stop_at_tuple);\n\t\tif(d >= 0) d++;\n\t}\n Py_DECREF(e);\n return d;\n}\n\nstatic int\ndiscover_itemsize(PyObject *s, int nd, int *itemsize) \n{\n\tint n, r, i;\n\tPyObject *e;\n\t\n\tn = PyObject_Length(s);\n\n\tif ((nd == 0) || PyString_Check(s) ||\t\t\\\n\t PyUnicode_Check(s) || PyBuffer_Check(s)) {\n\t\tif PyUnicode_Check(s) \n\t\t\t*itemsize = MAX(*itemsize, sizeof(Py_UNICODE)*n);\n\t\telse\n\t\t\t*itemsize = MAX(*itemsize, n);\n\t\treturn 0;\n\t}\n\tfor (i=0; i n_lower) n_lower = d[1];\n }\n d[1] = n_lower;\n\t\n return 0;\n}\n\n/* new reference */\n/* doesn't alter refcount of chktype or mintype --- \n unless one of them is returned */\nstatic PyArray_Descr *\n_array_small_type(PyArray_Descr *chktype, PyArray_Descr* mintype)\n{\n\tPyArray_Descr *outtype;\n\n\tif (chktype->type_num > mintype->type_num) outtype = chktype;\n\telse outtype = mintype;\n\n\tPy_INCREF(outtype);\n\tif (PyTypeNum_ISEXTENDED(outtype->type_num) &&\t\t\\\n\t (PyTypeNum_ISEXTENDED(mintype->type_num) ||\t\t\\\n\t mintype->type_num==0)) {\n\t\tint testsize = outtype->elsize;\n\t\tregister int chksize, minsize;\n\t\tchksize = chktype->elsize;\n\t\tminsize = mintype->elsize;\n\t\t/* Handle string->unicode case separately \n\t\t because string itemsize is twice as large */\n\t\tif (outtype->type_num == PyArray_UNICODE && \n\t\t mintype->type_num == PyArray_STRING) {\n\t\t\ttestsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\ttestsize = MAX(chksize, minsize);\n\t\t}\n\t\tif (testsize != outtype->elsize) {\n\t\t\tPyArray_DESCR_REPLACE(outtype);\n\t\t\touttype->elsize = testsize;\n\t\t\tPy_XDECREF(outtype->fields);\n\t\t\touttype->fields = NULL;\n\t\t}\n\t}\n\treturn outtype;\n}\n\n/* op is an object to be converted to an ndarray. \n\n minitype is the minimum type-descriptor needed. \n \n max is the maximum number of dimensions -- used for recursive call\n to avoid infinite recursion...\n \n*/\n\nstatic PyArray_Descr *\n_array_find_type(PyObject *op, PyArray_Descr *minitype, int max)\n{\n int l;\n PyObject *ip;\n\tPyArray_Descr *chktype=NULL;\n\tPyArray_Descr *outtype;\n\t\n\tif (minitype == NULL) \n\t\tminitype = PyArray_DescrFromType(PyArray_BOOL);\n\telse Py_INCREF(minitype);\n\t\n if (max < 0) goto deflt;\n\t\n if (PyArray_Check(op)) {\n\t\tchktype = PyArray_DESCR(op);\n\t\tPy_INCREF(chktype);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tchktype = PyArray_DescrFromScalar(op);\n\t\tgoto finish;\n\t}\n\n\tif ((ip=PyObject_GetAttrString(op, \"__array_typestr__\"))!=NULL) {\n\t\tif (PyString_Check(ip)) {\n\t\t\tchktype =_array_typedescr_fromstr(PyString_AS_STRING(ip));\n\t\t}\n\t\tPy_DECREF(ip);\n if (chktype) goto finish;\n\t}\n\telse PyErr_Clear();\n \n if ((ip=PyObject_GetAttrString(op, \"__array_struct__\")) != NULL) {\n PyArrayInterface *inter;\n char buf[40];\n if (PyCObject_Check(ip)) {\n inter=(PyArrayInterface *)PyCObject_AsVoidPtr(ip);\n if (inter->version == 2) {\n snprintf(buf, 40, \"|%c%d\", inter->typekind, \n\t\t\t\t\t inter->itemsize);\n\t\t\t\tchktype = _array_typedescr_fromstr(buf);\n }\n }\n Py_DECREF(ip);\n if (chktype) goto finish;\n }\n\telse PyErr_Clear();\n \t\n if (PyString_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_STRING);\n\t\tchktype->elsize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_UNICODE);\n\t\tchktype->elsize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_VOID);\n\t\tchktype->elsize = op->ob_type->tp_as_sequence->sq_length(op);\n PyErr_Clear();\n\t\tgoto finish;\n\t}\n\n if (PyObject_HasAttrString(op, \"__array__\")) {\n ip = PyObject_CallMethod(op, \"__array__\", NULL);\n if(ip && PyArray_Check(ip)) {\n\t\t\tchktype = PyArray_DESCR(ip);\n\t\t\tPy_INCREF(chktype);\n Py_DECREF(ip);\n\t\t\tgoto finish;\n\t\t}\n Py_XDECREF(ip);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n } \n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n if (PySequence_Check(op)) {\n\n l = PyObject_Length(op);\n if (l < 0 && PyErr_Occurred()) { \n\t\t\tPyErr_Clear(); \n\t\t\tgoto deflt;\n\t\t}\n if (l == 0 && minitype->type_num == PyArray_BOOL) {\n\t\t\tPy_DECREF(minitype);\n\t\t\tminitype = PyArray_DescrFromType(PyArray_INTP);\n\t\t}\n while (--l >= 0) {\n\t\t\tPyArray_Descr *newtype;\n ip = PySequence_GetItem(op, l);\n if (ip==NULL) {\n\t\t\t\tPyErr_Clear(); \n\t\t\t\tgoto deflt;\n\t\t\t}\n\t\t\tchktype = _array_find_type(ip, minitype, max-1);\n\t\t\tnewtype = _array_small_type(chktype, minitype);\n\t\t\tPy_DECREF(minitype);\n\t\t\tminitype = newtype;\n\t\t\tPy_DECREF(chktype);\n Py_DECREF(ip);\n }\n\t\tchktype = minitype;\n\t\tPy_INCREF(minitype);\n\t\tgoto finish;\n }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_BOOL);\n\t\tgoto finish;\t\t\n\t}\n else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_LONG);\n\t\tgoto finish;\n } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_DOUBLE);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_CDOUBLE);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_DescrFromType(PyArray_OBJECT);\n\t\n finish:\n\t\n\touttype = _array_small_type(chktype, minitype);\n\tPy_DECREF(chktype);\n\tPy_DECREF(minitype);\n\treturn outtype; \n}\n\nstatic int \nAssign_Array(PyArrayObject *self, PyObject *v) \n{\n PyObject *e;\n int l, r;\n\t\n if (!PySequence_Check(v)) {\n PyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"assignment from non-sequence\");\n return -1;\n }\n\t\n l=PyObject_Length(v);\n if(l < 0) return -1; \n\t\n while(--l >= 0)\n {\n e=PySequence_GetItem(v,l);\n if (e == NULL) return -1; \n\t\t\tr = PySequence_SetItem((PyObject*)self,l,e);\n Py_DECREF(e);\n if(r == -1) return -1;\n }\n return 0;\n}\n\n/* \"Array Scalars don't call this code\" */ \n/* steals reference to typecode -- no NULL*/\nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Descr *typecode) \n{\n PyArrayObject *ret;\n\tint itemsize; \n\tint type;\n\t\n\titemsize = typecode->elsize;\n\ttype = typecode->type_num;\n\n\tif (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) {\n\t\titemsize = PyObject_Length(op);\n\t\tif (type == PyArray_UNICODE) itemsize *= sizeof(Py_UNICODE);\n\t}\n\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, typecode,\n\t\t\t\t\t\t 0, NULL, \n\t\t\t\t\t\t NULL, NULL, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n ret->descr->f->setitem(op, ret->data, ret);\n\t\n if (PyErr_Occurred()) {\n Py_DECREF(ret);\n return NULL;\n } else {\n return (PyObject *)ret;\n }\n}\n\n\n/* steals reference to typecode unless return value is NULL*/\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Descr *typecode, int fortran, \n\t\t int min_depth, int max_depth)\n{\n PyArrayObject *r;\n int nd;\n\tintp d[MAX_DIMS];\n\tint stop_at_string;\n\tint stop_at_tuple;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->elsize;\n\tPyArray_Descr *savetype=typecode;\n\t\n\tstop_at_string = ((type == PyArray_OBJECT) ||\t\\\n\t\t\t (type == PyArray_STRING) ||\t\\\n\t\t\t (type == PyArray_UNICODE) || \\\n\t\t\t (type == PyArray_VOID));\n\n\tstop_at_tuple = (type == PyArray_VOID && ((typecode->fields &&\t\\\n\t\t\t\t\t\t typecode->fields!=Py_None) \\\n\t\t\t\t\t\t || (typecode->subarray)));\n\t\n if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string, \n\t\t\t\t stop_at_tuple)) > 0)) {\n\t\tif (nd==0)\n\t\t\treturn Array_FromScalar(s, typecode);\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"invalid input sequence\");\n return NULL;\n }\n\t\n if ((max_depth && nd > max_depth) ||\t\\\n\t (min_depth && nd < min_depth)) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"invalid number of dimensions\");\n return NULL;\n }\n\t\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\treturn NULL;\n\t\t}\n\t\tif (type == PyArray_UNICODE) itemsize*=sizeof(Py_UNICODE);\n\t}\n\n\tif (itemsize != typecode->elsize) {\n\t\tPyArray_DESCR_REPLACE(typecode);\n\t\ttypecode->elsize = itemsize;\n\t}\n\t\n r=(PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, typecode,\n\t\t\t\t\t nd, d, \n\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t fortran, NULL);\n\t\n if(!r) {Py_XINCREF(savetype); return NULL;}\n if(Assign_Array(r,s) == -1) {\n\t\tPy_XINCREF(savetype);\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n return (PyObject*)r;\n}\n\n\n/*OBJECT_API\n Is the typenum valid?\n*/\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\tint res=TRUE;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) res = FALSE;\n\tPy_DECREF(descr);\n\treturn res;\n}\n\n\n/* If the output is not a CARRAY, then it is buffered also */\n\nstatic int\n_bufferedcast(PyArrayObject *out, PyArrayObject *in)\n{\n\tchar *inbuffer, *bptr, *optr;\n\tchar *outbuffer=NULL;\n\tPyArrayIterObject *it_in=NULL, *it_out=NULL;\n\tregister intp i, index;\n\tintp ncopies = PyArray_SIZE(out) / PyArray_SIZE(in);\n\tint elsize=in->descr->elsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->descr->elsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n PyArray_CopySwapFunc *in_csn;\n PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->f->cast[out->descr->type_num];\n in_csn = in->descr->f->copyswap;\n out_csn = out->descr->f->copyswap;\n\n\t/* If the input or output is STRING, UNICODE, or VOID */\n\t/* then getitem and setitem are used for the cast */\n\t/* and byteswapping is handled by those methods */\n\n\tinswap = !(PyArray_ISFLEXIBLE(in) || PyArray_ISNOTSWAPPED(in));\n\t\n\tinbuffer = PyDataMem_NEW(PyArray_BUFSIZE*elsize);\n\tif (inbuffer == NULL) return -1;\n\tif (PyArray_ISOBJECT(in)) \n\t\tmemset(inbuffer, 0, PyArray_BUFSIZE*elsize);\n\tit_in = (PyArrayIterObject *)PyArray_IterNew((PyObject *)in);\n\tif (it_in == NULL) goto exit;\n\n\tif (obuf) {\n\t\toutswap = !(PyArray_ISFLEXIBLE(out) || \\\n\t\t\t PyArray_ISNOTSWAPPED(out));\n\t\toutbuffer = PyDataMem_NEW(PyArray_BUFSIZE*oelsize);\n\t\tif (outbuffer == NULL) goto exit;\n\t\tif (PyArray_ISOBJECT(out))\n\t\t\tmemset(outbuffer, 0, PyArray_BUFSIZE*oelsize);\n\t\t\n\t\tit_out = (PyArrayIterObject *)PyArray_IterNew((PyObject *)out);\n\t\tif (it_out == NULL) goto exit;\n\n\t\tnels = MIN(nels, PyArray_BUFSIZE);\n\t}\n\t\n\toptr = (obuf) ? outbuffer: out->data;\n\tbptr = inbuffer;\n\tel = 0;\t\n\twhile(ncopies--) {\n\t\tindex = it_in->size;\n\t\tPyArray_ITER_RESET(it_in);\n\t\twhile(index--) {\n in_csn(bptr, it_in->dataptr, inswap, elsize);\n\t\t\tbptr += elsize;\n\t\t\tPyArray_ITER_NEXT(it_in);\n\t\t\tel += 1;\n\t\t\tif ((el == nels) || (index == 0)) {\n\t\t\t\t/* buffer filled, do cast */\n\t\t\t\t\n\t\t\t\tcastfunc(inbuffer, optr, el, in, out);\n\t\t\t\t\n\t\t\t\tif (obuf) {\n\t\t\t\t\t/* Copy from outbuffer to array */\n\t\t\t\t\tfor(i=0; idataptr,\n optr, outswap,\n oelsize);\n\t\t\t\t\t\toptr += oelsize;\n\t\t\t\t\t\tPyArray_ITER_NEXT(it_out);\n\t\t\t\t\t}\n\t\t\t\t\toptr = outbuffer;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\toptr += out->descr->elsize * nels;\n\t\t\t\t}\n\t\t\t\tel = 0;\n\t\t\t\tbptr = inbuffer;\n\t\t\t}\n\t\t}\n\t}\n\tretval = 0;\n exit:\n\tPy_XDECREF(it_in);\n\tPyDataMem_FREE(inbuffer);\n\tPyDataMem_FREE(outbuffer);\t\n\tif (obuf) {\n\t\tPy_XDECREF(it_out);\n\t}\n\treturn retval;\n}\n\n\n/* For backward compatibility */\n\n/* steals reference to at --- cannot be NULL*/\n/*OBJECT_API\n Cast an array using typecode structure.\n*/\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran)\n{\n\tPyObject *out;\n\tint ret;\n\tPyArray_Descr *mpd;\n\n\tmpd = mp->descr;\n\n\tif (((mpd == at) || ((mpd->type_num == at->type_num) &&\t\t\\\n\t\t\t PyArray_EquivByteorders(mpd->byteorder,\\\n\t\t\t\t\t\t at->byteorder) &&\t\\\n\t\t\t ((mpd->elsize == at->elsize) ||\t\t\\\n\t\t\t (at->elsize==0)))) &&\t\t\t\\\n\t PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_DECREF(at);\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->elsize == 0) {\n\t\tPyArray_DESCR_REPLACE(at);\n\t\tif (at == NULL) return NULL;\n\t\tif (mpd->type_num == PyArray_STRING &&\t\\\n\t\t at->type_num == PyArray_UNICODE)\n\t\t\tat->elsize = mpd->elsize*sizeof(Py_UNICODE);\n\t\tif (mpd->type_num == PyArray_UNICODE &&\n\t\t at->type_num == PyArray_STRING) \n\t\t\tat->elsize = mpd->elsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->elsize = mpd->elsize;\n\t}\n\n\tout = PyArray_NewFromDescr(mp->ob_type, at,\n\t\t\t\t mp->nd, \n\t\t\t\t mp->dimensions, \n\t\t\t\t NULL, NULL, \n\t\t\t\t fortran,\n\t\t\t\t (PyObject *)mp);\n\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\t\n\tPy_DECREF(out);\n\treturn NULL;\n\t\n}\n\t \n/* The number of elements in out must be an integer multiple\n of the number of elements in mp. \n*/\n\n/*OBJECT_API\n Cast to an already created array.\n*/\nstatic int\nPyArray_CastTo(PyArrayObject *out, PyArrayObject *mp)\n{\n\n\tint simple;\n\tintp mpsize = PyArray_SIZE(mp);\n\tintp outsize = PyArray_SIZE(out);\n\n\tif (mpsize == 0) return 0;\n\tif (!PyArray_ISWRITEABLE(out)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"output array is not writeable\");\n\t\treturn -1;\n\t}\n\tif (outsize % mpsize != 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"output array must have an integer-multiple\"\\\n\t\t\t\t\" of the number of elements in the input \"\\\n\t\t\t\t\"array\");\n\t\treturn -1; \n\t}\n\n\tif (out->descr->type_num >= PyArray_NTYPES) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Can only cast to builtin types.\");\n\t\treturn -1;\n\t\t\t\t\n\t}\n\n\tsimple = ((PyArray_ISCARRAY_RO(mp) && PyArray_ISCARRAY(out)) || \\\n (PyArray_ISFARRAY_RO(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->descr->elsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->f->cast[out->descr->type_num](inptr, \n\t\t\t\t\t\t\t optr,\n\t\t\t\t\t\t\t mpsize,\n\t\t\t\t\t\t\t mp, out);\n\t\t\toptr += obytes;\n\t\t}\n\t\treturn 0;\n\t}\n\t\n\t/* If not a well-behaved cast, then use buffers */\n\tif (_bufferedcast(out, mp) == -1) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n/* steals reference to newtype --- acc. NULL */\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Descr *newtype, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type, itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Descr *oldtype;\n\tchar *msg = \"cannot copy back to a read-only array\";\n PyTypeObject *subtype;\n\n\toldtype = PyArray_DESCR(arr);\n\n subtype = arr->ob_type;\n\t\n\tif (newtype == NULL) {newtype = oldtype; Py_INCREF(oldtype);}\n\ttype = newtype->type_num;\n\titemsize = newtype->elsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivTypes(oldtype, newtype)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| ((flags & ALIGNED) && (!(arrflags & ALIGNED))) \\\n\t\t\t|| (arr->nd > 1 &&\t\t\t\t\\\n\t\t\t ((flags & FORTRAN) != (arrflags & FORTRAN))) || \\\n\t\t\t((flags & WRITEABLE) && (!(arrflags & WRITEABLE)));\n\t\t\n\t\tif (copy) {\n if ((flags & UPDATEIFCOPY) && \\\n (!PyArray_ISWRITEABLE(arr))) {\n\t\t\t\tPy_DECREF(newtype);\n PyErr_SetString(PyExc_ValueError, msg);\n return NULL;\n }\n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n subtype = &PyArray_Type;\n }\n\t\t\tret = (PyArrayObject *) \\\n\t\t\t\tPyArray_NewFromDescr(subtype, newtype,\n\t\t\t\t\t\t arr->nd, \n\t\t\t\t\t\t arr->dimensions,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t flags & FORTRAN,\n\t\t\t\t\t\t (PyObject *)arr);\n if (ret == NULL) return NULL;\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) \n\t\t\t\t{Py_DECREF(ret); return NULL;}\n\t\t\tif (flags & UPDATEIFCOPY) {\n\t\t\t\tret->flags |= UPDATEIFCOPY;\n\t\t\t\tret->base = (PyObject *)arr;\n PyArray_FLAGS(ret->base) &= ~WRITEABLE;\n\t\t\t\tPy_INCREF(arr);\n\t\t\t}\n\t\t} \n\t\t/* If no copy then just increase the reference\n\t\t count and return the input */\n\t\telse { \n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n\t\t\t\tPy_DECREF(newtype);\n\t\t\t\tPy_INCREF(arr->descr);\n\t\t\t\tret = (PyArrayObject *)\t\t\t\\\n PyArray_NewFromDescr(&PyArray_Type,\n\t\t\t\t\t\t\t arr->descr,\n\t\t\t\t\t\t\t arr->nd,\n\t\t\t\t\t\t\t arr->dimensions,\n\t\t\t\t\t\t\t arr->strides,\n\t\t\t\t\t\t\t arr->data,\n\t\t\t\t\t\t\t arr->flags,NULL);\n if (ret == NULL) return NULL;\n ret->base = (PyObject *)arr;\n }\n else {\n ret = arr;\n }\n\t\t\tPy_INCREF(arr);\n\t\t}\n\t}\n\t\n\t/* The desired output type is different than the input\n\t array type */\n\telse {\n\t\t/* Cast to the desired type if we can do it safely\n\t\t Also cast if source is a ndim-0 array to mimic\n\t\t behavior with Python scalars */\n\t\tif (flags & FORCECAST || PyArray_NDIM(arr)==0 ||\n\t\t PyArray_CanCastTo(oldtype, newtype)) {\n if ((flags & UPDATEIFCOPY) &&\t\t\\\n (!PyArray_ISWRITEABLE(arr))) {\n\t\t\t\tPy_DECREF(newtype);\n PyErr_SetString(PyExc_ValueError, msg);\n return NULL;\n }\n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n subtype = &PyArray_Type;\n }\n ret = (PyArrayObject *)\\\n PyArray_NewFromDescr(subtype, \n\t\t\t\t\t\t newtype, \n\t\t\t\t\t\t arr->nd,\n\t\t\t\t\t\t arr->dimensions, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t flags & FORTRAN,\n\t\t\t\t\t\t (PyObject *)arr);\n if (ret == NULL) return NULL;\n if (PyArray_CastTo(ret, arr) < 0) {\n Py_DECREF(ret);\n return NULL;\n }\n\t\t\tif (flags & UPDATEIFCOPY) {\n\t\t\t\tret->flags |= UPDATEIFCOPY;\n\t\t\t\tret->base = (PyObject *)arr;\n PyArray_FLAGS(ret->base) &= ~WRITEABLE;\n\t\t\t\tPy_INCREF(arr);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"array cannot be safely cast \" \\\n\t\t\t\t\t\"to required type\");\n\t\t\tret = NULL;\n\t\t}\n\t}\n\treturn (PyObject *)ret;\n}\n\n/* new reference */\nstatic PyArray_Descr *\n_array_typedescr_fromstr(char *str)\n{\n\tPyArray_Descr *descr; \n\tint type_num;\n\tchar typechar;\n\tint size;\n\tchar msg[] = \"unsupported typestring\";\n\tint swap;\n\tchar swapchar;\n\n\tswapchar = str[0];\n\tstr += 1;\n\t\n#define _MY_FAIL {\t\t\t\t \\\n\t\tPyErr_SetString(PyExc_ValueError, msg); \\\n\t\treturn NULL;\t\t\t\t\\\n\t}\t\t\n\t\n\ttypechar = str[0];\n\tsize = atoi(str + 1);\n\tswitch (typechar) {\n\tcase 'b':\n\t\tif (size == sizeof(Bool))\n\t\t\ttype_num = PyArray_BOOL;\t \n\t\telse _MY_FAIL \n\t\t\tbreak;\t\t \n\tcase 'u':\n\t\tif (size == sizeof(uintp))\n\t\t\ttype_num = PyArray_UINTP;\n\t\telse if (size == sizeof(char))\n\t\t\ttype_num = PyArray_UBYTE;\n\t\telse if (size == sizeof(short)) \n\t\t\ttype_num = PyArray_USHORT;\n\t\telse if (size == sizeof(ulong)) \n\t\t\ttype_num = PyArray_ULONG;\n\t\telse if (size == sizeof(int)) \n\t\t\ttype_num = PyArray_UINT;\n\t\telse if (size == sizeof(ulonglong))\n\t\t\ttype_num = PyArray_ULONGLONG;\n\t\telse _MY_FAIL\n\t\t\tbreak;\t\t \n\tcase 'i':\n\t\tif (size == sizeof(intp))\n\t\t\ttype_num = PyArray_INTP;\n\t\telse if (size == sizeof(char)) \n\t\t type_num = PyArray_BYTE;\n\t\telse if (size == sizeof(short)) \n\t\t\ttype_num = PyArray_SHORT;\n\t\telse if (size == sizeof(long)) \n\t\t\ttype_num = PyArray_LONG;\n\t\telse if (size == sizeof(int))\n\t\t\ttype_num = PyArray_INT;\n\t\telse if (size == sizeof(longlong))\n\t\t\ttype_num = PyArray_LONGLONG;\n\t\telse _MY_FAIL\n\t\t\tbreak;\t\t \n\tcase 'f':\n\t\tif (size == sizeof(float))\n\t\t\ttype_num = PyArray_FLOAT;\n\t\telse if (size == sizeof(double))\n\t\t\ttype_num = PyArray_DOUBLE;\n\t\telse if (size == sizeof(longdouble))\n\t\t\ttype_num = PyArray_LONGDOUBLE;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'c':\n\t\tif (size == sizeof(float)*2)\n\t\t\ttype_num = PyArray_CFLOAT;\n\t\telse if (size == sizeof(double)*2)\n\t\t\ttype_num = PyArray_CDOUBLE;\n\t\telse if (size == sizeof(longdouble)*2)\n\t\t\ttype_num = PyArray_CLONGDOUBLE;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'O':\n\t\tif (size == sizeof(PyObject *))\n\t\t\ttype_num = PyArray_OBJECT;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'S':\n\t\ttype_num = PyArray_STRING;\n\t\tbreak;\n\tcase 'U':\n\t\ttype_num = PyArray_UNICODE;\n\t\tsize *= sizeof(Py_UNICODE);\n\t\tbreak;\t \n\tcase 'V':\n\t\ttype_num = PyArray_VOID;\n\t\tbreak;\n\tdefault:\n\t\t_MY_FAIL\n\t}\n\t\n#undef _MY_FAIL\n\n descr = PyArray_DescrFromType(type_num);\n if (descr == NULL) return NULL;\n swap = !PyArray_ISNBO(swapchar);\n if (descr->elsize == 0 || swap) {\n\t /* Need to make a new PyArray_Descr */\n\t PyArray_DESCR_REPLACE(descr);\n\t if (descr==NULL) return NULL;\n\t if (descr->elsize == 0)\n\t\t descr->elsize = size;\n\t if (swap) \n\t\t descr->byteorder = swapchar;\n }\n return descr;\n}\n\n/* steals a reference to intype unless NotImplemented */\nstatic PyObject *\narray_fromstructinterface(PyObject *input, PyArray_Descr *intype, int flags)\n{\n\tPyArray_Descr *thetype;\n\tchar buf[40];\n\tPyArrayInterface *inter;\n\tPyObject *attr, *r, *ret;\n\tchar endian = PyArray_NATBYTE;\n \n attr = PyObject_GetAttrString(input, \"__array_struct__\");\n if (attr == NULL) {\n\t\tPyErr_Clear();\n\t\treturn Py_NotImplemented;\n\t}\n if (!PyCObject_Check(attr) || \\\n ((inter=((PyArrayInterface *)\\\n\t\t PyCObject_AsVoidPtr(attr)))->version != 2)) {\n PyErr_SetString(PyExc_ValueError, \"invalid __array_struct__\");\n\t\tPy_XDECREF(intype);\n\t\tPy_DECREF(attr);\n return NULL;\n }\n\tif ((inter->flags & NOTSWAPPED) != NOTSWAPPED) {\n\t\tendian = PyArray_OPPBYTE;\n\t\tinter->flags &= ~NOTSWAPPED;\n\t}\n\n snprintf(buf, 40, \"%c%c%d\", endian, inter->typekind, inter->itemsize);\n if (!(thetype=_array_typedescr_fromstr(buf))) {\n\t\tPy_XDECREF(intype);\n\t\tPy_DECREF(attr);\n return NULL;\n }\n\n r = PyArray_NewFromDescr(&PyArray_Type, thetype,\n\t\t\t\t inter->nd, inter->shape,\n\t\t\t\t inter->strides, inter->data,\n\t\t\t\t inter->flags, NULL);\n\tPy_INCREF(input);\n\tPyArray_BASE(r) = input;\n Py_DECREF(attr);\n PyArray_UpdateFlags((PyArrayObject *)r, UPDATE_ALL_FLAGS);\n ret = array_fromarray((PyArrayObject*)r, intype, flags);\n Py_DECREF(r);\n return ret;\n}\n\n/* steals a reference to intype unless NotImplemented */\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Descr *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n PyObject *tstr=NULL, *shape=NULL; \n\tPyArrayObject *ret=NULL;\n\tPyArray_Descr *type=NULL;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint dataflags = BEHAVED_FLAGS;\n\n\t/* Get the memory from __array_data__ and __array_offset__ */\n\t/* Get the shape */\n\t/* Get the typestring -- ignore array_descr */\n\t/* Get the strides */\n\t\n shape = PyObject_GetAttrString(input, \"__array_shape__\");\n if (shape == NULL) {PyErr_Clear(); return Py_NotImplemented;}\n tstr = PyObject_GetAttrString(input, \"__array_typestr__\");\n if (tstr == NULL) {Py_DECREF(shape); PyErr_Clear(); return Py_NotImplemented;}\n \n\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif ((attr == NULL) || (attr==Py_None) || (!PyTuple_Check(attr))) {\n\t\tif (attr && (attr != Py_None)) item=attr;\n\t\telse item=input;\n\t\tres = PyObject_AsWriteBuffer(item, (void **)&data, \n\t\t\t\t\t &buffer_len);\n\t\tif (res < 0) {\n\t\t\tPyErr_Clear();\n\t\t\tres = PyObject_AsReadBuffer(item, (const void **)&data,\n\t\t\t\t\t\t &buffer_len);\n\t\t\tif (res < 0) goto fail;\n\t\t\tdataflags &= ~WRITEABLE;\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tattr = PyObject_GetAttrString(input, \"__array_offset__\");\n\t\tif (attr) {\n\t\t\tlong num = PyInt_AsLong(attr);\n\t\t\tif (error_converting(num)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\t\"__array_offset__ \"\\\n\t\t\t\t\t\t\"must be an integer\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tdata += num;\n\t\t}\n\t\telse PyErr_Clear();\n\t}\n\telse {\n\t\tif (PyTuple_GET_SIZE(attr) != 2) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_data__ must return \"\t\\\n\t\t\t\t\t\"a 2-tuple with ('data pointer \"\\\n\t\t\t\t\t\"string', read-only flag)\");\n\t\t\tgoto fail;\n\t\t}\n\t\tres = sscanf(PyString_AsString(PyTuple_GET_ITEM(attr,0)),\n\t\t\t \"%p\", (void **)&data);\n\t\tif (res < 1) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_data__ string cannot be \" \\\n\t\t\t\t\t\"converted\");\n\t\t\tgoto fail;\n\t\t}\n\t\tif (PyObject_IsTrue(PyTuple_GET_ITEM(attr,1))) {\n\t\t\tdataflags &= ~WRITEABLE;\n\t\t}\n\t}\n\tPy_XDECREF(attr);\n\tattr = tstr;\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string\");\n\t\tPy_INCREF(attr); /* decref'd twice below */\n\t\tgoto fail;\n\t}\n\ttype = _array_typedescr_fromstr(PyString_AS_STRING(attr)); \n\tPy_DECREF(attr); attr=NULL; tstr=NULL;\n\tif (type==NULL) goto fail;\n\tattr = shape;\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple\");\n\t\tPy_INCREF(attr); /* decref'd twice below */\n\t\tPy_DECREF(type);\n\t\tgoto fail;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; ibase = input;\n \n\tattr = PyObject_GetAttrString(input, \"__array_strides__\");\n\tif (attr != NULL && attr != Py_None) {\n\t\tif (!PyTuple_Check(attr)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_strides__ must be a tuple\");\n\t\t\tPy_DECREF(attr);\n\t\t\tPy_DECREF(ret);\n\t\t\tPy_XDECREF(intype);\n\t\t\treturn NULL;\n\t\t}\n\t\tif (n != PyTuple_GET_SIZE(attr)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"mismatch in length of \"\\\n\t\t\t\t\t\"__array_strides__ and \"\\\n\t\t\t\t\t\"__array_shape__\");\n\t\t\tPy_DECREF(attr);\n\t\t\tPy_DECREF(ret);\n\t\t\tPy_XDECREF(intype);\n\t\t\treturn NULL;\n\t\t}\n\t\tfor (i=0; istrides, strides, n*sizeof(intp));\n\t}\n\telse PyErr_Clear();\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n\n fail:\n\tPy_XDECREF(intype);\n\tPy_XDECREF(attr);\n\tPy_XDECREF(shape);\n\tPy_XDECREF(tstr);\n\treturn NULL;\n}\n\n/* steals a reference to typecode */\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Descr *typecode, int flags) \n{\n PyObject *new, *r;\n\t \n if (typecode == NULL) {\n new = PyObject_CallMethod(op, \"__array__\", NULL);\n } else {\n\t\tPyObject *obj;\n\n\t\tif (PyTypeNum_ISEXTENDED(typecode->type_num)) {\n\t\t\tobj = PyString_FromFormat(\"%c%d\", typecode->type,\n\t\t\t\t\t\t typecode->elsize);\n\t\t}\n\t\telse { \n\t\t\tobj = (PyObject *)(typecode->typeobj); Py_INCREF(obj);\n\t\t}\n\t\tnew = PyObject_CallMethod(op, \"__array__\", \"N\", obj);\n }\n if (new == NULL) {Py_XDECREF(typecode); return NULL;}\n if (!PyArray_Check(new)) {\n PyErr_SetString(PyExc_ValueError, \n \"object __array__ method not \" \\\n \"producing an array\");\n Py_DECREF(new);\n\t\tPy_DECREF(typecode);\n return NULL;\n }\n r = array_fromarray((PyArrayObject *)new, typecode, flags);\n Py_DECREF(new);\n return r;\n} \n\n/* Steals a reference to newtype --- which can be NULL */\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Descr *newtype, int min_depth, \n\t\t int max_depth, int flags) \n{\n /* This is the main code to make a NumPy array from a Python\n Object. It is called from lot's of different places which\n is why there are so many checks. The comments try to\n explain some of the checks. */\n\n PyObject *r=NULL;\n int seq = FALSE;\n\n\t/* Is input object already an array? */\n\t/* This is where the flags are used */\n if (PyArray_Check(op)) \n\t\tr = array_fromarray((PyArrayObject *)op, newtype, flags);\n\telse if (PyArray_IsScalar(op, Generic)) {\n\t\tr = PyArray_FromScalar(op, newtype);\n\t}\n else if ((r = array_fromstructinterface(op, newtype, flags)) != \\\n\t\t Py_NotImplemented) {\n }\n else if ((r = array_frominterface(op, newtype, flags)) !=\t\\\n\t\t Py_NotImplemented) {\n\t}\n else if (PyObject_HasAttrString(op, \"__array__\")) {\n /* Code that returns the object to convert for a non\n\t\t multiarray input object from the __array__ attribute of the\n\t\t object. */\n r = array_fromattr(op, newtype, flags);\n }\n\telse {\n\t\tif (newtype == NULL) {\n\t\t\tnewtype = _array_find_type(op, NULL, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op)) {\n\t\t\t/* necessary but not sufficient */\n\t\t\t\n\t\t\tr = Array_FromSequence(op, newtype, flags & FORTRAN,\n\t\t\t\t\t min_depth, max_depth);\n\t\t\tif (PyErr_Occurred() && r == NULL)\n /* It wasn't really a sequence after all.\n * Try interpreting it as a scalar */\n PyErr_Clear();\n else\n seq = TRUE;\n }\n if (!seq)\n\t\t\tr = Array_FromScalar(op, newtype);\n\t}\n\n /* If we didn't succeed return NULL */\n if (r == NULL) return NULL;\n\t\n\t/* Be sure we succeed here */\n\t\n if(!PyArray_Check(r)) {\n PyErr_SetString(PyExc_RuntimeError, \n\t\t\t\t\"internal error: array_fromobject \"\\\n\t\t\t\t\"not producing an array\");\n\t\tPy_DECREF(r);\n return NULL;\n }\n\n if (min_depth != 0 && ((PyArrayObject *)r)->nd < min_depth) {\n PyErr_SetString(PyExc_ValueError, \n \"object of too small depth for desired array\");\n Py_DECREF(r);\n return NULL;\n }\n if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n PyErr_SetString(PyExc_ValueError, \n \"object too deep for desired array\");\n Py_DECREF(r);\n return NULL;\n }\n return r;\n}\n\n/* new reference -- accepts NULL for mintype*/\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrFromObject(PyObject *op, PyArray_Descr *mintype)\n{\n\treturn _array_find_type(op, mintype, MAX_DIMS);\n}\n\n/*OBJECT_API\n Return the typecode of the array a Python object would be converted\n to\n*/\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Descr *intype;\n\tPyArray_Descr *outtype;\n\tint ret;\n\n\tintype = PyArray_DescrFromType(minimum_type);\n\tif (intype == NULL) PyErr_Clear();\n\touttype = _array_find_type(op, intype, MAX_DIMS);\n\tret = outtype->type_num;\n\tPy_DECREF(outtype);\n\tPy_DECREF(intype);\n\treturn ret;\n}\n\n\n/* flags is any of \n CONTIGUOUS, \n FORTRAN,\n ALIGNED, \n WRITEABLE, \n NOTSWAPPED,\n ENSURECOPY, \n UPDATEIFCOPY,\n FORCECAST,\n ENSUREARRAY\n\n or'd (|) together\n\n Any of these flags present means that the returned array should \n guarantee that aspect of the array. Otherwise the returned array\n won't guarantee it -- it will depend on the object as to whether or \n not it has such features. \n\n Note that ENSURECOPY is enough\n to guarantee CONTIGUOUS, ALIGNED and WRITEABLE\n and therefore it is redundant to include those as well. \n\n BEHAVED_FLAGS == ALIGNED | WRITEABLE\n CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n \n FORTRAN can be set in the FLAGS to request a FORTRAN array. \n Fortran arrays are always behaved (aligned, \n notswapped, and writeable) and not (C) CONTIGUOUS (if > 1d). \n\n UPDATEIFCOPY flag sets this flag in the returned array if a copy is\n made and the base argument points to the (possibly) misbehaved array.\n When the new array is deallocated, the original array held in base\n is updated with the contents of the new array. \n\n FORCECAST will cause a cast to occur regardless of whether or not\n it is safe. \n*/\n\n\n/* steals a reference to descr -- accepts NULL */\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Descr *descr, int min_depth, \n\t\tint max_depth, int requires) \n{\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\tif (requires & NOTSWAPPED) {\n\t\tif (!descr && PyArray_Check(op) && \\\n\t\t !PyArray_ISNBO(PyArray_DESCR(op)->byteorder)) {\n\t\t\tdescr = PyArray_DescrNew(PyArray_DESCR(op));\n\t\t}\n\t\telse if ((descr && !PyArray_ISNBO(descr->byteorder))) {\n\t\t\tPyArray_DESCR_REPLACE(descr);\n\t\t}\n\t\tdescr->byteorder = PyArray_NATIVE;\n\t}\n\n\treturn array_fromobject(op, descr, min_depth, max_depth,\n \t\t\t\trequires);\t\n}\n\n/* This is a quick wrapper around PyArray_FromAny(op, NULL, 0, 0, \n ENSUREARRAY) */\n/* that special cases Arrays and PyArray_Scalars up front */\n/* It *steals a reference* to the object */\n/* It also guarantees that the result is PyArray_Type or PyBigArray_Type */\n\n/* Because it decrefs op if any conversion needs to take place \n so it can be used like PyArray_EnsureArray(some_function(...)) */\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_EnsureArray(PyObject *op)\n{\n PyObject *new;\n\n if (op == NULL) return NULL;\n\n if (PyArray_CheckExact(op) || PyBigArray_CheckExact(op)) return op;\n \n if (PyArray_IsScalar(op, Generic)) {\n new = PyArray_FromScalar(op, NULL);\n Py_DECREF(op);\n return new;\n }\n new = PyArray_FROM_OF(op, ENSUREARRAY);\n Py_DECREF(op);\n return new;\n}\n\n\n\n/*OBJECT_API\n Check the type coercion rules.\n*/\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\n\tregister int felsize, telsize;\n\n if (fromtype == totype) return 1;\n if (fromtype == PyArray_BOOL) return 1;\n\tif (totype == PyArray_BOOL) return 0;\n if (totype == PyArray_OBJECT || totype == PyArray_VOID) return 1;\n\tif (fromtype == PyArray_OBJECT || fromtype == PyArray_VOID) return 0;\n\n\tfrom = PyArray_DescrFromType(fromtype);\n\tto = PyArray_DescrFromType(totype);\n\ttelsize = to->elsize;\n\tfelsize = from->elsize;\n\tPy_DECREF(from);\n\tPy_DECREF(to);\n\n switch(fromtype) {\n case PyArray_BYTE:\n\tcase PyArray_SHORT:\n case PyArray_INT:\n case PyArray_LONG:\n\tcase PyArray_LONGLONG:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n\t\t\t\treturn (telsize > felsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (telsize >= felsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n if (felsize < 8)\n return (telsize > felsize);\n else\n return (telsize >= felsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n if (felsize < 8)\n return ((telsize >> 1) > felsize);\n else\n return ((telsize >> 1) >= felsize);\n\t\t}\n\t\telse return totype > fromtype;\n case PyArray_UBYTE:\n case PyArray_USHORT:\n case PyArray_UINT:\n\tcase PyArray_ULONG:\n\tcase PyArray_ULONGLONG:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n\t\t\t\treturn (telsize > felsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (telsize >= felsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n if (felsize < 8)\n return (telsize > felsize);\n else\n return (telsize >= felsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n if (felsize < 8)\n return ((telsize >> 1) > felsize);\n else\n return ((telsize >> 1) >= felsize);\n\t\t}\n\t\telse return totype > fromtype;\n case PyArray_FLOAT:\n case PyArray_DOUBLE:\n\tcase PyArray_LONGDOUBLE:\n\t\tif (PyTypeNum_ISCOMPLEX(totype)) \n\t\t\treturn ((telsize >> 1) >= felsize);\n\t\telse\n\t\t\treturn (totype > fromtype);\n case PyArray_CFLOAT:\n case PyArray_CDOUBLE:\n\tcase PyArray_CLONGDOUBLE:\n\t\treturn (totype > fromtype);\n\tcase PyArray_STRING:\n\tcase PyArray_UNICODE:\n\t\treturn (totype > fromtype);\n default:\n return 0;\n }\n}\n\n/* leaves reference count alone --- cannot be NULL*/\n/*OBJECT_API*/\nstatic Bool\nPyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to)\n{\n\tint fromtype=from->type_num;\n\tint totype=to->type_num;\n\tBool ret;\n\n\tret = (Bool) PyArray_CanCastSafely(fromtype, totype);\n\tif (ret) { /* Check String and Unicode more closely */\n\t\tif (fromtype == PyArray_STRING) {\n\t\t\tif (totype == PyArray_STRING) {\n\t\t\t\tret = (from->elsize <= to->elsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->elsize * sizeof(Py_UNICODE)\\\n\t\t\t\t <= to->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (fromtype == PyArray_UNICODE) {\n\t\t\tif (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->elsize <= to->elsize);\n\t\t\t}\n\t\t}\n\t\t/* TODO: If totype is STRING or unicode \n\t\t see if the length is long enough to hold the\n\t\t stringified value of the object.\t\t \n\t\t*/\n\t}\n\treturn ret;\n}\n\n\n\n/*********************** Element-wise Array Iterator ***********************/\n/* Aided by Peter J. Verveer's nd_image package and numpy's arraymap ****/\n/* and Python's array iterator ***/\n \n\n/*OBJECT_API\n Get Iterator.\n*/\nstatic PyObject *\nPyArray_IterNew(PyObject *obj)\n{\n PyArrayIterObject *it;\n\tint i, nd; \n\tPyArrayObject *ao = (PyArrayObject *)obj;\n\n if (!PyArray_Check(ao)) {\n PyErr_BadInternalCall();\n return NULL;\n }\n\n it = (PyArrayIterObject *)_pya_malloc(sizeof(PyArrayIterObject));\n PyObject_Init((PyObject *)it, &PyArrayIter_Type);\n /* it = PyObject_New(PyArrayIterObject, &PyArrayIter_Type);*/\n if (it == NULL)\n return NULL;\n\n\tnd = ao->nd;\n\tPyArray_UpdateFlags(ao, CONTIGUOUS);\n\tit->contiguous = 0;\n\tif PyArray_ISCONTIGUOUS(ao) it->contiguous = 1;\n Py_INCREF(ao);\n it->ao = ao;\n\tit->size = PyArray_SIZE(ao);\n\tit->nd_m1 = nd - 1;\n\tit->factors[nd-1] = 1;\n\tfor (i=0; i < nd; i++) {\n\t\tit->dims_m1[i] = it->ao->dimensions[i] - 1;\n\t\tit->strides[i] = it->ao->strides[i];\n\t\tit->backstrides[i] = it->strides[i] *\t\\\n\t\t\tit->dims_m1[i];\n\t\tif (i > 0)\n\t\t\tit->factors[nd-i-1] = it->factors[nd-i] *\t\\\n\t\t\t\tit->ao->dimensions[nd-i];\n\t}\n\tPyArray_ITER_RESET(it);\n\t\n return (PyObject *)it;\n}\n\n\n/*OBJECT_API\n Get Iterator that iterates over all but one axis (don't use this with\n PyArray_ITER_GOTO1D) \n*/\nstatic PyObject *\nPyArray_IterAllButAxis(PyObject *obj, int axis)\n{\n\tPyArrayIterObject *it;\n\tit = (PyArrayIterObject *)PyArray_IterNew(obj);\n\tif (it == NULL) return NULL;\n\t\n\t/* adjust so that will not iterate over axis */\n\tit->contiguous = 0;\n\tif (it->size != 0) {\n\t\tit->size /= PyArray_DIM(obj,axis);\n\t}\n\tit->dims_m1[axis] = 0;\n\tit->backstrides[axis] = 0;\n\t\n\t/* (won't fix factors so don't use\n\t PyArray_ITER_GOTO1D with this iterator) */\n\treturn (PyObject *)it;\n}\n\n/* Returns an array scalar holding the element desired */\n\nstatic PyObject *\narrayiter_next(PyArrayIterObject *it)\n{\n\tPyObject *ret;\n\n\tif (it->index < it->size) {\n\t\tret = PyArray_ToScalar(it->dataptr, it->ao);\n\t\tPyArray_ITER_NEXT(it);\n\t\treturn ret;\n\t}\n return NULL;\n}\n\nstatic void\narrayiter_dealloc(PyArrayIterObject *it)\n{\n Py_XDECREF(it->ao);\n _pya_free(it);\n}\n\nstatic int\niter_length(PyArrayIterObject *self) \n{\n return (int) self->size;\n}\n\n\nstatic PyObject *\niter_subscript_Bool(PyArrayIterObject *self, PyArrayObject *ind)\n{\n\tint index, strides, itemsize;\n\tintp count=0;\n\tchar *dptr, *optr;\n\tPyObject *r;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\n\tif (ind->nd != 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"boolean index array should have 1 dimension\");\n\t\treturn NULL;\n\t}\n\tindex = (ind->dimensions[0]);\n\tstrides = ind->strides[0];\n\tdptr = ind->data;\n\t/* Get size of return array */\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0)\n\t\t\tcount++;\n\t\tdptr += strides;\n\t}\n\titemsize = self->ao->descr->elsize;\n\tPy_INCREF(self->ao->descr);\n\tr = PyArray_NewFromDescr(self->ao->ob_type,\n\t\t\t\t self->ao->descr, 1, &count, \n\t\t\t\t NULL, NULL,\n\t\t\t\t 0, (PyObject *)self->ao);\n\tif (r==NULL) return NULL;\n\n\t/* Set up loop */\n\toptr = PyArray_DATA(r);\n\tindex = ind->dimensions[0];\n\tdptr = ind->data;\n\n copyswap = self->ao->descr->f->copyswap;\n\t/* Loop over Boolean array */\n\tswap = !(PyArray_ISNOTSWAPPED(self->ao));\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n copyswap(optr, self->dataptr, swap, itemsize);\n\t\t\toptr += itemsize;\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t}\n\tPyArray_ITER_RESET(self);\n\treturn r;\n}\n\nstatic PyObject *\niter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)\n{\n\tintp num;\n\tPyObject *r;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint swap;\n\tchar *optr;\n\tint index;\n PyArray_CopySwapFunc *copyswap;\n\n\titemsize = self->ao->descr->elsize;\n\tif (ind->nd == 0) {\n\t\tnum = *((intp *)ind->data);\n\t\tPyArray_ITER_GOTO1D(self, num);\n\t\tr = PyArray_ToScalar(self->dataptr, self->ao);\n\t\tPyArray_ITER_RESET(self);\n\t\treturn r;\n\t}\n\t\n\tPy_INCREF(self->ao->descr);\n\tr = PyArray_NewFromDescr(self->ao->ob_type, self->ao->descr, \n\t\t\t\t ind->nd, ind->dimensions,\n\t\t\t\t NULL, NULL, \n\t\t\t\t 0, (PyObject *)self->ao);\n\tif (r==NULL) return NULL;\n\n\toptr = PyArray_DATA(r);\n\tind_it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ind);\n\tif (ind_it == NULL) {Py_DECREF(r); return NULL;}\n\tindex = ind_it->size;\n copyswap = PyArray_DESCR(r)->f->copyswap;\n swap = !PyArray_ISNOTSWAPPED(self->ao);\n\twhile(index--) {\n\t\tnum = *((intp *)(ind_it->dataptr));\n\t\tif (num < 0) num += self->size;\n\t\tif (num < 0 || num >= self->size) {\n\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t \"index %d out of bounds\"\t\t\\\n\t\t\t\t \" 0<=index<%d\", (int) num, \n\t\t\t\t (int) self->size);\n\t\t\tPy_DECREF(ind_it);\n\t\t\tPy_DECREF(r);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(optr, self->dataptr, swap, itemsize);\n\t\toptr += itemsize;\n\t\tPyArray_ITER_NEXT(ind_it);\n\t}\n\tPy_DECREF(ind_it);\n\tPyArray_ITER_RESET(self);\n\treturn r;\n}\n\n\nstatic PyObject *\niter_subscript(PyArrayIterObject *self, PyObject *ind)\n{\n\tPyArray_Descr *indtype=NULL;\n\tintp start, step_size;\n\tintp n_steps;\n\tPyObject *r;\n\tchar *dptr;\n\tint size;\n\tPyObject *obj = NULL;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\tobj = iter_subscript(self, ind);\n\t\tPy_DECREF(ind);\n\t\treturn obj;\n\t}\n\tif (PyTuple_Check(ind)) {\n\t\tint len;\n\t\tlen = PyTuple_GET_SIZE(ind);\n\t\tif (len > 1) goto fail;\n\t\tind = PyTuple_GET_ITEM(ind, 0);\n\t}\n\n\t/* Tuples >1d not accepted --- i.e. no NewAxis */\n\t/* Could implement this with adjusted strides\n\t and dimensions in iterator */\n\n\t/* Check for Boolean -- this is first becasue\n\t Bool is a subclass of Int */\n\tPyArray_ITER_RESET(self);\n\n\tif (PyBool_Check(ind)) {\n\t\tif (PyObject_IsTrue(ind)) {\n\t\t\treturn PyArray_ToScalar(self->dataptr, self->ao);\n\t\t}\n\t\telse { /* empty array */\n\t\t\tintp ii = 0;\n\t\t\tPy_INCREF(self->ao->descr);\n\t\t\tr = PyArray_NewFromDescr(self->ao->ob_type, \n\t\t\t\t\t\t self->ao->descr,\n\t\t\t\t\t\t 1, &ii, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)self->ao);\n\t\t\treturn r;\t\t\t\n\t\t}\n\t}\n\n\t/* Check for Integer or Slice */ \t\n\t\n\tif (PyLong_Check(ind) || PyInt_Check(ind) || PySlice_Check(ind)) {\n\t\tstart = parse_subindex(ind, &step_size, &n_steps, \n\t\t\t\t self->size);\n\t\tif (start == -1) \n\t\t\tgoto fail;\n\t\tif (n_steps == RubberIndex || n_steps == PseudoIndex) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"cannot use Ellipsis or NewAxes here\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, start)\n\t\tif (n_steps == SingleIndex) { /* Integer */\n\t\t\tr = PyArray_ToScalar(self->dataptr, self->ao);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\treturn r;\n\t\t}\n\t\tsize = self->ao->descr->elsize;\n\t\tPy_INCREF(self->ao->descr);\n\t\tr = PyArray_NewFromDescr(self->ao->ob_type, \n\t\t\t\t\t self->ao->descr, \n\t\t\t\t\t 1, &n_steps, \n\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t 0, (PyObject *)self->ao);\n\t\tif (r==NULL) goto fail; \n\t\tdptr = PyArray_DATA(r);\n swap = !PyArray_ISNOTSWAPPED(self->ao);\n copyswap = PyArray_DESCR(r)->f->copyswap;\n\t\twhile(n_steps--) {\n copyswap(dptr, self->dataptr, swap, size);\n\t\t\tstart += step_size;\n\t\t\tPyArray_ITER_GOTO1D(self, start)\n\t\t\tdptr += size;\n\t\t}\n\t\tPyArray_ITER_RESET(self);\n\t\treturn r;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromAny(ind, indtype, 0, 0, FORCECAST);\n\t\tif (obj == NULL) goto fail;\n\t}\n\telse {\n\t\tPy_INCREF(ind);\n\t\tobj = ind;\n\t}\n\t\n\tif (PyArray_Check(obj)) {\n\t\t/* Check for Boolean object */\n\t\tif (PyArray_TYPE(obj)==PyArray_BOOL) {\n\t\t\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\n\t\t\tPy_DECREF(indtype);\n\t\t} \n\t\t/* Check for integer array */\n\t\telse if (PyArray_ISINTEGER(obj)) {\n\t\t\tPyObject *new;\n\t\t\tnew = PyArray_FromAny(obj, indtype, 0, 0, \n\t\t\t\t\t FORCECAST | ALIGNED);\n\t\t\tif (new==NULL) goto fail;\n Py_DECREF(obj);\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\telse Py_DECREF(indtype);\n\n\n fail:\n\tif (!PyErr_Occurred())\n\t\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tPy_XDECREF(indtype);\n\tPy_XDECREF(obj);\n\treturn NULL;\n\n}\n\n\nstatic int\niter_ass_sub_Bool(PyArrayIterObject *self, PyArrayObject *ind,\n\t\t PyArrayIterObject *val, int swap)\n{\n\tint index, strides, itemsize;\n\tchar *dptr;\n PyArray_CopySwapFunc *copyswap;\n\n\tif (ind->nd != 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"boolean index array should have 1 dimension\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->descr->elsize;\n\tindex = ind->dimensions[0];\n\tstrides = ind->strides[0];\n\tdptr = ind->data;\n\tPyArray_ITER_RESET(self);\n\t/* Loop over Boolean array */\n copyswap = self->ao->descr->f->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n copyswap(self->dataptr, val->dataptr, swap,\n\t\t\t\t itemsize);\n\t\t\tPyArray_ITER_NEXT(val);\n\t\t\tif (val->index==val->size) \n\t\t\t\tPyArray_ITER_RESET(val);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t}\n\tPyArray_ITER_RESET(self);\n\treturn 0;\n}\n\nstatic int\niter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,\n\t\t PyArrayIterObject *val, int swap)\n{\n\tPyArray_Descr *typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n PyArray_CopySwapFunc *copyswap;\n\n\ttypecode = self->ao->descr;\n\titemsize = typecode->elsize;\n copyswap = self->ao->descr->f->copyswap;\n\tif (ind->nd == 0) {\n\t\tnum = *((intp *)ind->data);\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(self->dataptr, val->dataptr, swap, itemsize);\n\t\treturn 0;\n\t}\n\tind_it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ind);\n\tif (ind_it == NULL) return -1;\n\tindex = ind_it->size;\n\twhile(index--) {\n\t\tnum = *((intp *)(ind_it->dataptr));\n\t\tif (num < 0) num += self->size;\n\t\tif ((num < 0) || (num >= self->size)) {\n\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t \"index %d out of bounds\"\t\t\\\n\t\t\t\t \" 0<=index<%d\", (int) num, \n\t\t\t\t (int) self->size);\n\t\t\tPy_DECREF(ind_it);\n\t\t\treturn -1;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(self->dataptr, val->dataptr, swap, itemsize);\n\t\tPyArray_ITER_NEXT(ind_it);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index == val->size) \n\t\t\tPyArray_ITER_RESET(val);\n\t}\n\tPy_DECREF(ind_it);\n\treturn 0;\n}\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Descr *type;\n\tPyArray_Descr *indtype=NULL;\n\tint swap, retval=-1;\n\tint itemsize;\n\tintp start, step_size;\n\tintp n_steps;\n\tPyObject *obj=NULL;\n PyArray_CopySwapFunc *copyswap;\n\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\tretval = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn retval;\n\t}\n\n\tif (PyTuple_Check(ind)) {\n\t\tint len;\n\t\tlen = PyTuple_GET_SIZE(ind);\n\t\tif (len > 1) goto finish;\n\t\tind = PyTuple_GET_ITEM(ind, 0);\n\t}\n\n\ttype = self->ao->descr;\n\titemsize = type->elsize;\n\t\n\tPy_INCREF(type);\n\tarrval = PyArray_FromAny(val, type, 0, 0, 0);\n\tif (arrval==NULL) return -1;\n\tval_it = (PyArrayIterObject *)PyArray_IterNew(arrval);\n\tif (val_it==NULL) goto finish;\n\n\t/* Check for Boolean -- this is first becasue\n\t Bool is a subclass of Int */\n\n copyswap = PyArray_DESCR(arrval)->f->copyswap;\n\tswap = (PyArray_ISNOTSWAPPED(self->ao)!=PyArray_ISNOTSWAPPED(arrval));\n\tif (PyBool_Check(ind)) {\n\t\tif (PyObject_IsTrue(ind)) {\n copyswap(self->dataptr, PyArray_DATA(arrval), \n swap, itemsize);\n\t\t}\n\t\tretval=0;\n\t\tgoto finish;\n\t}\n\n\t/* Check for Integer or Slice */\n\t\n\tif (PyLong_Check(ind) || PyInt_Check(ind) || PySlice_Check(ind)) {\n\t\tstart = parse_subindex(ind, &step_size, &n_steps, \n\t\t\t\t self->size);\n\t\tif (start == -1) goto finish;\n\t\tif (n_steps == RubberIndex || n_steps == PseudoIndex) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"cannot use Ellipsis or NewAxes here\");\n\t\t\tgoto finish;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, start);\n\t\tif (n_steps == SingleIndex) { /* Integer */\n copyswap(self->dataptr, PyArray_DATA(arrval),\n swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tretval=0;\n\t\t\tgoto finish;\n\t\t}\n\t\twhile(n_steps--) {\n copyswap(self->dataptr, val_it->dataptr,\n swap, itemsize);\n\t\t\tstart += step_size;\n\t\t\tPyArray_ITER_GOTO1D(self, start)\n\t\t\tPyArray_ITER_NEXT(val_it);\n\t\t\tif (val_it->index == val_it->size) \n\t\t\t\tPyArray_ITER_RESET(val_it);\n\t\t}\n\t\tPyArray_ITER_RESET(self);\n\t\tretval = 0;\n\t\tgoto finish;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_IsScalar(ind, Integer)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromScalar(ind, indtype);\n\t}\n\telse if (PyList_Check(ind)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromAny(ind, indtype, 0, 0, FORCECAST);\n\t}\n\telse {\n\t\tPy_INCREF(ind);\n\t\tobj = ind;\n\t}\n\t\n\tif (PyArray_Check(obj)) {\n\t\t/* Check for Boolean object */\n\t\tif (PyArray_TYPE(obj)==PyArray_BOOL) {\n\t\t\tif (iter_ass_sub_Bool(self, (PyArrayObject *)obj,\n\t\t\t\t\t val_it, swap) < 0)\n\t\t\t\tgoto finish;\n\t\t\tretval=0;\n\t\t} \n\t\t/* Check for integer array */\n\t\telse if (PyArray_ISINTEGER(obj)) {\n\t\t\tPyObject *new;\n\t\t\tPy_INCREF(indtype);\n\t\t\tnew = PyArray_FromAny(obj, indtype, 0, 0, \n\t\t\t\t\t FORCECAST | BEHAVED_FLAGS);\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\n\t\t\tif (new==NULL) goto finish;\n\t\t\tif (iter_ass_sub_int(self, (PyArrayObject *)obj,\n\t\t\t\t\t val_it, swap) < 0)\n\t\t\t\tgoto finish;\n\t\t\tretval=0;\n\t\t}\n\t}\n\n finish:\n\tif (!PyErr_Occurred() && retval < 0)\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"unsupported iterator index\");\n\tPy_XDECREF(indtype);\n\tPy_XDECREF(obj);\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn retval;\n\t\n}\n\n\nstatic PyMappingMethods iter_as_mapping = {\n (inquiry)iter_length,\t\t /*mp_length*/\n (binaryfunc)iter_subscript,\t /*mp_subscript*/\n (objobjargproc)iter_ass_subscript,\t/*mp_ass_subscript*/\n};\n\nstatic char doc_iter_array[] = \"__array__(type=None)\\n Get array \"\\\n \"from iterator\";\n\nstatic PyObject *\niter_array(PyArrayIterObject *it, PyObject *op) \n{\n \n PyObject *r;\n intp size;\n\n /* Any argument ignored */\n\n /* Two options: \n 1) underlying array is contiguous\n -- return 1-d wrapper around it \n 2) underlying array is not contiguous\n -- make new 1-d contiguous array with updateifcopy flag set\n to copy back to the old array\n */\n\n size = PyArray_SIZE(it->ao);\n\tPy_INCREF(it->ao->descr);\n if (PyArray_ISCONTIGUOUS(it->ao)) {\n r = PyArray_NewFromDescr(it->ao->ob_type, \n\t\t\t\t\t it->ao->descr,\n\t\t\t\t\t 1, &size, \n\t\t\t\t\t NULL, it->ao->data, \n\t\t\t\t\t it->ao->flags,\n\t\t\t\t\t (PyObject *)it->ao); \n\t\tif (r==NULL) return NULL;\n }\n else {\n r = PyArray_NewFromDescr(it->ao->ob_type, \n\t\t\t\t\t it->ao->descr,\n\t\t\t\t\t 1, &size, \n\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t 0, (PyObject *)it->ao);\n\t\tif (r==NULL) return NULL;\n\t\tif (PyArray_CopyInto((PyArrayObject *)r, it->ao) < 0) {\n\t\t\tPy_DECREF(r); \n\t\t\treturn NULL;\n\t\t}\n PyArray_FLAGS(r) |= UPDATEIFCOPY;\n it->ao->flags &= ~WRITEABLE;\n }\n Py_INCREF(it->ao);\n PyArray_BASE(r) = (PyObject *)it->ao;\n return r;\n \n}\n\nstatic char doc_iter_copy[] = \"copy()\\n Get a copy of 1-d array\";\n\nstatic PyObject *\niter_copy(PyArrayIterObject *it, PyObject *args)\n{\n if (!PyArg_ParseTuple(args, \"\")) return NULL;\t\n\treturn PyArray_Flatten(it->ao, 0);\n}\n\nstatic PyMethodDef iter_methods[] = {\n /* to get array */\n {\"__array__\", (PyCFunction)iter_array, 1, doc_iter_array},\n\t{\"copy\", (PyCFunction)iter_copy, 1, doc_iter_copy},\n {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic PyMemberDef iter_members[] = {\n\t{\"base\", T_OBJECT, offsetof(PyArrayIterObject, ao), RO, NULL},\n\t{NULL},\n};\n\nstatic PyTypeObject PyArrayIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.flatiter\",\t\t /* tp_name */\n sizeof(PyArrayIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arrayiter_dealloc,\t\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, \t\t\t /* tp_as_sequence */\n &iter_as_mapping, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n (iternextfunc)arrayiter_next,\t\t/* tp_iternext */\n iter_methods,\t\t\t\t/* tp_methods */\n iter_members,\t \t /* tp_members */\n 0, /* tp_getset */\n\n};\n\n/** END of Array Iterator **/\n\n\n\n/*********************** Subscript Array Iterator *************************\n * *\n * This object handles subscript behavior for array objects. *\n * It is an iterator object with a next method *\n * It abstracts the n-dimensional mapping behavior to make the looping *\n * code more understandable (maybe) *\n * and so that indexing can be set up ahead of time *\n */ \n\n/* This checks the args for any fancy indexing objects */\n\n#define SOBJ_NOTFANCY 0 \n#define SOBJ_ISFANCY 1\n#define SOBJ_BADARRAY 2\n#define SOBJ_TOOMANY 3\n#define SOBJ_LISTTUP 4\n\nstatic int\nfancy_indexing_check(PyObject *args)\n{\n\tint i, n;\n\tPyObject *obj;\n\tint retval = SOBJ_NOTFANCY;\n\n\tif (PyTuple_Check(args)) {\n\t\tn = PyTuple_GET_SIZE(args);\n\t\tif (n >= MAX_DIMS) return SOBJ_TOOMANY;\n\t\tfor (i=0; i=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i SOBJ_ISFANCY) return retval;\n\t\t}\n\t}\n\n\treturn retval;\n}\n\n/* convert an indexing object to an INTP indexing array iterator\n if possible -- otherwise, it is a Slice or Ellipsis object\n and has to be interpreted on bind to a particular \n array so leave it NULL for now.\n */\nstatic int\n_convert_obj(PyObject *obj, PyArrayIterObject **iter)\n{\n\tPyArray_Descr *indtype;\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\n\t\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\t\tarr = PyArray_FromAny(obj, indtype, 0, 0, FORCECAST);\n\t\tif (arr == NULL) return -1;\n\t\t*iter = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\tPy_DECREF(arr);\n\t\tif (*iter == NULL) return -1;\n\t}\n\treturn 0;\n}\n\n/* Adjust dimensionality and strides for index object iterators \n --- i.e. broadcast\n */\n/*OBJECT_API*/\nstatic int\nPyArray_Broadcast(PyArrayMultiIterObject *mit)\n{\n\tint i, nd, k, j;\n\tintp tmp;\n\tPyArrayIterObject *it;\n\t\n\t/* Discover the broadcast number of dimensions */\n\tfor (i=0, nd=0; inumiter; i++) \n\t\tnd = MAX(nd, mit->iters[i]->ao->nd);\n\tmit->nd = nd;\n\n\t/* Discover the broadcast shape in each dimension */\n\tfor (i=0; idimensions[i] = 1;\n\t\tfor (j=0; jnumiter; j++) {\n\t\t\tit = mit->iters[j];\n\t\t\t/* This prepends 1 to shapes not already \n\t\t\t equal to nd */\n\t\t\tk = i + it->ao->nd - nd;\n\t\t\tif (k>=0) {\n\t\t\t\ttmp = it->ao->dimensions[k];\n\t\t\t\tif (tmp == 1) continue;\n\t\t\t\tif (mit->dimensions[i] == 1) \n\t\t\t\t\tmit->dimensions[i] = tmp;\n\t\t\t\telse if (mit->dimensions[i] != tmp) {\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\t\"index objects are \" \\\n\t\t\t\t\t\t\t\"not broadcastable \" \\\n\t\t\t\t\t\t\t\"to a single shape\");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Reset the iterator dimensions and strides of each iterator\n\t object -- using 0 valued strides for broadcasting */\n\n\ttmp = PyArray_MultiplyList(mit->dimensions, mit->nd);\n\tmit->size = tmp;\n\tfor (i=0; inumiter; i++) {\n\t\tit = mit->iters[i];\n\t\tit->nd_m1 = mit->nd - 1;\n\t\tit->size = tmp;\n\t\tnd = it->ao->nd;\n\t\tit->factors[mit->nd-1] = 1;\n\t\tfor (j=0; j < mit->nd; j++) {\n\t\t\tit->dims_m1[j] = mit->dimensions[j] - 1;\n\t\t\tk = j + nd - mit->nd;\n\t\t\t/* If this dimension was added or shape\n\t\t\t of underlying array was 1 */\n\t\t\tif ((k < 0) || \\\n\t\t\t it->ao->dimensions[k] != mit->dimensions[j]) {\n\t\t\t\tit->contiguous = 0;\n\t\t\t\tit->strides[j] = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tit->strides[j] = it->ao->strides[k];\n\t\t\t}\n\t\t\tit->backstrides[j] = it->strides[j] *\t\\\n\t\t\t\tit->dims_m1[j];\n\t\t\tif (j > 0)\n\t\t\t\tit->factors[mit->nd-j-1] =\t\t\\\n\t\t\t\t\tit->factors[mit->nd-j] *\t\\\n\t\t\t\t\tmit->dimensions[mit->nd-j];\n\t\t}\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn 0;\n}\n\n/* Reset the map iterator to the beginning */\nstatic void\nPyArray_MapIterReset(PyArrayMapIterObject *mit)\n{\n\tint i,j; intp coord[MAX_DIMS];\n\tPyArrayIterObject *it;\n\tPyArray_CopySwapFunc *copyswap;\n\n\tmit->index = 0;\n\n\tcopyswap = mit->iters[0]->ao->descr->f->copyswap;\n\n\tif (mit->subspace != NULL) {\n\t\tmemcpy(coord, mit->bscoord, sizeof(intp)*mit->ait->ao->nd);\n\t\tPyArray_ITER_RESET(mit->subspace);\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_RESET(it);\n\t\t\tj = mit->iteraxes[i];\n\t\t\tcopyswap(coord+j,it->dataptr,\n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->subspace->dataptr = mit->ait->dataptr;\n\t\tmit->dataptr = mit->subspace->dataptr;\n\t}\n\telse {\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_RESET(it);\n\t\t\tcopyswap(coord+i,it->dataptr, \n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->dataptr = mit->ait->dataptr;\n\t}\n\treturn;\n}\n\n/* This function needs to update the state of the map iterator\n and point mit->dataptr to the memory-location of the next object\n*/\nstatic void\nPyArray_MapIterNext(PyArrayMapIterObject *mit)\n{\n\tint i, j;\n\tintp coord[MAX_DIMS];\n\tPyArrayIterObject *it;\n\tPyArray_CopySwapFunc *copyswap;\n\n\tmit->index += 1;\n\tif (mit->index >= mit->size) return;\n\tcopyswap = mit->iters[0]->ao->descr->f->copyswap;\n\t/* Sub-space iteration */\n\tif (mit->subspace != NULL) {\n\t\tPyArray_ITER_NEXT(mit->subspace);\n\t\tif (mit->subspace->index == mit->subspace->size) {\n\t\t\t/* reset coord to coordinates of \n\t\t\t beginning of the subspace */\n\t\t\tmemcpy(coord, mit->bscoord, \n\t\t\t sizeof(intp)*mit->ait->ao->nd);\n\t\t\tPyArray_ITER_RESET(mit->subspace);\n\t\t\tfor (i=0; inumiter; i++) {\n\t\t\t\tit = mit->iters[i];\n\t\t\t\tPyArray_ITER_NEXT(it);\n\t\t\t\tj = mit->iteraxes[i];\n\t\t\t\tcopyswap(coord+j,it->dataptr,\n\t\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t\t sizeof(intp));\n\t\t\t}\n\t\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\t\tmit->subspace->dataptr = mit->ait->dataptr;\n\t\t}\n\t\tmit->dataptr = mit->subspace->dataptr;\n\t}\n\telse {\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tcopyswap(coord+i,it->dataptr, \n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->dataptr = mit->ait->dataptr;\n\t}\n\treturn;\n}\n\n/* Bind a mapiteration to a particular array */\n\n/* Determine if subspace iteration is necessary. If so, \n 1) Fill in mit->iteraxes\n\t 2) Create subspace iterator\n\t 3) Update nd, dimensions, and size. \n\n Subspace iteration is necessary if: arr->nd > mit->numiter\n*/\n\n/* Need to check for index-errors somewhere. \n\n Let's do it at bind time and also convert all <0 values to >0 here\n as well. \n*/\nstatic void\nPyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)\n{\n\tint subnd;\n\tPyObject *sub, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\t\n\tsubnd = arr->nd - mit->numiter;\n\tif (subnd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"too many indices for array\");\n\t\treturn;\n\t}\n\n\tmit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);\n\tif (mit->ait == NULL) return;\n\n\t/* If this is just a view, then do nothing more */\n\t/* views are handled by just adjusting the strides\n\t and dimensions of the object.\n\t*/\n\t \n\tif (mit->view) return;\n\n\t/* no subspace iteration needed. Finish up and Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; iiteraxes[i] = i;\n\t\t}\n\t\tgoto finish;\n\t}\n\n\t/* all indexing arrays have been converted to 0 \n\t therefore we can extract the subspace with a simple\n\t getitem call which will use view semantics\n\t*/\n\t\n\tsub = PyObject_GetItem((PyObject *)arr, mit->indexobj);\n\tif (sub == NULL) goto fail;\n\tmit->subspace = (PyArrayIterObject *)PyArray_IterNew(sub);\n\tPy_DECREF(sub);\n\tif (mit->subspace == NULL) goto fail;\n\t\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; idimensions[mit->nd+i] = mit->subspace->ao->dimensions[i];\n\tmit->nd += n;\n\n\t/* Now, we still need to interpret the ellipsis and slice objects \n\t to determine which axes the indexing arrays are referring to\n\t*/\n\tn = PyTuple_GET_SIZE(mit->indexobj);\n\n\t/* The number of dimensions an ellipsis takes up */\n\tellipexp = arr->nd - n + 1;\n\t/* Now fill in iteraxes -- remember indexing arrays have been \n converted to 0's in mit->indexobj */\n\tcurraxis = 0;\n\tj = 0;\n\tnoellip = 1; /* Only expand the first ellipsis */\n\tmemset(mit->bscoord, 0, sizeof(intp)*arr->nd);\n\tfor (i=0; iindexobj, i);\n\t\tif (PyInt_Check(obj) || PyLong_Check(obj)) \n\t\t\tmit->iteraxes[j++] = curraxis++;\n\t\telse if (noellip && obj == Py_Ellipsis) {\n\t\t\tcurraxis += ellipexp;\n\t\t\tnoellip = 0;\n\t\t}\n\t\telse {\n\t\t\tintp start=0;\n\t\t\tintp stop, step;\n\t\t\t/* Should be slice object or\n\t\t\t another Ellipsis */\n\t\t\tif (obj == Py_Ellipsis) {\n\t\t\t\tmit->bscoord[curraxis] = 0;\n\t\t\t}\n\t\t\telse if (!PySlice_Check(obj) || \\\n\t\t\t\t (slice_GetIndices((PySliceObject *)obj, \n\t\t\t\t\t\t arr->dimensions[curraxis],\n\t\t\t\t\t\t &start, &stop, &step,\n\t\t\t\t\t\t &dimsize) < 0)) {\n\t\t\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t\t\t \"unexpected object \"\t\\\n\t\t\t\t\t \"(%s) in selection position %d\",\n\t\t\t\t\t obj->ob_type->tp_name, i);\n\t\t\t goto fail;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmit->bscoord[curraxis] = start;\n\t\t\t}\n\t\t\tcurraxis += 1; \n\t\t}\n\t}\n finish:\n\t/* Here check the indexes (now that we have iteraxes) */\n\tmit->size = PyArray_MultiplyList(mit->dimensions, mit->nd);\n\tfor (i=0; inumiter; i++) {\n\t\tit = mit->iters[i];\n\t\tPyArray_ITER_RESET(it);\n\t\tdimsize = arr->dimensions[mit->iteraxes[i]];\n\t\twhile(it->index < it->size) {\n\t\t\tindptr = ((intp *)it->dataptr);\n\t\t\tif (*indptr < 0) *indptr += dimsize;\n\t\t\tif (*indptr < 0 || *indptr >= dimsize) {\n\t\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t\t \"index (%d) out of range \"\\\n\t\t\t\t\t \"(0<=index<=%d) in dimension %d\",\n\t\t\t\t\t (int) *indptr, (int) (dimsize-1), \n\t\t\t\t\t mit->iteraxes[i]);\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t} \n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(mit->subspace);\n\tPy_XDECREF(mit->ait);\n\tmit->subspace = NULL;\n\tmit->ait = NULL;\n\treturn;\n}\n\n/* This function takes a Boolean array and constructs index objects and\n iterators as if nonzero(Bool) had been called\n*/\nstatic int\n_nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)\n{\n\tPyArray_Descr *typecode;\n\tPyArrayObject *ba =NULL, *new=NULL;\n\tint nd, j;\n\tintp size, i, count;\n\tBool *ptr;\n\tintp coords[MAX_DIMS], dims_m1[MAX_DIMS];\n\tintp *dptr[MAX_DIMS];\n\n\ttypecode=PyArray_DescrFromType(PyArray_BOOL);\n\tba = (PyArrayObject *)PyArray_FromAny(myBool, typecode, 0, 0, \n\t\t\t\t\t CARRAY_FLAGS);\n\tif (ba == NULL) return -1;\n\tnd = ba->nd;\n\tfor (j=0; jdata;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; iao->data;\n\t\tcoords[j] = 0;\n\t\tdims_m1[j] = ba->dimensions[j]-1;\n\t}\n\n\tptr = (Bool *)ba->data;\n\n\tif (count == 0) goto finish;\n\t\n\t/* Loop through the Boolean array and copy coordinates\n\t for non-zero entries */\n\tfor (i=0; i=0; j--) {\n\t\t\tif (coords[j] < dims_m1[j]) {\n\t\t\t\tcoords[j]++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcoords[j] = 0;\n\t\t\t}\n\t\t}\n\t}\n\n finish:\n\tPy_DECREF(ba);\n\treturn nd;\n\n fail:\n\tfor (j=0; jiters[i] = NULL;\n \tmit->view = 0;\n \tmit->index = 0;\n \tmit->ait = NULL;\n \tmit->subspace = NULL;\n\tmit->numiter = 0;\n\tmit->consec = 1;\n\tfancy = fancy_indexing_check(indexobj);\n\tPy_INCREF(indexobj);\n\tmit->indexobj = indexobj;\n\tif (fancy == SOBJ_NOTFANCY) { /* bail out */\n\t\tmit->view = 1;\n\t\tgoto ret;\n\t}\n\n\tif (fancy == SOBJ_BADARRAY) {\n\t\tPyErr_SetString(PyExc_IndexError,\t\t\t\\\n\t\t\t\t\"arrays used as indices must be of \" \\\n\t\t\t\t\"integer type\");\n\t\tgoto fail;\n\t}\n\tif (fancy == SOBJ_TOOMANY) {\n\t\tPyErr_SetString(PyExc_IndexError, \"too many indices\");\n\t\tgoto fail;\n\t}\n\n\tif (fancy == SOBJ_LISTTUP) {\n\t\tPyObject *newobj;\n\t\tnewobj = PySequence_Tuple(indexobj);\n\t\tif (newobj == NULL) goto fail;\n\t\tPy_DECREF(indexobj);\n\t\tindexobj = newobj;\n\t\tmit->indexobj = indexobj;\n\t}\n\n#undef SOBJ_NOTFANCY \n#undef SOBJ_ISFANCY \n#undef SOBJ_BADARRAY \n#undef SOBJ_TOOMANY \n#undef SOBJ_LISTTUP \n\n\tif (oned) return (PyObject *)mit;\n\n\t/* Must have some kind of fancy indexing if we are here */\n\t/* indexobj is either a list, an arrayobject, or a tuple \n\t (with at least 1 list or arrayobject or Bool object), */\n\t\n\t/* convert all inputs to iterators */\n\tif (PyArray_Check(indexobj) &&\t\t\t\\\n\t (PyArray_TYPE(indexobj) == PyArray_BOOL)) {\n\t\tmit->numiter = _nonzero_indices(indexobj, mit->iters);\n\t\tif (mit->numiter < 0) goto fail;\n\t\tmit->nd = 1;\n\t\tmit->dimensions[0] = mit->iters[0]->dims_m1[0]+1;\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = PyTuple_New(mit->numiter);\n\t\tif (mit->indexobj == NULL) goto fail;\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tPyTuple_SET_ITEM(mit->indexobj, i, \n\t\t\t\t\t PyInt_FromLong(0));\n\t\t}\n\t}\n\n\telse if (PyArray_Check(indexobj) || !PyTuple_Check(indexobj)) {\n\t\tmit->numiter = 1;\n\t\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\t\tarr = PyArray_FromAny(indexobj, indtype, 0, 0, FORCECAST);\n\t\tif (arr == NULL) goto fail;\n\t\tmit->iters[0] = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\tif (mit->iters[0] == NULL) {Py_DECREF(arr); goto fail;}\n\t\tmit->nd = PyArray_NDIM(arr);\n\t\tmemcpy(mit->dimensions,PyArray_DIMS(arr),mit->nd*sizeof(intp));\n\t\tmit->size = PyArray_SIZE(arr);\n\t\tPy_DECREF(arr);\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = Py_BuildValue(\"(N)\", PyInt_FromLong(0));\n\t}\n\telse { /* must be a tuple */\n\t\tPyObject *obj;\n\t\tPyArrayIterObject *iter;\n\t\tPyObject *new;\n\t\t/* Make a copy of the tuple -- we will be replacing \n\t\t index objects with 0's */\n\t\tn = PyTuple_GET_SIZE(indexobj);\n\t\tnew = PyTuple_New(n);\n\t\tif (new == NULL) goto fail;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; iconsec = 0;\n\t\t\t\tmit->iters[(mit->numiter)++] = iter;\n\t\t\t\tPyTuple_SET_ITEM(new,i,\n\t\t\t\t\t\t PyInt_FromLong(0));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (started) nonindex = 1;\n\t\t\t\tPy_INCREF(obj);\n\t\t\t\tPyTuple_SET_ITEM(new,i,obj);\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\t/* Store the number of iterators actually converted */\n\t\t/* These will be mapped to actual axes at bind time */\n\t\tif (PyArray_Broadcast((PyArrayMultiIterObject *)mit) < 0)\n\t\t\tgoto fail;\n\t}\n\n ret:\n return (PyObject *)mit;\n \n fail:\n Py_DECREF(mit);\n\treturn NULL;\n}\n\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n\tPy_XDECREF(mit->indexobj);\n Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->subspace);\n\tfor (i=0; inumiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n _pya_free(mit);\n}\n\n/* The mapiter object must be created new each time. It does not work\n to bind to a new array, and continue.\n\n This was the orginal intention, but currently that does not work. \n Do not expose the MapIter_Type to Python.\n\n It's not very useful anyway, since mapiter(indexobj); mapiter.bind(a); \n mapiter is equivalent to a[indexobj].flat but the latter gets to use \n slice syntax.\n*/\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.mapiter\",\t\t \t/* tp_name */\n sizeof(PyArrayIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraymapiter_dealloc,\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0,\t\t\t\t\t/* tp_as_sequence */\n 0,\t\t\t\t\t/* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0, \t\t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n (traverseproc)0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0,\t\t \t /* tp_iter */\n (iternextfunc)0, \t /* tp_iternext */\n 0, \t /* tp_methods */\n 0,\t\t\t\t\t /* tp_members */\n 0,\t\t\t /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n 0, \t /* tp_alloc */\n 0,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n\n};\n\n/** END of Subscript Iterator **/\n\n\n/*OBJECT_API\n Get MultiIterator,\n*/\nstatic PyObject *\nPyArray_MultiIterNew(int n, ...)\n{\n va_list va;\n\tPyArrayMultiIterObject *multi;\n\tPyObject *current;\n\tPyObject *arr;\n\t\n\tint i, err=0;\n\t\n\tif (n < 2 || n > MAX_DIMS) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"Need between 2 and (%d) \"\t\t\t\\\n\t\t\t \"array objects (inclusive).\", MAX_DIMS);\n\t}\n\t\n /* fprintf(stderr, \"multi new...\");*/\n multi = PyObject_New(PyArrayMultiIterObject, &PyArrayMultiIter_Type);\n if (multi == NULL)\n return NULL;\n\t\n\tfor (i=0; iiters[i] = NULL;\n\tmulti->numiter = n;\n\tmulti->index = 0;\n\n va_start(va, n);\n\tfor (i=0; iiters[i] = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t}\n\n\tva_end(va);\t\n\t\n\tif (!err && PyArray_Broadcast(multi) < 0) err=1;\n\n\tif (err) {\n Py_DECREF(multi);\n\t\treturn NULL;\n\t}\n\t\n\tPyArray_MultiIter_RESET(multi);\n\t\n return (PyObject *)multi;\n}\n\nstatic PyObject *\narraymultiter_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)\n{\n\t\n\tint n, i;\n\tPyArrayMultiIterObject *multi;\n\tPyObject *arr;\n\t\n\tif (kwds != NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"keyword arguments not accepted.\");\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_Size(args);\n\tif (n < 2 || n > MAX_DIMS) {\n\t\tif (PyErr_Occurred()) return NULL;\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"Need at least two and fewer than (%d) \"\t\\\n\t\t\t \"array objects.\", MAX_DIMS);\n\t\treturn NULL;\n\t}\n\t\n\tmulti = _pya_malloc(sizeof(PyArrayMultiIterObject));\n if (multi == NULL) return PyErr_NoMemory();\n\tPyObject_Init((PyObject *)multi, &PyArrayMultiIter_Type);\n\n\tmulti->numiter = n;\n\tmulti->index = 0;\n\tfor (i=0; iiters[i] = NULL;\n\tfor (i=0; iiters[i] =\t\t\t\t\t\\\n\t\t (PyArrayIterObject *)PyArray_IterNew(arr))==NULL) \n\t\t\tgoto fail;\n\t\tPy_DECREF(arr);\n\t}\n\tif (PyArray_Broadcast(multi) < 0) goto fail;\n\tPyArray_MultiIter_RESET(multi);\n\t\n return (PyObject *)multi;\n\t\n fail:\n Py_DECREF(multi);\n\treturn NULL;\n}\n\nstatic PyObject *\narraymultiter_next(PyArrayMultiIterObject *multi)\n{\n\tPyObject *ret;\n\tint i, n;\n\n\tn = multi->numiter;\n\tret = PyTuple_New(n);\n\tif (ret == NULL) return NULL;\n\tif (multi->index < multi->size) {\n\t\tfor (i=0; i < n; i++) {\n\t\t\tPyArrayIterObject *it=multi->iters[i];\n\t\t\tPyTuple_SET_ITEM(ret, i, \n\t\t\t\t\t PyArray_ToScalar(it->dataptr, it->ao));\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t\tmulti->index++;\n\t\treturn ret;\n\t}\n return NULL;\n}\n\nstatic void\narraymultiter_dealloc(PyArrayMultiIterObject *multi)\n{\n\tint i;\n\n\tfor (i=0; inumiter; i++) \n\t\tPy_XDECREF(multi->iters[i]);\n\t_pya_free(multi);\n}\n\nstatic PyObject *\narraymultiter_size_get(PyArrayMultiIterObject *self)\n{\n#if SIZEOF_INTP <= SIZEOF_LONG\n\treturn PyInt_FromLong((long) self->size);\n#else\n\tif (self->size < MAX_LONG)\n\t\treturn PyInt_FromLong((long) self->size);\n\telse\n\t\treturn PyLong_FromLongLong((longlong) self->size);\n#endif\n}\n\nstatic PyObject *\narraymultiter_index_get(PyArrayMultiIterObject *self)\n{\n#if SIZEOF_INTP <= SIZEOF_LONG\n\treturn PyInt_FromLong((long) self->index);\n#else\n\tif (self->size < MAX_LONG)\n\t\treturn PyInt_FromLong((long) self->index);\n\telse\n\t\treturn PyLong_FromLongLong((longlong) self->index);\n#endif\n}\n\nstatic PyObject *\narraymultiter_shape_get(PyArrayMultiIterObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->dimensions);\t\n}\n\nstatic PyObject *\narraymultiter_iters_get(PyArrayMultiIterObject *self)\n{\n\tPyObject *res;\n\tint i, n;\n\tn = self->numiter;\n\tres = PyTuple_New(n);\n\tif (res == NULL) return res;\n\tfor (i=0; iiters[i]);\n\t\tPyTuple_SET_ITEM(res, i, (PyObject *)self->iters[i]);\n\t}\n\treturn res;\n}\n\nstatic PyGetSetDef arraymultiter_getsetlist[] = {\n {\"size\", \n\t (getter)arraymultiter_size_get,\n\t NULL, \n\t \"total size of broadcasted result\"},\n {\"index\", \n\t (getter)arraymultiter_index_get, \n NULL,\n\t \"current index in broadcasted result\"},\n\t{\"shape\",\n\t (getter)arraymultiter_shape_get,\n\t NULL,\n\t \"shape of broadcasted result\"},\n\t{\"iters\",\n\t (getter)arraymultiter_iters_get,\n\t NULL,\n\t \"tuple of individual iterators\"},\n\t{NULL, NULL, NULL, NULL},\n};\n\nstatic PyMemberDef arraymultiter_members[] = {\n\t{\"numiter\", T_INT, offsetof(PyArrayMultiIterObject, numiter), \n\t RO, NULL},\n\t{\"nd\", T_INT, offsetof(PyArrayMultiIterObject, nd), RO, NULL},\n\t{NULL},\n};\n\nstatic PyObject *\narraymultiter_reset(PyArrayMultiIterObject *self, PyObject *args)\n{\n\tif (!PyArg_ParseTuple(args, \"\")) return NULL;\n\n\tPyArray_MultiIter_RESET(self);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef arraymultiter_methods[] = {\n\t{\"reset\", (PyCFunction) arraymultiter_reset, METH_VARARGS, NULL},\n\t{NULL, NULL},\n};\n\nstatic PyTypeObject PyArrayMultiIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.broadcast\",\t\t \t /* tp_name */\n sizeof(PyArrayMultiIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraymultiter_dealloc,\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, /* tp_as_sequence */\n 0, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n (iternextfunc)arraymultiter_next,\t/* tp_iternext */\n arraymultiter_methods, \t /* tp_methods */\n arraymultiter_members,\t \t /* tp_members */\n arraymultiter_getsetlist, /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n 0, \t /* tp_alloc */\n arraymultiter_new,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrNewFromType(int type_num)\n{\n\tPyArray_Descr *old;\n\tPyArray_Descr *new;\n\n\told = PyArray_DescrFromType(type_num);\n\tnew = PyArray_DescrNew(old);\n\tPy_DECREF(old);\n\treturn new;\t\n}\n\n/*** Array Descr Objects for dynamic types **/\n\n/** There are some statically-defined PyArray_Descr objects corresponding\n to the basic built-in types. \n These can and should be DECREF'd and INCREF'd as appropriate, anyway.\n If a mistake is made in reference counting, deallocation on these \n builtins will be attempted leading to problems. \n\n This let's us deal with all PyArray_Descr objects using reference\n counting (regardless of whether they are statically or dynamically \n allocated). \n**/\n\n/* base cannot be NULL */\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrNew(PyArray_Descr *base)\n{\n\tPyArray_Descr *new;\n\n\tnew = PyObject_New(PyArray_Descr, &PyArrayDescr_Type);\n\tif (new == NULL) return NULL;\n\t/* Don't copy PyObject_HEAD part */\n\tmemcpy((char *)new+sizeof(PyObject),\n\t (char *)base+sizeof(PyObject),\n\t sizeof(PyArray_Descr)-sizeof(PyObject));\n\n\tif (new->fields == Py_None) new->fields = NULL;\n\tPy_XINCREF(new->fields);\n\tif (new->subarray) {\n\t\tnew->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tmemcpy(new->subarray, base->subarray, \n\t\t sizeof(PyArray_ArrayDescr));\n\t\tPy_INCREF(new->subarray->shape);\n\t\tPy_INCREF(new->subarray->base);\n\t}\n\tPy_INCREF(new->typeobj);\n\treturn new;\n}\n\n/* should never be called for builtin-types unless \n there is a reference-count problem \n*/\nstatic void\narraydescr_dealloc(PyArray_Descr *self)\n{\n\tPy_XDECREF(self->typeobj);\n\tPy_XDECREF(self->fields);\n\tif (self->subarray) {\n\t\tPy_DECREF(self->subarray->shape);\n\t\tPy_DECREF(self->subarray->base);\n\t\t_pya_free(self->subarray);\n\t}\n\tself->ob_type->tp_free(self);\n}\n\n/* we need to be careful about setting attributes because these\n objects are pointed to by arrays that depend on them for interpreting\n data. Currently no attributes of dtypedescr objects can be set. \n*/\nstatic PyMemberDef arraydescr_members[] = {\n\t{\"dtype\", T_OBJECT, offsetof(PyArray_Descr, typeobj), RO, NULL},\n\t{\"kind\", T_CHAR, offsetof(PyArray_Descr, kind), RO, NULL},\n\t{\"char\", T_CHAR, offsetof(PyArray_Descr, type), RO, NULL},\n\t{\"num\", T_INT, offsetof(PyArray_Descr, type_num), RO, NULL},\n\t{\"byteorder\", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL},\n\t{\"itemsize\", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL},\n\t{\"alignment\", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL},\n\t{NULL},\n};\n\nstatic PyObject *\narraydescr_subdescr_get(PyArray_Descr *self)\n{\n\tif (self->subarray == NULL) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn Py_BuildValue(\"OO\", (PyObject *)self->subarray->base, \n\t\t\t self->subarray->shape);\n}\n\nstatic PyObject *\narraydescr_protocol_typestr_get(PyArray_Descr *self)\n{\n\tchar basic_=self->kind;\n\tchar endian = self->byteorder;\n\t\n\tif (endian == '=') {\n\t\tendian = '<';\n\t\tif (!PyArray_IsNativeByteOrder(endian)) endian = '>';\n\t}\n\t\n\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t self->elsize);\n}\n\nstatic PyObject *\narraydescr_protocol_descr_get(PyArray_Descr *self)\n{\n\tPyObject *dobj, *res;\n\n\tif (self->fields == NULL || self->fields == Py_None) {\n\t\t/* get default */\n\t\tdobj = PyTuple_New(2);\n\t\tif (dobj == NULL) return NULL;\n\t\tPyTuple_SET_ITEM(dobj, 0, PyString_FromString(\"\"));\n\t\tPyTuple_SET_ITEM(dobj, 1, \\\n\t\t\t\t arraydescr_protocol_typestr_get(self));\n\t\tres = PyList_New(1);\n\t\tif (res == NULL) {Py_DECREF(dobj); return NULL;}\n\t\tPyList_SET_ITEM(res, 0, dobj);\n\t\treturn res;\n\t}\n\n return PyObject_CallMethod(_numpy_internal, \"_array_descr\", \n\t\t\t\t \"O\", self);\n}\n\n/* returns 1 for a builtin type\n and 2 for a user-defined data-type descriptor\n return 0 if neither (i.e. it's a copy of one)\n*/\nstatic PyObject *\narraydescr_isbuiltin_get(PyArray_Descr *self) \n{\n\tlong val;\n\tval = 0;\n\tif (self->fields == Py_None) val = 1;\n\tif (PyTypeNum_ISUSERDEF(self->type_num)) val = 2;\n\treturn PyInt_FromLong(val);\n}\n\nstatic PyObject *\narraydescr_isnative_get(PyArray_Descr *self)\n{\n\tPyObject *ret;\n\n\tret = (PyArray_ISNBO(self->byteorder) ? Py_True : Py_False);\n\tPy_INCREF(ret);\n\treturn ret;\n}\n\nstatic PyObject *\narraydescr_fields_get(PyArray_Descr *self)\n{\n\tif (self->fields == NULL || self->fields == Py_None) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn PyDictProxy_New(self->fields);\n}\n\nstatic PyGetSetDef arraydescr_getsets[] = {\n\t{\"subdescr\", \n\t (getter)arraydescr_subdescr_get,\n\t NULL,\n\t \"A tuple of (descr, shape) or None.\"},\n\t{\"arrdescr\",\n\t (getter)arraydescr_protocol_descr_get,\n\t NULL,\n\t \"The array_protocol type descriptor.\"},\n\t{\"dtypestr\",\n\t (getter)arraydescr_protocol_typestr_get,\n\t NULL,\n\t \"The array_protocol typestring.\"},\n\t{\"isbuiltin\",\n\t (getter)arraydescr_isbuiltin_get,\n\t NULL,\n\t \"Is this a buillt-in data-type descriptor?\"},\n\t{\"isnative\",\n\t (getter)arraydescr_isnative_get,\n\t NULL,\n\t \"Is the byte-order of this descriptor native?\"},\n\t{\"fields\",\n\t (getter)arraydescr_fields_get,\n\t NULL,\n\t NULL},\n\t{NULL, NULL, NULL, NULL},\n};\n\nstatic PyArray_Descr *_convert_from_list(PyObject *obj, int align, int try_descr);\nstatic PyArray_Descr *_convert_from_dict(PyObject *obj, int align);\nstatic PyArray_Descr *_convert_from_commastring(PyObject *obj, int align);\nstatic PyArray_Descr *_convert_from_array_descr(PyObject *obj);\n\nstatic PyObject *\narraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)\n{\n\tPyObject *odescr;\n\tPyArray_Descr *descr, *conv;\n\tint align=0;\n\tBool copy=FALSE;\n\t\n\tif (!PyArg_ParseTuple(args, \"O|iO&\", &odescr, &align,\n\t\t\t PyArray_BoolConverter, ©))\n\t\treturn NULL;\n\t\n\tif (align) {\n\t\tconv = NULL;\n\t\tif PyDict_Check(odescr) \n\t\t\tconv = _convert_from_dict(odescr, 1);\n\t\telse if PyList_Check(odescr) \n\t\t\tconv = _convert_from_list(odescr, 1, 0);\n\t\telse if PyString_Check(odescr)\n\t\t\tconv = _convert_from_commastring(odescr, \n\t\t\t\t\t\t\t\t 1);\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"align can only be non-zero for\" \\\n\t\t\t\t\t\"dictionary, list, and string objects.\");\n\t\t}\n\t\tif (conv) return (PyObject *)conv;\n\t\tif (!PyErr_Occurred()) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"data-type-descriptor not understood\");\n\t\t}\n\t\treturn NULL;\n\t}\n\n\tif PyList_Check(odescr) {\n\t\tconv = _convert_from_array_descr(odescr);\n\t\tif (!conv) {\n\t\t\tPyErr_Clear();\n\t\t\tconv = _convert_from_list(odescr, 0, 0);\n\t\t}\n\t\treturn (PyObject *)conv;\n\t}\n\n\tif (!PyArray_DescrConverter(odescr, &conv)) \n\t\treturn NULL;\n\t/* Get a new copy of it unless it's already a copy */\n\tif (copy && conv->fields == Py_None) {\n\t\tdescr = PyArray_DescrNew(conv);\n\t\tPy_DECREF(conv);\n\t\tconv = descr;\n\t}\n\treturn (PyObject *)conv;\n}\n\nstatic char doc_arraydescr_reduce[] = \"self.__reduce__() for pickling.\";\n\n/* return a tuple of (callable object, args, state) */\nstatic PyObject *\narraydescr_reduce(PyArray_Descr *self, PyObject *args)\n{\n\tPyObject *ret, *mod, *obj;\n\tPyObject *state;\n\tchar endian;\n\tint elsize, alignment;\n\n\tret = PyTuple_New(3);\n\tif (ret == NULL) return NULL;\n\tmod = PyImport_ImportModule(\"numpy.core.multiarray\");\n\tif (mod == NULL) {Py_DECREF(ret); return NULL;}\n\tobj = PyObject_GetAttrString(mod, \"dtypedescr\");\n\tPy_DECREF(mod);\n\tif (obj == NULL) {Py_DECREF(ret); return NULL;}\n\tPyTuple_SET_ITEM(ret, 0, obj);\n\tif (PyTypeNum_ISUSERDEF(self->type_num) ||\t\t\\\n\t ((self->type_num == PyArray_VOID &&\t\t\t\\\n\t self->typeobj != &PyVoidArrType_Type))) {\n\t\tobj = (PyObject *)self->typeobj;\n\t\tPy_INCREF(obj);\n\t}\n\telse {\n\t\tobj = PyString_FromFormat(\"%c%d\",self->kind, self->elsize);\n\t}\n\tPyTuple_SET_ITEM(ret, 1, Py_BuildValue(\"(Nii)\", obj, 0, 1));\n\t\n\t/* Now return the state which is at least \n\t byteorder, subarray, and fields */\n\tendian = self->byteorder;\n\tif (endian == '=') {\n\t\tendian = '<';\n\t\tif (!PyArray_IsNativeByteOrder(endian)) endian = '>';\n\t}\n\tstate = PyTuple_New(5);\n\tPyTuple_SET_ITEM(state, 0, PyString_FromFormat(\"%c\", endian));\n\tPyTuple_SET_ITEM(state, 1, arraydescr_subdescr_get(self));\n\tif (self->fields && self->fields != Py_None) {\n\t\tPy_INCREF(self->fields);\n\t\tPyTuple_SET_ITEM(state, 2, self->fields);\n\t}\n\telse {\n\t\tPyTuple_SET_ITEM(state, 2, Py_None);\n\t\tPy_INCREF(Py_None);\n\t}\n\n\t/* for extended types it also includes elsize and alignment */\n\tif (PyTypeNum_ISEXTENDED(self->type_num)) {\n\t\telsize = self->elsize;\n\t\talignment = self->alignment;\n\t}\n\telse {elsize = -1; alignment = -1;}\n\n\tPyTuple_SET_ITEM(state, 3, PyInt_FromLong(elsize));\n\tPyTuple_SET_ITEM(state, 4, PyInt_FromLong(alignment));\n\n\tPyTuple_SET_ITEM(ret, 2, state);\n\treturn ret;\n}\n\n/* state is at least byteorder, subarray, and fields but could include elsize \n and alignment for EXTENDED arrays \n*/\nstatic char doc_arraydescr_setstate[] = \"self.__setstate__() for pickling.\";\n\nstatic PyObject *\narraydescr_setstate(PyArray_Descr *self, PyObject *args)\n{\n\tint elsize = -1, alignment = -1;\n\tchar endian;\n\tPyObject *subarray, *fields;\n\n\tif (self->fields == Py_None) {Py_INCREF(Py_None); return Py_None;}\n\n\tif (!PyArg_ParseTuple(args, \"(cOOii)\", &endian, &subarray, &fields,\n\t\t\t &elsize, &alignment)) return NULL;\n\t\n\tif (PyArray_IsNativeByteOrder(endian)) endian = '=';\n\n\tself->byteorder = endian;\n\tif (self->subarray) {\n\t\tPy_XDECREF(self->subarray->base);\n\t\tPy_XDECREF(self->subarray->shape);\n\t\t_pya_free(self->subarray);\n\t}\n\tself->subarray = NULL;\n\n\tif (subarray != Py_None) {\n\t\tself->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tself->subarray->base = (PyArray_Descr *)PyTuple_GET_ITEM(subarray, 0);\n\t\tPy_INCREF(self->subarray->base);\n\t\tself->subarray->shape = PyTuple_GET_ITEM(subarray, 1);\n\t\tPy_INCREF(self->subarray->shape);\n\t}\n\t\n\tif (fields != Py_None) {\n\t\tPy_XDECREF(self->fields);\n\t\tself->fields = fields;\n\t\tPy_INCREF(fields);\n\t}\n\t\n\tif (PyTypeNum_ISEXTENDED(self->type_num)) {\n\t\tself->elsize = elsize;\n\t\tself->alignment = alignment;\n\t}\n\t\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n\n/* returns a copy of the PyArray_Descr structure with the byteorder\n altered:\n no arguments: The byteorder is swapped (in all subfields as well)\n single argument: The byteorder is forced to the given state\n (in all subfields as well)\n\n Valid states: ('big', '>') or ('little' or '<')\n\t\t ('native', or '=')\n\n\t\t If a descr structure with | is encountered it's own\n\t\t byte-order is not changed but any fields are: \n*/\n\n/*OBJECT_API\n Deep bytorder change of a data-type descriptor\n*/\nstatic PyArray_Descr *\nPyArray_DescrNewByteorder(PyArray_Descr *self, char newendian)\n{\n\tPyArray_Descr *new;\n\tchar endian;\n\n\tnew = PyArray_DescrNew(self);\n\tendian = new->byteorder;\n\tif (endian != PyArray_IGNORE) {\n\t\tif (newendian == PyArray_SWAP) { /* swap byteorder */\n\t\t\tif PyArray_ISNBO(endian) endian = PyArray_OPPBYTE;\n\t\t\telse endian = PyArray_NATBYTE;\n\t\t\tnew->byteorder = endian;\n\t\t}\n\t\telse if (newendian != PyArray_IGNORE) {\n\t\t\tnew->byteorder = newendian;\n\t\t}\n\t}\n\tif (new->fields) {\n\t\tPyObject *newfields;\n\t\tPyObject *key, *value;\n\t\tPyObject *newvalue;\n\t\tPyObject *old;\n\t\tPyArray_Descr *newdescr;\n\t\tint pos = 0, len, i;\n\t\tnewfields = PyDict_New();\n\t\t/* make new dictionary with replaced */\n\t\t/* PyArray_Descr Objects */\n\t\twhile(PyDict_Next(self->fields, &pos, &key, &value)) {\n\t\t\tif (PyInt_Check(key) &&\t\t\t\\\n\t\t\t PyInt_AsLong(key) == -1) {\n\t\t\t\tPyDict_SetItem(newfields, key, value);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!PyString_Check(key) ||\t \\\n\t\t\t !PyTuple_Check(value) ||\t\t\t\\\n\t\t\t ((len=PyTuple_GET_SIZE(value)) < 2))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\told = PyTuple_GET_ITEM(value, 0);\n\t\t\tif (!PyArray_DescrCheck(old)) continue;\n\t\t\tnewdescr = PyArray_DescrNewByteorder\t\t\\\n\t\t\t\t((PyArray_Descr *)old, newendian);\n\t\t\tif (newdescr == NULL) {\n\t\t\t\tPy_DECREF(newfields); Py_DECREF(new);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnewvalue = PyTuple_New(len);\n\t\t\tPyTuple_SET_ITEM(newvalue, 0,\t\t\\\n\t\t\t\t\t (PyObject *)newdescr);\n\t\t\tfor(i=1; ifields);\n\t\tnew->fields = newfields;\n\t}\n\tif (new->subarray) {\n\t\tPy_DECREF(new->subarray->base);\n\t\tnew->subarray->base = PyArray_DescrNewByteorder \\\n\t\t\t(self->subarray->base, newendian);\n\t}\n\treturn new;\n}\n\n\nstatic char doc_arraydescr_newbyteorder[] = \"self.newbyteorder()\"\n\t\" returns a copy of the dtypedescr object\\n\"\n\t\" with altered byteorders. If is not given all byteorders\\n\"\n\t\" are swapped. Otherwise endian can be '>', '<', or '=' to force\\n\"\n\t\" a byteorder. Descriptors in all fields are also updated in the\\n\"\n\t\" new dtypedescr object.\";\n\nstatic PyObject *\narraydescr_newbyteorder(PyArray_Descr *self, PyObject *args) \n{\n\tchar endian=PyArray_SWAP;\n\t\n\tif (!PyArg_ParseTuple(args, \"|O&\", PyArray_ByteorderConverter,\n\t\t\t &endian)) return NULL;\n\t\t\t\n\treturn (PyObject *)PyArray_DescrNewByteorder(self, endian);\n}\n\nstatic PyMethodDef arraydescr_methods[] = {\n /* for pickling */\n {\"__reduce__\", (PyCFunction)arraydescr_reduce, METH_VARARGS, \n\t doc_arraydescr_reduce},\n\t{\"__setstate__\", (PyCFunction)arraydescr_setstate, METH_VARARGS,\n\t doc_arraydescr_setstate},\n\n\t{\"newbyteorder\", (PyCFunction)arraydescr_newbyteorder, METH_VARARGS,\n\t doc_arraydescr_newbyteorder},\n {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic PyObject *\narraydescr_str(PyArray_Descr *self)\n{\n\tPyObject *sub;\n\n\tif (self->fields && self->fields != Py_None) {\n\t\tPyObject *lst;\n\t\tlst = arraydescr_protocol_descr_get(self);\n\t\tif (!lst) sub = PyString_FromString(\"\");\n\t\telse sub = PyObject_Str(lst);\n\t\tPy_XDECREF(lst);\t\t\n\t\tif (self->type_num != PyArray_VOID) {\n\t\t\tPyObject *p;\n\t\t\tPyObject *t=PyString_FromString(\"'\");\n\t\t\tp = arraydescr_protocol_typestr_get(self);\n\t\t\tPyString_Concat(&p, t);\n\t\t\tPyString_ConcatAndDel(&t, p);\n\t\t\tp = PyString_FromString(\"(\");\n\t\t\tPyString_ConcatAndDel(&p, t);\n\t\t\tPyString_ConcatAndDel(&p, PyString_FromString(\", \"));\n\t\t\tPyString_ConcatAndDel(&p, sub);\n\t\t\tPyString_ConcatAndDel(&p, PyString_FromString(\")\"));\n\t\t\tsub = p;\n\t\t}\n\t}\n\telse if (self->subarray) {\n\t\tPyObject *p;\n\t\tPyObject *t = PyString_FromString(\"(\");\n\t\tp = arraydescr_str(self->subarray->base);\n\t\tPyString_ConcatAndDel(&t, p);\n\t\tPyString_ConcatAndDel(&t, PyString_FromString(\",\"));\n\t\tPyString_ConcatAndDel(&t, PyObject_Str(self->subarray->shape));\n\t\tPyString_ConcatAndDel(&t, PyString_FromString(\")\"));\n\t\tsub = t;\n\t}\n\telse {\n\t\tPyObject *t=PyString_FromString(\"'\");\n\t\tsub = arraydescr_protocol_typestr_get(self);\n\t\tPyString_Concat(&sub, t);\n\t\tPyString_ConcatAndDel(&t, sub);\n\t\tsub = t;\n\t}\n\treturn sub;\n}\n\nstatic PyObject *\narraydescr_repr(PyArray_Descr *self)\n{\n\tPyObject *sub, *s;\n\ts = PyString_FromString(\"dtypedescr(\");\n sub = arraydescr_str(self);\n\tPyString_ConcatAndDel(&s, sub);\n\tsub = PyString_FromString(\")\");\n\tPyString_ConcatAndDel(&s, sub);\n\treturn s;\n}\n\nstatic int\narraydescr_compare(PyArray_Descr *self, PyObject *other)\n{\n \tif (!PyArray_DescrCheck(other)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"not a dtypedescr object.\");\n\t\treturn -1;\n\t}\n\tif (PyArray_EquivTypes(self, (PyArray_Descr *)other)) return 0;\n\tif (PyArray_CanCastTo(self, (PyArray_Descr *)other)) return -1;\n\treturn 1;\n}\n\nstatic PyTypeObject PyArrayDescr_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.dtypedescr\",\t \t /* tp_name */\n sizeof(PyArray_Descr), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraydescr_dealloc,\t\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n\t(cmpfunc)arraydescr_compare,\t\t/* tp_compare */\n (reprfunc)arraydescr_repr,\t /* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, \t\t\t /* tp_as_sequence */\n 0, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n (reprfunc)arraydescr_str, /* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n 0,\t \t/* tp_iternext */\n arraydescr_methods,\t \t /* tp_methods */\n arraydescr_members,\t /* tp_members */\n arraydescr_getsets, /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n 0, \t \t /* tp_init */\n 0, \t /* tp_alloc */\n arraydescr_new,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n", + "source_code_before": "/*\n Provide multidimensional arrays as a basic object type in python. \n\nBased on Original Numeric implementation\nCopyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu\n\nwith contributions from many Numeric Python developers 1995-2004 \n\nHeavily modified in 2005 with inspiration from Numarray \n\nby\n\nTravis Oliphant\nAssistant Professor at\nBrigham Young University \n\nmaintainer email: oliphant.travis@ieee.org\n\nNumarray design (which provided guidance) by \nSpace Science Telescope Institute \n (J. Todd Miller, Perry Greenfield, Rick White)\n\n*/\n\n/* Helper functions */\n\n#define error_converting(x) (((x) == -1) && PyErr_Occurred())\n\n/*OBJECT_API*/\nstatic intp\nPyArray_PyIntAsIntp(PyObject *o)\n{\n\tlonglong long_value = -1;\n\tPyObject *obj;\n\tstatic char *msg = \"an integer is required\";\n\tPyObject *arr=NULL;\n\tPyArray_Descr *descr;\n\tintp ret;\n\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\tdescr = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_Check(o)) {\n\t\tif (PyArray_SIZE(o)!=1 || !PyArray_ISINTEGER(o)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\tPy_DECREF(descr);\n\t\t\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, descr, 0);\n\t}\n\telse if (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, descr);\n\t}\n\tif (arr != NULL) {\n\t\tret = *((intp *)PyArray_DATA(arr));\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\t\t\n\tif (PyInt_Check(o)) {\n\t\tlong_value = (longlong) PyInt_AS_LONG(o);\n\t} else if (PyLong_Check(o)) {\n\t\tlong_value = (longlong) PyLong_AsLongLong(o);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_long != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_long(o);\n\t\tif (obj != NULL) {\n\t\t\tlong_value = (longlong) PyLong_AsLongLong(obj);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_int != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_int(o);\n\t\tif (obj != NULL) {\n\t\t\tlong_value = (longlong) PyLong_AsLongLong(obj);\n\t\t\tPy_DECREF(obj);\n\t\t}\n\t} else {\n\t\tPyErr_SetString(PyExc_NotImplementedError,\"\");\n\t}\n\t\n\tif error_converting(long_value) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\t\n#if (SIZEOF_LONGLONG != SIZEOF_PY_INTPTR_T)\n\tif ((long_value < MIN_INTP) || (long_value > MAX_INTP)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"integer won't fit into a C intp\");\n\t\treturn -1;\n\t}\n#endif\n\treturn (intp) long_value;\n}\n\n\nstatic PyObject *array_int(PyArrayObject *v);\n\n/*OBJECT_API*/\nstatic int\nPyArray_PyIntAsInt(PyObject *o)\n{\n\tlong long_value = -1;\n\tPyObject *obj;\n\tstatic char *msg = \"an integer is required\";\n\tPyObject *arr=NULL;\n\tPyArray_Descr *descr;\n\tint ret;\n\n\t\n\tif (!o) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\tdescr = PyArray_DescrFromType(PyArray_INT);\n\tif (PyArray_Check(o)) {\n\t\tif (PyArray_SIZE(o)!=1 || !PyArray_ISINTEGER(o)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\t\tPy_DECREF(descr);\n\t\t\treturn -1;\n\t\t}\n\t\tarr = PyArray_CastToType((PyArrayObject *)o, descr, 0);\n\t}\n\tif (PyArray_IsScalar(o, Integer)) {\n\t\tarr = PyArray_FromScalar(o, descr);\n\t}\n\tif (arr != NULL) {\n\t\tret = *((int *)PyArray_DATA(arr));\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\t\t\n\tif (PyInt_Check(o)) {\n\t\tlong_value = (long) PyInt_AS_LONG(o);\n\t} else if (PyLong_Check(o)) {\n\t\tlong_value = (long) PyLong_AsLong(o);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_long != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_long(o);\n\t\tif (obj == NULL) return -1;\n\t\tlong_value = (long) PyLong_AsLong(obj);\n\t\tPy_DECREF(obj);\n\t} else if (o->ob_type->tp_as_number != NULL &&\t\t\\\n\t\t o->ob_type->tp_as_number->nb_int != NULL) {\n\t\tobj = o->ob_type->tp_as_number->nb_int(o);\n\t\tif (obj == NULL) return -1;\n\t\tlong_value = (long) PyLong_AsLong(obj);\n\t\tPy_DECREF(obj);\n\t} else {\n\t\tPyErr_SetString(PyExc_NotImplementedError,\"\");\n\t}\n\tif error_converting(long_value) {\n\t\tPyErr_SetString(PyExc_TypeError, msg);\n\t\treturn -1;\n\t}\n\t\n#if (SIZEOF_LONG != SIZEOF_INT)\n\tif ((long_value < INT_MIN) || (long_value > INT_MAX)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"integer won't fit into a C int\");\n\t\treturn -1;\n\t}\n#endif\n\treturn (int) long_value;\n}\n\n\n/*OBJECT_API\n Get Priority from object\n*/\nstatic double\nPyArray_GetPriority(PyObject *obj, double default_) \n{\n PyObject *ret;\n double priority=PyArray_PRIORITY;\n\n\tif (PyArray_CheckExact(obj))\n\t\treturn priority;\n if (PyBigArray_CheckExact(obj)) \n return PyArray_BIG_PRIORITY;\n\n ret = PyObject_GetAttrString(obj, \"__array_priority__\");\n if (ret != NULL) priority = PyFloat_AsDouble(ret);\n if (PyErr_Occurred()) {\n PyErr_Clear(); \n priority = default_;\n }\n Py_XDECREF(ret);\n return priority; \n}\n\n/* Backward compatibility only */\n/* In both Zero and One\n\n ***You must free the memory once you are done with it\n using PyDataMem_FREE(ptr) or you create a memory leak***\n\n If arr is an Object array you are getting a \n BORROWED reference to Zero or One.\n Do not DECREF.\n Please INCREF if you will be hanging on to it.\n\n The memory for the ptr still must be freed in any case;\n*/\n\n\n/*OBJECT_API\n Get pointer to zero of correct type for array.\n*/\nstatic char *\nPyArray_Zero(PyArrayObject *arr)\n{\n char *zeroval;\n int ret, storeflags;\n PyObject *obj;\n\n zeroval = PyDataMem_NEW(arr->descr->elsize);\n if (zeroval == NULL) {\n PyErr_SetNone(PyExc_MemoryError);\n return NULL;\n }\n\n\tobj=PyInt_FromLong((long) 0);\n if (PyArray_ISOBJECT(arr)) {\n memcpy(zeroval, &obj, sizeof(PyObject *));\n Py_DECREF(obj);\n return zeroval;\n }\n\tstoreflags = arr->flags;\n\tarr->flags |= BEHAVED_FLAGS;\n ret = arr->descr->f->setitem(obj, zeroval, arr);\n\tarr->flags = storeflags;\n\tPy_DECREF(obj);\n\tif (ret < 0) {\n\t\tPyDataMem_FREE(zeroval);\n\t\treturn NULL;\n\t}\n return zeroval;\n}\n\n/*OBJECT_API\n Get pointer to one of correct type for array\n*/\nstatic char *\nPyArray_One(PyArrayObject *arr)\n{\n char *oneval;\n int ret, storeflags;\n PyObject *obj;\n\n oneval = PyDataMem_NEW(arr->descr->elsize);\n if (oneval == NULL) {\n PyErr_SetNone(PyExc_MemoryError);\n return NULL;\n }\n\n obj = PyInt_FromLong((long) 1);\n if (PyArray_ISOBJECT(arr)) {\n memcpy(oneval, &obj, sizeof(PyObject *));\n Py_DECREF(obj);\n return oneval;\n } \n\n\tstoreflags = arr->flags;\n\tarr->flags |= BEHAVED_FLAGS;\n ret = arr->descr->f->setitem(obj, oneval, arr);\n\tarr->flags = storeflags;\n Py_DECREF(obj);\n if (ret < 0) {\n PyDataMem_FREE(oneval);\n return NULL;\n }\n return oneval;\n}\n\n/* End deprecated */\n\n\nstatic int \ndo_sliced_copy(char *dest, intp *dest_strides, intp *dest_dimensions,\n\t int dest_nd, char *src, intp *src_strides, \n\t intp *src_dimensions, int src_nd, int elsize, \n\t int copies) {\n intp i, j;\n\t\n if (src_nd == 0 && dest_nd == 0) {\n for(j=0; j src_nd) {\n for(i=0; i<*dest_dimensions; i++, dest += *dest_strides) {\n if (do_sliced_copy(dest, dest_strides+1, \n dest_dimensions+1, dest_nd-1,\n src, src_strides, \n src_dimensions, src_nd, \n elsize, copies) == -1) \n return -1;\n }\n return 0;\n }\n\t\n if (dest_nd == 1) {\n if (*dest_dimensions != *src_dimensions) {\n PyErr_SetString(PyExc_ValueError, \n \"matrices are not aligned for copy\");\n return -1;\n }\n for(i=0; i<*dest_dimensions; i++, src += *src_strides) {\n for(j=0; j 0) {\n if (((*dest_strides)[*dest_nd-1] == *elsize) && \n ((*src_strides)[*src_nd-1] == *elsize)) {\n if ((*dest_dimensions)[*dest_nd-1] != \n (*src_dimensions)[*src_nd-1]) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"matrices are not aligned\");\n return -1;\n }\n *elsize *= (*dest_dimensions)[*dest_nd-1];\n *dest_nd-=1; *src_nd-=1;\n } else {\n break;\n }\n }\n if (*src_nd == 0) {\n while (*dest_nd > 0) {\n if (((*dest_strides)[*dest_nd-1] == *elsize)) {\n *copies *= (*dest_dimensions)[*dest_nd-1];\n *dest_nd-=1;\n } else {\n break;\n }\n }\n }\n return 0;\n}\n\nstatic char *\ncontiguous_data(PyArrayObject *src) \n{\n intp dest_strides[MAX_DIMS], *dest_strides_ptr;\n intp *dest_dimensions=src->dimensions;\n int dest_nd=src->nd;\n intp *src_strides = src->strides;\n intp *src_dimensions=src->dimensions;\n int src_nd=src->nd;\n int elsize=src->descr->elsize;\n int copies=1;\n int ret, i;\n intp stride=elsize;\n char *new_data;\n\t\n for(i=dest_nd-1; i>=0; i--) {\n dest_strides[i] = stride;\n stride *= dest_dimensions[i];\n }\n\t\n dest_strides_ptr = dest_strides;\n\t\n if (optimize_slices(&dest_strides_ptr, &dest_dimensions, &dest_nd,\n &src_strides, &src_dimensions, &src_nd,\n &elsize, &copies) == -1) \n return NULL;\n\t\n new_data = (char *)_pya_malloc(stride);\n\t\n ret = do_sliced_copy(new_data, dest_strides_ptr, dest_dimensions, \n dest_nd, src->data, src_strides, \n src_dimensions, src_nd, elsize, copies);\n\t\n if (ret != -1) { return new_data; }\n else { _pya_free(new_data); return NULL; }\n}\n\n/* end Helper functions */\n\n\nstatic PyObject *PyArray_New(PyTypeObject *, int nd, intp *, \n int, intp *, void *, int, int, PyObject *);\n\n/* C-API functions */\n\n/* Used for arrays of python objects to increment the reference count of */\n/* every python object in the array. */\n/*OBJECT_API\n For object arrays, increment all internal references.\n*/\nstatic int \nPyArray_INCREF(PyArrayObject *mp) \n{\n\tintp i, n;\n\n PyObject **data, **data2;\n\t\n if (mp->descr->type_num != PyArray_OBJECT) return 0;\n\t\n if (PyArray_ISONESEGMENT(mp)) {\n data = (PyObject **)mp->data;\n } else {\n if ((data = (PyObject **)contiguous_data(mp)) == NULL) \n return -1;\n }\n\t\n n = PyArray_SIZE(mp);\n data2 = data;\n for(i=0; idescr->type_num != PyArray_OBJECT) return 0;\n\t\n if (PyArray_ISONESEGMENT(mp)) {\n data = (PyObject **)mp->data;\n } else {\n if ((data = (PyObject **)contiguous_data(mp)) == NULL) \n return -1;\n }\n\t\n n = PyArray_SIZE(mp);\n data2 = data; \n for(i=0; i 0; n--, a += 1) {\n b = a + 1;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n case 4:\n for (a = (char*)p ; n > 0; n--, a += 2) {\n b = a + 3;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n case 8:\n for (a = (char*)p ; n > 0; n--, a += 4) {\n b = a + 7;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b-- = c;\n c = *a; *a++ = *b; *b = c;\n }\n break;\n default:\n m = size / 2;\n for (a = (char *)p ; n > 0; n--, a += m) {\n b = a + (size-1);\n for (j=0; j 1, then dst must be contiguous */\nstatic void\ncopy_and_swap(void *dst, void *src, int itemsize, intp numitems,\n intp srcstrides, int swap) \n{\n int i;\n char *s1 = (char *)src;\n char *d1 = (char *)dst;\n \n\n if ((numitems == 1) || (itemsize == srcstrides)) \n memcpy(d1, s1, itemsize*numitems);\n else { \n for (i = 0; i < numitems; i++) {\n memcpy(d1, s1, itemsize);\n d1 += itemsize;\n s1 += srcstrides;\n } \n }\n\n if (swap)\n byte_swap_vector(d1, numitems, itemsize);\n}\n\nstatic PyArray_Descr **userdescrs=NULL;\n/* Computer-generated arraytype and scalartype code */\n#include \"scalartypes.inc\"\n#include \"arraytypes.inc\"\n\nstatic char *\nindex2ptr(PyArrayObject *mp, intp i) \n{\n\tif(mp->nd == 0) {\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"0-d arrays can't be indexed\");\n\t\treturn NULL;\n\t}\n\tif (i==0 && mp->dimensions[0] > 0)\n\t\treturn mp->data;\n\t\n if (mp->nd>0 && i>0 && i < mp->dimensions[0]) {\n return mp->data+i*mp->strides[0];\n }\n PyErr_SetString(PyExc_IndexError,\"index out of bounds\");\n return NULL;\n}\n\n/*OBJECT_API\n Compute the size of an array (in number of items)\n*/\nstatic intp \nPyArray_Size(PyObject *op) \n{\n if (PyArray_Check(op)) {\n return PyArray_SIZE((PyArrayObject *)op);\n } \n\telse {\n return 0;\n }\n}\n\n/* If destination is not the right type, then src \n will be cast to destination. \n*/\n\n/* Does a flat iterator-based copy. \n\n The arrays are assumed to have the same number of elements\n They can be different sizes and have different types however. \n*/\n\n/*OBJECT_API\n Copy an Array into another array.\n*/\nstatic int\nPyArray_CopyInto(PyArrayObject *dest, PyArrayObject *src)\n{\n intp dsize, ssize, sbytes, ncopies;\n\tint elsize, index;\n PyArrayIterObject *dit=NULL;\n PyArrayIterObject *sit=NULL;\n\tchar *dptr;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n PyArray_CopySwapNFunc *copyswapn;\n \n if (!PyArray_ISWRITEABLE(dest)) {\n PyErr_SetString(PyExc_RuntimeError, \n \"cannot write to array\");\n return -1;\n }\n\n if (!PyArray_EquivArrTypes(dest, src)) {\n return PyArray_CastTo(dest, src);\n }\n\n dsize = PyArray_SIZE(dest);\n ssize = PyArray_SIZE(src);\n\tif (ssize == 0) return 0;\n if (dsize % ssize != 0) {\n PyErr_SetString(PyExc_ValueError, \n \"number of elements in destination must be \"\\\n \"integer multiple of number of \"\\\n \"elements in source\");\n return -1;\n }\n ncopies = (dsize / ssize);\n\n\tswap = PyArray_ISNOTSWAPPED(dest) != PyArray_ISNOTSWAPPED(src);\n\tcopyswap = dest->descr->f->copyswap;\n\tcopyswapn = dest->descr->f->copyswapn;\n\n elsize = dest->descr->elsize;\n\n if ((PyArray_ISCONTIGUOUS(dest) && PyArray_ISCONTIGUOUS(src))\t\\\n\t || (PyArray_ISFORTRAN(dest) && PyArray_ISFORTRAN(src))) {\n \n PyArray_XDECREF(dest);\n dptr = dest->data;\n sbytes = ssize * src->descr->elsize;\n while(ncopies--) {\n memmove(dptr, src->data, sbytes);\n dptr += sbytes;\n }\n\t\tif (swap)\n\t\t\tcopyswapn(dest->data, NULL, dsize, 1, elsize);\n PyArray_INCREF(dest);\n return 0;\n }\n\n dit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)dest);\n sit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)src);\n\n if ((dit == NULL) || (sit == NULL)) {\n Py_XDECREF(dit);\n Py_XDECREF(sit);\n return -1;\n }\n\n PyArray_XDECREF(dest);\n while(ncopies--) {\n index = ssize;\n while(index--) {\n memmove(dit->dataptr, sit->dataptr, elsize);\n\t\t\tif (swap)\n\t\t\t\tcopyswap(dit->dataptr, NULL, 1, elsize);\n PyArray_ITER_NEXT(dit);\n PyArray_ITER_NEXT(sit);\n }\n PyArray_ITER_RESET(sit);\n } \n PyArray_INCREF(dest);\n Py_DECREF(dit);\n Py_DECREF(sit);\n\treturn 0;\n}\n\n\nstatic int \nPyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) \n{\n PyArrayObject *src;\n int ret;\n\n\tPy_INCREF(dest->descr);\n src = (PyArrayObject *)PyArray_FromAny(src_object,\n\t\t\t\t\t dest->descr, 0,\n\t\t\t\t\t dest->nd, FORTRAN_IF(dest));\n if (src == NULL) return -1;\n\n ret = PyArray_CopyInto(dest, src);\n Py_DECREF(src);\n return ret;\n}\n\n\n/* These are also old calls (should use PyArray_New) */\n\n/* They all zero-out the memory as previously done */\n\n/* steals reference to descr -- and enforces native byteorder on it.*/\n/*OBJECT_API\n Like FromDimsAndData but uses the Descr structure instead of typecode\n as input.\n*/\nstatic PyObject *\nPyArray_FromDimsAndDataAndDescr(int nd, int *d, \n PyArray_Descr *descr,\n char *data)\n{\n\tPyObject *ret;\n#if SIZEOF_INTP != SIZEOF_INT\n\tint i;\n\tintp newd[MAX_DIMS];\n#endif\n\n\tif (!PyArray_ISNBO(descr->byteorder))\n\t\tdescr->byteorder = '=';\n\t\n#if SIZEOF_INTP != SIZEOF_INT\n\tfor (i=0; itype_num != PyArray_OBJECT)) {\n\t\tmemset(PyArray_DATA(ret), 0, PyArray_NBYTES(ret));\n\t}\n\treturn ret;\n}\n\n/* end old calls */\n\n/*OBJECT_API\n Copy an array.\n*/\nstatic PyObject *\nPyArray_NewCopy(PyArrayObject *m1, int fortran)\n{\n\tPyArrayObject *ret;\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(m1);\n\t\n\tPy_INCREF(m1->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(m1->ob_type, \n\t\t\t\t\t\t m1->descr,\n\t\t\t\t\t\t m1->nd, \n\t\t\t\t\t\t m1->dimensions,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t fortran, \n\t\t\t\t\t\t (PyObject *)m1);\n\tif (ret == NULL) return NULL;\n if (PyArray_CopyInto(ret, m1) == -1) {\n Py_DECREF(ret);\n return NULL;\n }\n\t\n return (PyObject *)ret;\t\n}\n\nstatic PyObject *array_big_item(PyArrayObject *, intp);\n\n/* Does nothing with descr (cannot be NULL) */\n/*OBJECT_API\n Get scalar-equivalent to a region of memory described by a descriptor.\n*/\nstatic PyObject *\nPyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)\n{\n\tPyTypeObject *type;\n\tPyObject *obj;\n void *destptr;\n PyArray_CopySwapFunc *copyswap;\n\tint type_num;\n\tint itemsize;\n\tint swap;\n\n\ttype_num = descr->type_num;\n\titemsize = descr->elsize;\n type = descr->typeobj;\n copyswap = descr->f->copyswap;\n\tswap = !PyArray_ISNBO(descr->byteorder);\n\tif (type->tp_itemsize != 0) /* String type */\n\t\tobj = type->tp_alloc(type, itemsize);\n\telse\n\t\tobj = type->tp_alloc(type, 0);\n\tif (obj == NULL) return NULL;\n\tif PyTypeNum_ISEXTENDED(type_num) { \n\t\tif (type_num == PyArray_STRING) {\n\t\t\tdestptr = PyString_AS_STRING(obj);\n\t\t\t((PyStringObject *)obj)->ob_shash = -1;\n\t\t\t((PyStringObject *)obj)->ob_sstate =\t\\\n\t\t\t\tSSTATE_NOT_INTERNED; \n\t\t}\n\t\telse if (type_num == PyArray_UNICODE) {\n\t\t\tPyUnicodeObject *uni = (PyUnicodeObject*)obj;\n\t\t\tint length = itemsize / sizeof(Py_UNICODE);\n\t\t\t/* Need an extra slot and need to use \n\t\t\t Python memory manager */\n\t\t\tuni->str = NULL;\n\t\t\tdestptr = PyMem_NEW(Py_UNICODE, length+1);\n\t\t\tif (destptr == NULL) {\n Py_DECREF(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tuni->str = (Py_UNICODE *)destptr;\n\t\t\tuni->str[0] = 0;\n\t\t\tuni->str[length] = 0;\n\t\t\tuni->length = length;\n\t\t\tuni->hash = -1;\n\t\t\tuni->defenc = NULL;\n\t\t}\n\t\telse { \n\t\t\tPyVoidScalarObject *vobj = (PyVoidScalarObject *)obj;\n\t\t\tvobj->base = NULL;\n\t\t\tvobj->descr = descr;\n\t\t\tPy_INCREF(descr);\n\t\t\tvobj->obval = NULL;\n\t\t\tvobj->ob_size = itemsize;\n\t\t\tvobj->flags = BEHAVED_FLAGS | OWNDATA;\n\t\t\tswap = 0;\n\t\t\tif (descr->fields) {\n\t\t\t\tif (base) {\n\t\t\t\t\tPy_INCREF(base);\n\t\t\t\t\tvobj->base = base;\n\t\t\t\t\tvobj->flags = PyArray_FLAGS(base);\n\t\t\t\t\tvobj->flags &= ~OWNDATA;\n\t\t\t\t\tvobj->obval = data;\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdestptr = PyDataMem_NEW(itemsize);\n\t\t\tif (destptr == NULL) {\n Py_DECREF(obj);\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tvobj->obval = destptr;\n\t\t}\n\t}\n\telse {\n\t\tdestptr = _SOFFSET_(obj, type_num);\n\t}\n\t/* copyswap for OBJECT increments the reference count */\n copyswap(destptr, data, swap, itemsize);\n\treturn obj;\n}\n\n/* returns an Array-Scalar Object of the type of arr\n from the given pointer to memory -- main Scalar creation function\n default new method calls this. \n*/\n\n/* Ideally, here the descriptor would contain all the information needed.\n So, that we simply need the data and the descriptor, and perhaps\n a flag \n*/\n\n/*OBJECT_API\n Get scalar-equivalent to 0-d array\n*/\nstatic PyObject *\nPyArray_ToScalar(void *data, PyArrayObject *arr)\n{\n\treturn PyArray_Scalar(data, arr->descr, (PyObject *)arr);\n}\n\n\n/* Return Python scalar if 0-d array object is encountered */\n\n/*OBJECT_API\n Return either an array or the appropriate Python object if the array\n is 0d and matches a Python type.\n*/\nstatic PyObject *\nPyArray_Return(PyArrayObject *mp) \n{\n \n\n\tif (mp == NULL) return NULL;\n\n if (PyErr_Occurred()) {\n Py_XDECREF(mp);\n return NULL;\n }\n\n\tif (mp->nd == 0) {\n\t\tPyObject *ret;\n\t\tret = PyArray_ToScalar(mp->data, mp);\n\t\tPy_DECREF(mp);\n\t\treturn ret;\n\t}\n\telse {\n\t\treturn (PyObject *)mp;\n\t}\n}\n\n/*\n returns typenum to associate with this type >=PyArray_USERDEF.\n Also creates a copy of the VOID_DESCR table inserting it's typeobject in\n and it's typenum in the appropriate place.\n \n needs the userdecrs table and PyArray_NUMUSER variables\n defined in arratypes.inc\n*/\n/*OBJECT_API\n Register Data type\n*/\nstatic int \nPyArray_RegisterDataType(PyTypeObject *type)\n{\n\tPyArray_Descr *descr;\n\tPyObject *obj;\n\tint typenum;\n\tint i;\n\t\n\tif ((type == &PyVoidArrType_Type) ||\t\t\t\\\n\t !PyType_IsSubtype(type, &PyVoidArrType_Type)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"can only register void subtypes\");\n\t\treturn -1;\n\t}\n\t/* See if this type is already registered */\n\tfor (i=0; itypeobj == type)\n\t\t\treturn descr->type_num;\n\t}\n\tdescr = PyArray_DescrNewFromType(PyArray_VOID);\n\ttypenum = PyArray_USERDEF + PyArray_NUMUSERTYPES;\n\tdescr->type_num = typenum;\n descr->typeobj = type;\n\tobj = PyObject_GetAttrString((PyObject *)type,\"itemsize\");\n\tif (obj) {\n\t\ti = PyInt_AsLong(obj);\n\t\tif ((i < 0) && (PyErr_Occurred())) PyErr_Clear();\n\t\telse descr->elsize = i;\n\t\tPy_DECREF(obj);\n\t}\n\tPy_INCREF(type);\n\tuserdescrs = realloc(userdescrs, \n\t\t\t (PyArray_NUMUSERTYPES+1)*sizeof(void *));\n if (userdescrs == NULL) {\n PyErr_SetString(PyExc_MemoryError, \"RegisterDataType\");\n\t\tPy_DECREF(descr);\n return -1;\n }\n\tuserdescrs[PyArray_NUMUSERTYPES++] = descr;\n\treturn typenum;\n}\n\n\n/* \n copyies over from the old descr table for anything\n NULL or zero in what is given. \n DECREF's the Descr already there.\n places a pointer to the new one into the slot.\n*/\n\n/* steals a reference to descr */\n/*OBJECT_API\n Insert Descr Table\n*/\nstatic int\nPyArray_RegisterDescrForType(int typenum, PyArray_Descr *descr)\n{\n\tPyArray_Descr *old;\n\n\tif (!PyTypeNum_ISUSERDEF(typenum)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"data type not registered\");\n\t\tPy_DECREF(descr);\n\t\treturn -1;\n\t}\n\told = userdescrs[typenum-PyArray_USERDEF];\n\tdescr->typeobj = old->typeobj;\n\tdescr->type_num = typenum;\n\n\tif (descr->f == NULL) descr->f = old->f;\n\tif (descr->fields == NULL) {\n\t\tdescr->fields = old->fields;\n\t\tPy_XINCREF(descr->fields);\n\t}\n\tif (descr->subarray == NULL && old->subarray) {\n\t\tdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tmemcpy(descr->subarray, old->subarray, \n\t\t sizeof(PyArray_ArrayDescr));\n\t\tPy_INCREF(descr->subarray->shape);\n\t\tPy_INCREF(descr->subarray->base);\n\t}\n Py_XINCREF(descr->typeobj);\n\n#define _ZERO_CHECK(member) \\\n\tif (descr->member == 0) descr->member = old->member\n\n\t_ZERO_CHECK(kind);\n\t_ZERO_CHECK(type);\n _ZERO_CHECK(byteorder);\n\t_ZERO_CHECK(elsize);\n\t_ZERO_CHECK(alignment);\n#undef _ZERO_CHECK\n\n\tPy_DECREF(old);\n\tuserdescrs[typenum-PyArray_USERDEF] = descr;\n\treturn 0;\n}\n\n\n/*OBJECT_API\n To File\n*/\nstatic int\nPyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format) \n{\n intp size;\n intp n, n2;\n int n3, n4;\n PyArrayIterObject *it;\n PyObject *obj, *strobj, *tupobj;\n\n\tn3 = (sep ? strlen((const char *)sep) : 0);\n\tif (n3 == 0) { /* binary data */\n if (PyArray_ISOBJECT(self)) {\n PyErr_SetString(PyExc_ValueError, \"cannot write \"\\\n\t\t\t\t\t\"object arrays to a file in \"\t\\\n\t\t\t\t\t\"binary mode\");\n return -1;\n }\n\n if (PyArray_ISCONTIGUOUS(self)) {\n size = PyArray_SIZE(self);\n if ((n=fwrite((const void *)self->data, \n (size_t) self->descr->elsize,\n (size_t) size, fp)) < size) {\n PyErr_Format(PyExc_ValueError, \n \"%ld requested and %ld written\",\n (long) size, (long) n);\n return -1;\n }\n }\n else {\n it=(PyArrayIterObject *) \\\n PyArray_IterNew((PyObject *)self);\n while(it->index < it->size) {\n if (fwrite((const void *)it->dataptr, \n (size_t) self->descr->elsize,\n 1, fp) < 1) {\n PyErr_Format(PyExc_IOError, \n \"problem writing element\"\\\n \" %d to file\", \n\t\t\t\t\t\t (int)it->index);\n Py_DECREF(it);\n return -1;\n }\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n } \n }\n else { /* text data */\n it=(PyArrayIterObject *) \\\n PyArray_IterNew((PyObject *)self);\n\t\tn4 = (format ? strlen((const char *)format) : 0);\n while(it->index < it->size) {\n obj = self->descr->f->getitem(it->dataptr, self);\n if (obj == NULL) {Py_DECREF(it); return -1;}\n\t\t\tif (n4 == 0) { /* standard writing */\n\t\t\t\tstrobj = PyObject_Str(obj);\n\t\t\t\tPy_DECREF(obj);\n\t\t\t\tif (strobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t}\n\t\t\telse { /* use format string */\n\t\t\t\ttupobj = PyTuple_New(1);\n\t\t\t\tif (tupobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t\tPyTuple_SET_ITEM(tupobj,0,obj);\n\t\t\t\tobj = PyString_FromString((const char *)format);\n\t\t\t\tif (obj == NULL) {Py_DECREF(tupobj); \n\t\t\t\t\tPy_DECREF(it); return -1;}\n\t\t\t\tstrobj = PyString_Format(obj, tupobj);\n\t\t\t\tPy_DECREF(obj);\n\t\t\t\tPy_DECREF(tupobj);\n\t\t\t\tif (strobj == NULL) {Py_DECREF(it); return -1;}\n\t\t\t}\n if ((n=fwrite(PyString_AS_STRING(strobj), \n 1, n2=PyString_GET_SIZE(strobj),\n fp)) < n2) {\n PyErr_Format(PyExc_IOError,\n \"problem writing element %d\"\\\n \" to file\", \n\t\t\t\t\t (int) it->index);\n Py_DECREF(strobj);\n Py_DECREF(it);\n return -1;\n }\n /* write separator for all but last one */\n if (it->index != it->size-1) \n fwrite(sep, 1, n3, fp);\n Py_DECREF(strobj);\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n }\n return 0;\n}\n\n/*OBJECT_API\n To List\n*/\nstatic PyObject *\nPyArray_ToList(PyArrayObject *self) \n{\n PyObject *lp;\n PyArrayObject *v;\n intp sz, i;\n\t\n if (!PyArray_Check(self)) return (PyObject *)self;\n\n if (self->nd == 0) \n\t\treturn self->descr->f->getitem(self->data,self);\n\t\n sz = self->dimensions[0];\n lp = PyList_New(sz);\n\t\n for (i=0; ind >= self->nd) {\n\t\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\t\"array_item not returning smaller-\" \\\n\t\t\t\t\t\"dimensional array\");\n Py_DECREF(v);\n\t\t\tPy_DECREF(lp);\n\t\t\treturn NULL;\n\t\t}\n PyList_SetItem(lp, i, PyArray_ToList(v));\n\t\tPy_DECREF(v);\n }\n\t\n return lp;\n}\n\nstatic PyObject *\nPyArray_ToString(PyArrayObject *self)\n{\n intp numbytes;\n intp index;\n char *dptr;\n int elsize;\n PyObject *ret;\n PyArrayIterObject *it;\n \n\t/* if (PyArray_TYPE(self) == PyArray_OBJECT) {\n\t\t PyErr_SetString(PyExc_ValueError, \"a string for the data\" \\\n\t\t \"in an object array is not appropriate\");\n\t\t return NULL;\n\t\t }\n\t*/\n\n numbytes = PyArray_NBYTES(self);\n if (PyArray_ISONESEGMENT(self)) {\n ret = PyString_FromStringAndSize(self->data, (int) numbytes);\n }\n else {\n it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n if (it==NULL) return NULL;\n ret = PyString_FromStringAndSize(NULL, (int) numbytes);\n if (ret == NULL) {Py_DECREF(it); return NULL;}\n dptr = PyString_AS_STRING(ret);\n index = it->size;\n elsize = self->descr->elsize;\n while(index--) {\n memcpy(dptr, it->dataptr, elsize);\n dptr += elsize;\n PyArray_ITER_NEXT(it);\n }\n Py_DECREF(it);\n }\n\treturn ret;\n}\n\n\n/*********************** end C-API functions **********************/\n\n\n/* array object functions */\n\nstatic void \narray_dealloc(PyArrayObject *self) {\n\n if (self->weakreflist != NULL)\n PyObject_ClearWeakRefs((PyObject *)self);\n\n if(self->base) {\n\t\t/* UPDATEIFCOPY means that base points to an \n\t\t array that should be updated with the contents\n\t\t of this array upon destruction.\n self->base->flags must have been WRITEABLE \n (checked previously) and it was locked here\n thus, unlock it.\n\t\t*/\n\t\tif (self->flags & UPDATEIFCOPY) {\n ((PyArrayObject *)self->base)->flags |= WRITEABLE;\n\t\t\tPy_INCREF(self); /* hold on to self in next call */\n PyArray_CopyInto((PyArrayObject *)self->base, self);\n\t\t\t/* Don't need to DECREF -- because we are deleting\n\t\t\t self already... */\n\t\t}\n\t\t/* In any case base is pointing to something that we need\n\t\t to DECREF -- either a view or a buffer object */\n Py_DECREF(self->base);\n }\n \n if ((self->flags & OWN_DATA) && self->data) {\n\t\t/* Free internal references if an Object array */\n\t\tif (PyArray_ISOBJECT(self))\n\t\t\tPyArray_XDECREF(self);\n PyDataMem_FREE(self->data);\n }\n\t\n\tPyDimMem_FREE(self->dimensions);\n\n\tPy_DECREF(self->descr);\n\t\n self->ob_type->tp_free((PyObject *)self);\n}\n\n/*************************************************************************\n **************** Implement Mapping Protocol ***************************\n *************************************************************************/\n\nstatic int \narray_length(PyArrayObject *self) \n{\n if (self->nd != 0) {\n return self->dimensions[0];\n } else {\n\t\tPyErr_SetString(PyExc_TypeError, \"len() of unsized object\");\n\t\treturn -1;\n }\n}\n\nstatic PyObject *\narray_big_item(PyArrayObject *self, intp i) \n{\n\tchar *item;\n\tPyArrayObject *r;\n\t\t\n\tif(self->nd == 0) {\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"0-d arrays can't be indexed\");\n\t\treturn NULL;\n\t}\n if ((item = index2ptr(self, i)) == NULL) return NULL;\n\t\n\tPy_INCREF(self->descr);\n\tr = (PyArrayObject *)PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t\t\t self->descr,\n\t\t\t\t\t\t self->nd-1, \n\t\t\t\t\t\t self->dimensions+1, \n\t\t\t\t\t\t self->strides+1, item, \n\t\t\t\t\t\t self->flags,\n\t\t\t\t\t\t (PyObject *)self);\n\tif (r == NULL) return NULL;\n\tPy_INCREF(self);\n\tr->base = (PyObject *)self;\n PyArray_UpdateFlags(r, CONTIGUOUS | FORTRAN);\n\treturn (PyObject *)r;\n}\n\nstatic PyObject *\narray_item_nice(PyArrayObject *self, int i) \n{\n\treturn PyArray_Return((PyArrayObject *)array_big_item(self, (intp) i));\n}\n\n\nstatic int \narray_ass_big_item(PyArrayObject *self, intp i, PyObject *v) \n{\n PyArrayObject *tmp;\n char *item;\n int ret;\n\n if (v == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"can't delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return -1;\n }\n\n if (i < 0) i = i+self->dimensions[0];\n\n if (self->nd > 1) {\n if((tmp = (PyArrayObject *)array_big_item(self, i)) == NULL)\n return -1;\n ret = PyArray_CopyObject(tmp, v);\n Py_DECREF(tmp);\n return ret; \n }\n\t\n if ((item = index2ptr(self, i)) == NULL) return -1;\n if (self->descr->f->setitem(v, item, self) == -1) return -1;\n return 0;\n}\n\n#if SIZEOF_INT == SIZEOF_INTP\n#define array_ass_item array_ass_big_item\n#else\nstatic int\narray_ass_item(PyArrayObject *self, int i, PyObject *v)\n{\n\treturn array_ass_big_item(self, (intp) i, v);\n}\n#endif\n\n\n/* -------------------------------------------------------------- */\nstatic int\nslice_coerce_index(PyObject *o, intp *v)\n{\n\t*v = PyArray_PyIntAsIntp(o);\n\tif (error_converting(*v)) {\n\t\tPyErr_Clear();\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n\n/* This is basically PySlice_GetIndicesEx, but with our coercion\n * of indices to integers (plus, that function is new in Python 2.3) */\nstatic int\nslice_GetIndices(PySliceObject *r, intp length,\n intp *start, intp *stop, intp *step,\n intp *slicelength)\n{\n\tintp defstart, defstop;\n\t\n\tif (r->step == Py_None) {\n\t\t*step = 1;\n\t} else {\n\t\tif (!slice_coerce_index(r->step, step)) return -1;\n\t\tif (*step == 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"slice step cannot be zero\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\t\n\tdefstart = *step < 0 ? length - 1 : 0;\n\tdefstop = *step < 0 ? -1 : length;\n\t\n\tif (r->start == Py_None) {\n\t\t*start = *step < 0 ? length-1 : 0;\n\t} else {\n\t\tif (!slice_coerce_index(r->start, start)) return -1;\n\t\tif (*start < 0) *start += length;\n\t\tif (*start < 0) *start = (*step < 0) ? -1 : 0;\n\t\tif (*start >= length) {\n\t\t\t*start = (*step < 0) ? length - 1 : length;\n\t\t}\n\t}\n\t\n\tif (r->stop == Py_None) {\n\t\t*stop = defstop;\n\t} else {\n\t\tif (!slice_coerce_index(r->stop, stop)) return -1;\n\t\tif (*stop < 0) *stop += length;\n if (*stop < 0) *stop = -1;\n if (*stop > length) *stop = length;\n\t}\n\t\n\tif ((*step < 0 && *stop >= *start) || \\\n\t (*step > 0 && *start >= *stop)) {\n\t\t*slicelength = 0;\n\t} else if (*step < 0) {\n\t\t*slicelength = (*stop - *start + 1) / (*step) + 1;\n\t} else {\n\t\t*slicelength = (*stop - *start - 1) / (*step) + 1;\n\t}\n\t\n\treturn 0;\n}\n\n#define PseudoIndex -1\n#define RubberIndex -2\n#define SingleIndex -3\n\nstatic intp\nparse_subindex(PyObject *op, intp *step_size, intp *n_steps, intp max)\n{\n\tintp index;\n\t\n\tif (op == Py_None) {\n\t\t*n_steps = PseudoIndex;\n\t\tindex = 0;\n\t} else if (op == Py_Ellipsis) {\n\t\t*n_steps = RubberIndex;\n\t\tindex = 0;\n\t} else if (PySlice_Check(op)) {\n\t\tintp stop;\n\t\tif (slice_GetIndices((PySliceObject *)op, max,\n\t\t\t\t &index, &stop, step_size, n_steps) < 0) {\n\t\t\tif (!PyErr_Occurred()) {\n\t\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\t\"invalid slice\");\n\t\t\t}\n\t\t\tgoto fail;\n\t\t}\n\t\tif (*n_steps <= 0) {\n\t\t\t*n_steps = 0;\n\t\t\t*step_size = 1;\n\t\t\tindex = 0;\n\t\t}\n\t} else {\n\t\tindex = PyArray_PyIntAsIntp(op);\n\t\tif (error_converting(index)) {\n\t\t\tPyErr_SetString(PyExc_IndexError,\n\t\t\t\t\t\"each subindex must be either a \"\\\n\t\t\t\t\t\"slice, an integer, Ellipsis, or \"\\\n\t\t\t\t\t\"newaxis\");\n\t\t\tgoto fail;\n\t\t}\n\t\t*n_steps = SingleIndex;\n\t\t*step_size = 0;\n\t\tif (index < 0) index += max;\n\t\tif (index >= max || index < 0) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \"invalid index\");\n\t\t\tgoto fail;\n\t\t}\n\t}\n\treturn index;\n fail:\n\treturn -1;\n}\n\n\nstatic int \nparse_index(PyArrayObject *self, PyObject *op, \n intp *dimensions, intp *strides, intp *offset_ptr)\n{\n int i, j, n;\n int nd_old, nd_new, n_add, n_pseudo;\n\tintp n_steps, start, offset, step_size;\n PyObject *op1=NULL;\n int is_slice;\n\n\n if (PySlice_Check(op) || op == Py_Ellipsis || op == Py_None) {\n n = 1;\n op1 = op;\n Py_INCREF(op);\t\n /* this relies on the fact that n==1 for loop below */\n is_slice = 1;\n }\n else {\n if (!PySequence_Check(op)) {\n PyErr_SetString(PyExc_IndexError, \n \"index must be either an int \"\\\n \"or a sequence\");\n return -1;\n }\n n = PySequence_Length(op);\n is_slice = 0;\n }\n\t\n nd_old = nd_new = 0;\n\t\n offset = 0;\n for(i=0; ind ? \\\n self->dimensions[nd_old] : 0);\n Py_DECREF(op1);\n if (start == -1) break;\n\t\t\n if (n_steps == PseudoIndex) {\n dimensions[nd_new] = 1; strides[nd_new] = 0; nd_new++;\n } else {\n if (n_steps == RubberIndex) {\n for(j=i+1, n_pseudo=0; jnd-(n-i-n_pseudo-1+nd_old);\n if (n_add < 0) {\n PyErr_SetString(PyExc_IndexError, \n \"too many indices\");\n return -1;\n }\n for(j=0; jdimensions[nd_old];\n strides[nd_new] = \\\n self->strides[nd_old];\n nd_new++; nd_old++;\n }\n } else {\n if (nd_old >= self->nd) {\n PyErr_SetString(PyExc_IndexError, \n \"too many indices\");\n return -1;\n }\n offset += self->strides[nd_old]*start;\n nd_old++;\n if (n_steps != SingleIndex) {\n dimensions[nd_new] = n_steps;\n strides[nd_new] = step_size * \\\n self->strides[nd_old-1];\n nd_new++;\n }\n }\n }\n }\n if (i < n) return -1;\n n_add = self->nd-nd_old;\n for(j=0; jdimensions[nd_old];\n strides[nd_new] = self->strides[nd_old];\n nd_new++; nd_old++;\n }\t \n *offset_ptr = offset;\n return nd_new;\n}\n\nstatic void\n_swap_axes(PyArrayMapIterObject *mit, PyArrayObject **ret)\n{\n\tPyObject *new;\n\tint n1, n2, n3, val;\n\tint i;\n\tPyArray_Dims permute;\n\tintp d[MAX_DIMS];\n\n\tpermute.ptr = d;\n\tpermute.len = mit->nd;\n\n\t/* tuple for transpose is \n\t (n1,..,n1+n2-1,0,..,n1-1,n1+n2,...,n3-1)\n\t n1 is the number of dimensions of \n\t the broadcasted index array \n\t n2 is the number of dimensions skipped at the\n\t start\n\t n3 is the number of dimensions of the \n\t result \n\t*/\n\tn1 = mit->iters[0]->nd_m1 + 1;\n\tn2 = mit->iteraxes[0];\n\tn3 = mit->nd;\n\tval = n1;\n\ti = 0;\n\twhile(val < n1+n2) \n\t\tpermute.ptr[i++] = val++;\n\tval = 0;\n\twhile(val < n1)\n\t\tpermute.ptr[i++] = val++;\n\tval = n1+n2;\n\twhile(val < n3)\n\t\tpermute.ptr[i++] = val++;\n\n\tnew = PyArray_Transpose(*ret, &permute);\n\tPy_DECREF(*ret);\n\t*ret = (PyArrayObject *)new;\n}\n\n/* Prototypes for Mapping calls --- not part of the C-API\n because only useful as part of a getitem call. \n*/\n\nstatic void PyArray_MapIterReset(PyArrayMapIterObject *);\nstatic void PyArray_MapIterNext(PyArrayMapIterObject *);\nstatic void PyArray_MapIterBind(PyArrayMapIterObject *, PyArrayObject *);\nstatic PyObject* PyArray_MapIterNew(PyObject *, int);\n\nstatic PyObject *\nPyArray_GetMap(PyArrayMapIterObject *mit)\n{\n\n\tPyArrayObject *ret, *temp;\n\tPyArrayIterObject *it;\n\tint index;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\t/* Unbound map iterator --- Bind should have been called */\n\tif (mit->ait == NULL) return NULL;\n\n\t/* This relies on the map iterator object telling us the shape\n\t of the new array in nd and dimensions.\n\t*/\n\ttemp = mit->ait->ao;\n\tPy_INCREF(temp->descr);\n\tret = (PyArrayObject *)\\\n\t\tPyArray_NewFromDescr(temp->ob_type, \n\t\t\t\t temp->descr,\n\t\t\t\t mit->nd, mit->dimensions, \n\t\t\t\t NULL, NULL, \n\t\t\t\t PyArray_ISFORTRAN(temp),\n\t\t\t\t (PyObject *)temp);\n\tif (ret == NULL) return NULL;\n\n\t/* Now just iterate through the new array filling it in\n\t with the next object from the original array as\n\t defined by the mapping iterator */\n\n\tif ((it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ret)) \n\t == NULL) {\n\t\tPy_DECREF(ret);\n\t\treturn NULL;\n\t}\n\tindex = it->size;\n\tswap = (PyArray_ISNOTSWAPPED(temp) != PyArray_ISNOTSWAPPED(ret));\n copyswap = ret->descr->f->copyswap;\n\tPyArray_MapIterReset(mit);\n\twhile (index--) {\n copyswap(it->dataptr, mit->dataptr, swap, ret->descr->elsize);\n\t\tPyArray_MapIterNext(mit);\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\tPy_DECREF(it);\n\t\n\t/* check for consecutive axes */\n\tif ((mit->subspace != NULL) && (mit->consec)) {\n\t\tif (mit->iteraxes[0] > 0) { /* then we need to swap */\n\t\t\t_swap_axes(mit, &ret);\n\t\t}\n\t}\n\treturn (PyObject *)ret;\n}\n\nstatic int\nPyArray_SetMap(PyArrayMapIterObject *mit, PyObject *op)\n{\n\tPyObject *arr=NULL;\n\tPyArrayIterObject *it;\n\tint index;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\tPyArray_Descr *descr;\n\n\t/* Unbound Map Iterator */\n\tif (mit->ait == NULL) return -1;\n\n\tdescr = mit->ait->ao->descr;\n\tPy_INCREF(descr);\n\tarr = PyArray_FromAny(op, descr, 0, 0, FORCECAST);\n\tif (arr == NULL) return -1;\n\n\tif ((mit->subspace != NULL) && (mit->consec)) {\n\t\tif (mit->iteraxes[0] > 0) { /* then we need to swap */\n\t\t\t_swap_axes(mit, (PyArrayObject **)&arr);\n\t\t}\n\t}\n\t\n\tif ((it = (PyArrayIterObject *)PyArray_IterNew(arr))==NULL) {\n\t\tPy_DECREF(arr);\n\t\treturn -1;\n\t}\n\n\tindex = mit->size;\n\tswap = (PyArray_ISNOTSWAPPED(mit->ait->ao) != \\\n\t\t(PyArray_ISNOTSWAPPED(arr)));\n\n copyswap = PyArray_DESCR(arr)->f->copyswap;\n\tPyArray_MapIterReset(mit);\n /* Need to decref OBJECT arrays */\n if (PyTypeNum_ISOBJECT(descr->type_num)) {\n while (index--) {\n Py_XDECREF(*((PyObject **)mit->dataptr));\n Py_INCREF(*((PyObject **)it->dataptr));\n memmove(mit->dataptr, it->dataptr, sizeof(PyObject *));\n PyArray_MapIterNext(mit);\n PyArray_ITER_NEXT(it);\n if (it->index == it->size)\n PyArray_ITER_RESET(it);\n }\n\t\tPy_DECREF(arr);\n\t\tPy_DECREF(it);\n return 0;\n }\n\twhile(index--) {\n\t\tmemmove(mit->dataptr, it->dataptr, PyArray_ITEMSIZE(arr));\n copyswap(mit->dataptr, NULL, swap, PyArray_ITEMSIZE(arr));\n\t\tPyArray_MapIterNext(mit);\n\t\tPyArray_ITER_NEXT(it);\n\t\tif (it->index == it->size)\n\t\t\tPyArray_ITER_RESET(it);\n\t}\t\t\n\tPy_DECREF(arr);\n\tPy_DECREF(it);\n\treturn 0;\n}\n\n/* Called when treating array object like a mapping -- called first from \n Python when using a[object] unless object is a standard slice object\n (not an extended one). \n\n*/\n\n/* There are two situations: \n\n 1 - the subscript is a standard view and a reference to the \n array can be returned\n\n 2 - the subscript uses Boolean masks or integer indexing and\n therefore a new array is created and returned. \n\n*/\n\n/* Always returns arrays */\n\nstatic PyObject *iter_subscript(PyArrayIterObject *, PyObject *); \n\nstatic PyObject *\narray_subscript(PyArrayObject *self, PyObject *op) \n{\n intp dimensions[MAX_DIMS], strides[MAX_DIMS];\n\tintp offset;\n int nd, oned;\n\tintp i;\n PyArrayObject *other;\n\tPyArrayMapIterObject *mit;\n\n\tif (PyString_Check(op) || PyUnicode_Check(op)) {\n\t\tif (self->descr->fields) {\n\t\t\tPyObject *obj;\n\t\t\tobj = PyDict_GetItem(self->descr->fields, op);\n\t\t\tif (obj != NULL) {\n\t\t\t\tPyArray_Descr *descr;\n\t\t\t\tint offset;\n\t\t\t\tPyObject *title;\n\t\t\t\t\n\t\t\t\tif (PyArg_ParseTuple(obj, \"Oi|O\",\n\t\t\t\t\t\t &descr, &offset, &title)) {\n\t\t\t\t\tPy_INCREF(descr);\n\t\t\t\t\treturn PyArray_GetField(self, descr, \n\t\t\t\t\t\t\t\toffset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"field named %s not found.\",\n\t\t\t PyString_AsString(op));\n\t\treturn NULL;\n\t}\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return NULL;\n }\n if (PyArray_IsScalar(op, Integer) || PyInt_Check(op) || \\\n PyLong_Check(op)) {\n intp value;\n value = PyArray_PyIntAsIntp(op);\n\t\tif (PyErr_Occurred())\n\t\t\tPyErr_Clear();\n else if (value >= 0) {\n\t\t\treturn array_big_item(self, value);\n }\n else /* (value < 0) */ {\n\t\t\tvalue += self->dimensions[0];\n\t\t\treturn array_big_item(self, value);\n\t\t}\n }\n\n\toned = ((self->nd == 1) && !(PyTuple_Check(op) && PyTuple_GET_SIZE(op) > 1));\n\n\t/* wrap arguments into a mapiter object */\n mit = (PyArrayMapIterObject *)PyArray_MapIterNew(op, oned);\n if (mit == NULL) return NULL;\n if (!mit->view) { /* fancy indexing */\n\t\tif (oned) {\n\t\t\tPyArrayIterObject *it;\n\t\t\tPyObject *rval;\n\t\t\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\t\t\tif (it == NULL) {Py_DECREF(mit); return NULL;}\n\t\t\trval = iter_subscript(it, mit->indexobj);\n\t\t\tPy_DECREF(it);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn rval;\n\t\t}\n PyArray_MapIterBind(mit, self);\n other = (PyArrayObject *)PyArray_GetMap(mit);\n Py_DECREF(mit);\n return (PyObject *)other;\n }\n Py_DECREF(mit);\n\n\ti = PyArray_PyIntAsIntp(op);\n\tif (!error_converting(i)) {\n\t\tif (i < 0 && self->nd > 0) i = i+self->dimensions[0];\n\t\treturn array_big_item(self, i);\n\t}\n\tPyErr_Clear();\n\n\t/* Standard (view-based) Indexing */\n if ((nd = parse_index(self, op, dimensions, strides, &offset)) \n == -1) \n return NULL;\n\n\t/* This will only work if new array will be a view */\n\tPy_INCREF(self->descr);\n\tif ((other = (PyArrayObject *)\t\t\t\t\t\\\n\t PyArray_NewFromDescr(self->ob_type, self->descr,\n\t\t\t\t nd, dimensions,\n\t\t\t\t strides, self->data+offset, \n\t\t\t\t self->flags,\n\t\t\t\t (PyObject *)self)) == NULL) \n\t\treturn NULL;\n\n\n\tother->base = (PyObject *)self;\n\tPy_INCREF(self);\n\t\n\tPyArray_UpdateFlags(other, UPDATE_ALL_FLAGS);\n\t\n\treturn (PyObject *)other;\n}\n\n\n/* Another assignment hacked by using CopyObject. */\n\n/* This only works if subscript returns a standard view. */\n\n/* Again there are two cases. In the first case, PyArray_CopyObject\n can be used. In the second case, a new indexing function has to be \n used.\n*/\n\nstatic int iter_ass_subscript(PyArrayIterObject *, PyObject *, PyObject *); \n\nstatic int \narray_ass_sub(PyArrayObject *self, PyObject *index, PyObject *op) \n{\n int ret, oned;\n\tintp i;\n PyArrayObject *tmp;\n\tPyArrayMapIterObject *mit;\n\t\n if (op == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"cannot delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n\t\n if (PyArray_IsScalar(index, Integer) || PyInt_Check(index) ||\t\\\n PyLong_Check(index)) {\n intp value;\n value = PyArray_PyIntAsIntp(index);\n if (PyErr_Occurred())\n PyErr_Clear();\n\t\telse\n\t\t\treturn array_ass_big_item(self, value, op);\n }\n\n\tif (PyString_Check(index) || PyUnicode_Check(index)) {\n\t\tif (self->descr->fields) {\n\t\t\tPyObject *obj;\n\t\t\tobj = PyDict_GetItem(self->descr->fields, index);\n\t\t\tif (obj != NULL) {\n\t\t\t\tPyArray_Descr *descr;\n\t\t\t\tint offset;\n\t\t\t\tPyObject *title;\n\t\t\t\t\n\t\t\t\tif (PyArg_ParseTuple(obj, \"Oi|O\",\n\t\t\t\t\t\t &descr, &offset, &title)) {\n\t\t\t\t\tPy_INCREF(descr);\n\t\t\t\t\treturn PyArray_SetField(self, descr, \n\t\t\t\t\t\t\t\toffset, op);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"field named %s not found.\",\n\t\t\t PyString_AsString(index));\n\t\treturn -1;\n\t}\n\n if (self->nd == 0) {\n PyErr_SetString(PyExc_IndexError, \n \"0-d arrays can't be indexed.\");\n return -1;\n }\n\n\toned = ((self->nd == 1) && !(PyTuple_Check(op) && PyTuple_GET_SIZE(op) > 1));\n\n mit = (PyArrayMapIterObject *)PyArray_MapIterNew(index, oned);\n if (mit == NULL) return -1;\n if (!mit->view) {\n\t\tif (oned) {\n\t\t\tPyArrayIterObject *it;\n\t\t\tint rval;\n\t\t\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\t\t\tif (it == NULL) {Py_DECREF(mit); return -1;}\n\t\t\trval = iter_ass_subscript(it, mit->indexobj, op);\n\t\t\tPy_DECREF(it);\n\t\t\tPy_DECREF(mit);\n\t\t\treturn rval;\n\t\t}\n PyArray_MapIterBind(mit, self);\n ret = PyArray_SetMap(mit, op);\n Py_DECREF(mit);\n return ret;\n }\n Py_DECREF(mit);\n\n\ti = PyArray_PyIntAsIntp(index);\n\tif (!error_converting(i)) {\n\t\treturn array_ass_big_item(self, i, op);\n\t}\n\tPyErr_Clear();\n\t\n\t/* Rest of standard (view-based) indexing */\n\n if ((tmp = (PyArrayObject *)array_subscript(self, index)) == NULL)\n return -1; \n\tif (PyArray_ISOBJECT(self) && (tmp->nd == 0)) {\n\t\tret = tmp->descr->f->setitem(op, tmp->data, tmp);\n\t}\n\telse {\n\t\tret = PyArray_CopyObject(tmp, op);\n\t}\n\tPy_DECREF(tmp);\n return ret;\n}\n\n/* There are places that require that array_subscript return a PyArrayObject\n and not possibly a scalar. Thus, this is the function exposed to \n Python so that 0-dim arrays are passed as scalars\n*/\n\nstatic PyObject *\narray_subscript_nice(PyArrayObject *self, PyObject *op) \n{\n\treturn PyArray_Return((PyArrayObject *)array_subscript(self, op));\n}\n\n\nstatic PyMappingMethods array_as_mapping = {\n (inquiry)array_length,\t\t /*mp_length*/\n (binaryfunc)array_subscript_nice,\t/*mp_subscript*/\n (objobjargproc)array_ass_sub,\t /*mp_ass_subscript*/\n};\n\n/****************** End of Mapping Protocol ******************************/\n\n\n/*************************************************************************\n **************** Implement Buffer Protocol ****************************\n *************************************************************************/\n\n/* removed multiple segment interface */\n\nstatic int \narray_getsegcount(PyArrayObject *self, int *lenp) \n{\n if (lenp)\n *lenp = PyArray_NBYTES(self);\n\n if (PyArray_ISONESEGMENT(self)) {\n return 1;\n }\n\n if (lenp)\n *lenp = 0;\n return 0;\n}\n\nstatic int \narray_getreadbuf(PyArrayObject *self, int segment, void **ptrptr) \n{\n if (segment != 0) {\n PyErr_SetString(PyExc_ValueError, \n \"accessing non-existing array segment\");\n return -1;\n }\n \n if (PyArray_ISONESEGMENT(self)) {\n *ptrptr = self->data;\n return PyArray_NBYTES(self);\n }\n PyErr_SetString(PyExc_ValueError, \"array is not a single segment\");\n *ptrptr = NULL;\n return -1;\n}\n\n\nstatic int \narray_getwritebuf(PyArrayObject *self, int segment, void **ptrptr) \n{\n if (PyArray_CHKFLAGS(self, WRITEABLE)) \n return array_getreadbuf(self, segment, (void **) ptrptr);\n else {\n PyErr_SetString(PyExc_ValueError, \"array cannot be \"\\\n \"accessed as a writeable buffer\");\n return -1;\n }\n}\n\nstatic int \narray_getcharbuf(PyArrayObject *self, int segment, const char **ptrptr) \n{\n if (self->descr->type_num == PyArray_STRING || \\\n\t self->descr->type_num == PyArray_UNICODE)\n return array_getreadbuf(self, segment, (void **) ptrptr);\n else {\n PyErr_SetString(PyExc_TypeError, \n \"non-character array cannot be interpreted \"\\\n \"as character buffer\");\n return -1;\n }\n}\n\nstatic PyBufferProcs array_as_buffer = {\n (getreadbufferproc)array_getreadbuf, /*bf_getreadbuffer*/\n (getwritebufferproc)array_getwritebuf, /*bf_getwritebuffer*/\n (getsegcountproc)array_getsegcount,\t /*bf_getsegcount*/\n (getcharbufferproc)array_getcharbuf, /*bf_getcharbuffer*/\n};\n\n/****************** End of Buffer Protocol *******************************/\n\n\n/*************************************************************************\n **************** Implement Number Protocol ****************************\n *************************************************************************/\n\n\ntypedef struct {\n PyObject *add,\n *subtract,\n *multiply,\n *divide,\n *remainder,\n *power,\n\t\t*sqrt,\n *negative,\n *absolute,\n *invert,\n *left_shift,\n *right_shift,\n *bitwise_and,\n *bitwise_xor,\n *bitwise_or,\n *less,\n *less_equal,\n *equal,\n *not_equal,\n *greater,\n *greater_equal,\n *floor_divide,\n *true_divide,\n\t\t*logical_or,\n\t\t*logical_and,\n\t\t*floor,\n\t\t*ceil,\n\t\t*maximum,\n\t\t*minimum;\t\n\t\n} NumericOps;\n\nstatic NumericOps n_ops = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \n NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,\n NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,\n NULL, NULL, NULL, NULL, NULL};\n\n/* Dictionary can contain any of the numeric operations, by name. \n Those not present will not be changed\n */\n\n#define SET(op) temp=PyDict_GetItemString(dict, #op);\t\\\n\tif (temp != NULL) {\t\t\t\t\\\n\t\tif (!(PyCallable_Check(temp))) return -1; \\\n Py_XDECREF(n_ops.op); \\\n\t\tn_ops.op = temp; \\\n\t}\n\n \n/*OBJECT_API\n Set internal structure with number functions that all arrays will use\n*/\nint \nPyArray_SetNumericOps(PyObject *dict) \n{\n PyObject *temp = NULL;\n SET(add);\n SET(subtract);\n SET(multiply);\n SET(divide);\n SET(remainder);\n SET(power);\n\tSET(sqrt);\n SET(negative);\n SET(absolute);\n SET(invert);\n SET(left_shift);\n SET(right_shift);\n SET(bitwise_and);\n SET(bitwise_or);\n SET(bitwise_xor);\n SET(less);\t \n SET(less_equal);\n SET(equal);\n SET(not_equal);\n SET(greater);\n SET(greater_equal);\n SET(floor_divide);\t\n SET(true_divide);\t\n\tSET(logical_or);\n\tSET(logical_and);\n\tSET(floor);\n\tSET(ceil);\n\tSET(maximum);\n\tSET(minimum);\n return 0;\n}\n\n#define GET(op) if (n_ops.op &&\t\t\t\t\t\t\\\n\t\t (PyDict_SetItemString(dict, #op, n_ops.op)==-1))\t\\\n\t\tgoto fail;\n\n/*OBJECT_API\n Get dictionary showing number functions that all arrays will use\n*/\nstatic PyObject *\nPyArray_GetNumericOps(void) \n{\n\tPyObject *dict;\n\tif ((dict = PyDict_New())==NULL) \n\t\treturn NULL;\t\n\tGET(add);\n GET(subtract);\n GET(multiply);\n GET(divide);\n GET(remainder);\n GET(power);\n\tGET(sqrt);\n GET(negative);\n GET(absolute);\n GET(invert);\n GET(left_shift);\n GET(right_shift);\n GET(bitwise_and);\n GET(bitwise_or);\n GET(bitwise_xor);\n GET(less);\t \n GET(less_equal);\n GET(equal);\n GET(not_equal);\n GET(greater);\n GET(greater_equal);\n GET(floor_divide); \n GET(true_divide); \n\tGET(logical_or);\n\tGET(logical_and);\n\tGET(floor);\n\tGET(ceil);\n\tGET(maximum);\n\tGET(minimum);\n\treturn dict;\t\n\n fail:\n\tPy_DECREF(dict);\n\treturn NULL;\t\t\n}\n\nstatic PyObject *\nPyArray_GenericReduceFunction(PyArrayObject *m1, PyObject *op, int axis,\n\t\t\t int rtype)\n{\n\tPyObject *args, *ret=NULL, *meth;\n\tif (op == NULL) {\n\t\tPy_INCREF(Py_NotImplemented);\n\t\treturn Py_NotImplemented;\n\t}\n\tif (rtype == PyArray_NOTYPE) \n\t\targs = Py_BuildValue(\"(Oi)\", m1, axis);\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(rtype);\n\t\targs = Py_BuildValue(\"(Oic)\", m1, axis, descr->type);\n\t\tPy_DECREF(descr);\n\t}\n\tmeth = PyObject_GetAttrString(op, \"reduce\");\n\tif (meth && PyCallable_Check(meth)) {\n\t\tret = PyObject_Call(meth, args, NULL);\n\t}\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn ret;\n}\t\n\n\nstatic PyObject *\nPyArray_GenericAccumulateFunction(PyArrayObject *m1, PyObject *op, int axis,\n\t\t\t\t int rtype)\n{\n\tPyObject *args, *ret=NULL, *meth;\n\tif (op == NULL) {\n\t\tPy_INCREF(Py_NotImplemented);\n\t\treturn Py_NotImplemented;\n\t}\n\tif (rtype == PyArray_NOTYPE) \n\t\targs = Py_BuildValue(\"(Oi)\", m1, axis);\n\telse {\n\t\tPyArray_Descr *descr;\n\t\tdescr = PyArray_DescrFromType(rtype);\n\t\targs = Py_BuildValue(\"(Oic)\", m1, axis, descr->type);\n\t\tPy_DECREF(descr);\n\t}\n\tmeth = PyObject_GetAttrString(op, \"accumulate\");\n\tif (meth && PyCallable_Check(meth)) {\n\t\tret = PyObject_Call(meth, args, NULL);\n\t}\n\tPy_DECREF(args);\n\tPy_DECREF(meth);\n\treturn ret;\n}\t\n\n\nstatic PyObject *\nPyArray_GenericBinaryFunction(PyArrayObject *m1, PyObject *m2, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"OO\", m1, m2);\n}\n\nstatic PyObject *\nPyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"(O)\", m1);\n}\n\nstatic PyObject *\nPyArray_GenericInplaceBinaryFunction(PyArrayObject *m1, \n\t\t\t\t PyObject *m2, PyObject *op) \n{\n if (op == NULL) {\n Py_INCREF(Py_NotImplemented);\n return Py_NotImplemented; \n }\n return PyObject_CallFunction(op, \"OOO\", m1, m2, m1);\n}\n\nstatic PyObject *\narray_add(PyArrayObject *m1, PyObject *m2) \n{ \n return PyArray_GenericBinaryFunction(m1, m2, n_ops.add); \n}\n\nstatic PyObject *\narray_subtract(PyArrayObject *m1, PyObject *m2) \n{\n\treturn PyArray_GenericBinaryFunction(m1, m2, n_ops.subtract);\n}\n\nstatic PyObject *\narray_multiply(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.multiply);\n}\n\nstatic PyObject *\narray_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.divide);\n}\n\nstatic PyObject *\narray_remainder(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.remainder);\n}\n\nstatic PyObject *\narray_power(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.power);\n}\n\nstatic PyObject *\narray_negative(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.negative);\n}\n\nstatic PyObject *\narray_absolute(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.absolute);\n}\n\nstatic PyObject *\narray_invert(PyArrayObject *m1) \n{ \n return PyArray_GenericUnaryFunction(m1, n_ops.invert);\n}\n\nstatic PyObject *\narray_left_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.left_shift);\n}\n\nstatic PyObject *\narray_right_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.right_shift);\n}\n\nstatic PyObject *\narray_bitwise_and(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_and);\n}\n\nstatic PyObject *\narray_bitwise_or(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_or);\n}\n\nstatic PyObject *\narray_bitwise_xor(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.bitwise_xor);\n}\n\nstatic PyObject *\narray_inplace_add(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.add);\n}\n\nstatic PyObject *\narray_inplace_subtract(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.subtract);\n}\n\nstatic PyObject *\narray_inplace_multiply(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.multiply);\n}\n\nstatic PyObject *\narray_inplace_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.divide);\n}\n\nstatic PyObject *\narray_inplace_remainder(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.remainder);\n}\n\nstatic PyObject *\narray_inplace_power(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.power);\n}\n\nstatic PyObject *\narray_inplace_left_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.left_shift);\n}\n\nstatic PyObject *\narray_inplace_right_shift(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.right_shift);\n}\n\nstatic PyObject *\narray_inplace_bitwise_and(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_and);\n}\n\nstatic PyObject *\narray_inplace_bitwise_or(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_or);\n}\n\nstatic PyObject *\narray_inplace_bitwise_xor(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, n_ops.bitwise_xor);\n}\n\nstatic PyObject *\narray_floor_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.floor_divide);\n}\n\nstatic PyObject *\narray_true_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericBinaryFunction(m1, m2, n_ops.true_divide);\n}\n\nstatic PyObject *\narray_inplace_floor_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, \n\t\t\t\t\t\t n_ops.floor_divide);\n}\n\nstatic PyObject *\narray_inplace_true_divide(PyArrayObject *m1, PyObject *m2) \n{\n return PyArray_GenericInplaceBinaryFunction(m1, m2, \n\t\t\t\t\t\t n_ops.true_divide);\n}\n\n/* Array evaluates as \"TRUE\" if any of the elements are non-zero*/\nstatic int \narray_any_nonzero(PyArrayObject *mp) \n{\n\tintp index;\n\tPyArrayIterObject *it;\n\tBool anyTRUE = FALSE;\n\t\n\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)mp);\n\tif (it==NULL) return anyTRUE;\n\tindex = it->size;\n\twhile(index--) {\n\t\tif (mp->descr->f->nonzero(it->dataptr, mp)) {\n\t\t\tanyTRUE = TRUE;\n\t\t\tbreak;\n\t\t}\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\tPy_DECREF(it);\n\treturn anyTRUE;\n}\n\nstatic int\n_array_nonzero(PyArrayObject *mp)\n{\n\tintp n;\n\tn = PyArray_SIZE(mp);\n\tif (n == 1) {\n\t\treturn mp->descr->f->nonzero(mp->data, mp);\n\t}\n\telse if (n == 0) {\n\t\treturn 0;\n\t}\n\telse {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"The truth value of an array \" \\\n\t\t\t\t\"with more than one element is ambiguous. \" \\\n\t\t\t\t\"Use a.any() or a.all()\");\n\t\treturn -1;\n\t}\n}\n\n\n\nstatic PyObject *\narray_divmod(PyArrayObject *op1, PyObject *op2) \n{\n PyObject *divp, *modp, *result;\n\n divp = array_floor_divide(op1, op2);\n if (divp == NULL) return NULL;\n modp = array_remainder(op1, op2);\n if (modp == NULL) {\n Py_DECREF(divp);\n return NULL;\n }\n result = Py_BuildValue(\"OO\", divp, modp);\n Py_DECREF(divp);\n Py_DECREF(modp);\n return result;\n}\n\n\nstatic PyObject *\narray_int(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can be\"\\\n\t\t\t\t\" converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv == NULL) return NULL;\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n Py_DECREF(pv);\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_int == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to int\");\n Py_DECREF(pv);\n return NULL;\n }\n\n pv2 = pv->ob_type->tp_as_number->nb_int(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_float(PyArrayObject *v) \n{\n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv == NULL) return NULL;\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an \"\\\n\t\t\t\t\"int; scalar object is not a number\");\n Py_DECREF(pv);\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_float == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to float\");\n Py_DECREF(pv);\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_float(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_long(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_long == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to long\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_long(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_oct(PyArrayObject *v) \n{\t \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_oct == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to oct\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_oct(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\narray_hex(PyArrayObject *v) \n{ \n PyObject *pv, *pv2;\n if (PyArray_SIZE(v) != 1) {\n PyErr_SetString(PyExc_TypeError, \"only length-1 arrays can \"\\\n\t\t\t\t\"be converted to Python scalars\");\n return NULL;\n }\n pv = v->descr->f->getitem(v->data, v);\n if (pv->ob_type->tp_as_number == 0) {\n PyErr_SetString(PyExc_TypeError, \"cannot convert to an int; \"\\\n\t\t\t\t\"scalar object is not a number\");\n return NULL;\n }\n if (pv->ob_type->tp_as_number->nb_hex == 0) {\n PyErr_SetString(PyExc_TypeError, \"don't know how to convert \"\\\n\t\t\t\t\"scalar number to hex\");\n return NULL;\n }\n pv2 = pv->ob_type->tp_as_number->nb_hex(pv);\n Py_DECREF(pv);\n return pv2;\t \n}\n\nstatic PyObject *\n_array_copy_nice(PyArrayObject *self)\n{\n\treturn PyArray_Return((PyArrayObject *)\t\t\\\n\t\t\t PyArray_Copy(self));\n}\n\nstatic PyNumberMethods array_as_number = {\n (binaryfunc)array_add,\t\t /*nb_add*/\n (binaryfunc)array_subtract,\t\t /*nb_subtract*/\n (binaryfunc)array_multiply,\t\t /*nb_multiply*/\n (binaryfunc)array_divide,\t\t /*nb_divide*/\n (binaryfunc)array_remainder,\t /*nb_remainder*/\n (binaryfunc)array_divmod,\t\t /*nb_divmod*/\n (ternaryfunc)array_power,\t\t /*nb_power*/\n (unaryfunc)array_negative, /*nb_neg*/\t\n (unaryfunc)_array_copy_nice,\t\t /*nb_pos*/ \n (unaryfunc)array_absolute,\t\t /*(unaryfunc)array_abs,*/\n (inquiry)_array_nonzero,\t\t /*nb_nonzero*/\n (unaryfunc)array_invert,\t\t /*nb_invert*/\n (binaryfunc)array_left_shift,\t /*nb_lshift*/\n (binaryfunc)array_right_shift,\t /*nb_rshift*/\n (binaryfunc)array_bitwise_and,\t /*nb_and*/\n (binaryfunc)array_bitwise_xor,\t /*nb_xor*/\n (binaryfunc)array_bitwise_or,\t /*nb_or*/\n 0,\t\t /*nb_coerce*/\n (unaryfunc)array_int,\t\t /*nb_int*/\n (unaryfunc)array_long,\t\t /*nb_long*/\n (unaryfunc)array_float,\t\t /*nb_float*/\n (unaryfunc)array_oct,\t\t /*nb_oct*/\n (unaryfunc)array_hex,\t\t /*nb_hex*/\n\n /*This code adds augmented assignment functionality*/\n /*that was made available in Python 2.0*/\n (binaryfunc)array_inplace_add,\t /*inplace_add*/\n (binaryfunc)array_inplace_subtract,\t /*inplace_subtract*/\n (binaryfunc)array_inplace_multiply,\t /*inplace_multiply*/\n (binaryfunc)array_inplace_divide,\t /*inplace_divide*/\n (binaryfunc)array_inplace_remainder, /*inplace_remainder*/\n (ternaryfunc)array_inplace_power,\t /*inplace_power*/\n (binaryfunc)array_inplace_left_shift, /*inplace_lshift*/\n (binaryfunc)array_inplace_right_shift, /*inplace_rshift*/\n (binaryfunc)array_inplace_bitwise_and, /*inplace_and*/\n (binaryfunc)array_inplace_bitwise_xor, /*inplace_xor*/\n (binaryfunc)array_inplace_bitwise_or, /*inplace_or*/\n\n (binaryfunc)array_floor_divide,\t /*nb_floor_divide*/\n (binaryfunc)array_true_divide,\t /*nb_true_divide*/\n (binaryfunc)array_inplace_floor_divide, /*nb_inplace_floor_divide*/\n (binaryfunc)array_inplace_true_divide, /*nb_inplace_true_divide*/\n\n};\n\n/****************** End of Buffer Protocol *******************************/\n\n\n/*************************************************************************\n **************** Implement Sequence Protocol **************************\n *************************************************************************/\n\n/* Some of this is repeated in the array_as_mapping protocol. But\n we fill it in here so that PySequence_XXXX calls work as expected \n*/\n\n\nstatic PyObject * \narray_slice(PyArrayObject *self, int ilow, int ihigh) \n{\n PyArrayObject *r;\n int l;\n char *data;\n\n if (self->nd == 0) {\n PyErr_SetString(PyExc_ValueError, \"cannot slice a scalar\");\n return NULL;\n }\n \t\n l=self->dimensions[0];\n if (ihigh < 0) ihigh += l;\n if (ilow < 0) ilow += l;\n if (ilow < 0) ilow = 0;\n else if (ilow > l) ilow = l;\n if (ihigh < 0) ihigh = 0;\n else if (ihigh > l) ihigh = l;\n if (ihigh < ilow) ihigh = ilow;\n\n if (ihigh != ilow) {\n data = index2ptr(self, ilow);\n if (data == NULL) return NULL;\n } else {\n data = self->data;\n }\n\n self->dimensions[0] = ihigh-ilow;\n\tPy_INCREF(self->descr);\n r = (PyArrayObject *)\t\t\t\t\t\t\\\n\t\tPyArray_NewFromDescr(self->ob_type, self->descr,\n\t\t\t\t self->nd, self->dimensions, \n\t\t\t\t self->strides, data,\n\t\t\t\t self->flags, (PyObject *)self);\n\n self->dimensions[0] = l;\n r->base = (PyObject *)self;\n Py_INCREF(self);\n\tPyArray_UpdateFlags(r, UPDATE_ALL_FLAGS); \n return (PyObject *)r;\n}\n\n\nstatic int \narray_ass_slice(PyArrayObject *self, int ilow, int ihigh, PyObject *v) {\n int ret;\n PyArrayObject *tmp;\n\t\n if (v == NULL) {\n PyErr_SetString(PyExc_ValueError, \n \"cannot delete array elements\");\n return -1;\n }\n\tif (!PyArray_ISWRITEABLE(self)) {\n\t\tPyErr_SetString(PyExc_RuntimeError,\n\t\t\t\t\"array is not writeable\");\n\t\treturn -1;\n\t}\n if ((tmp = (PyArrayObject *)array_slice(self, ilow, ihigh)) \\\n == NULL) \n return -1; \n ret = PyArray_CopyObject(tmp, v);\n Py_DECREF(tmp);\n\t\n return ret;\n}\n\nstatic int\narray_contains(PyArrayObject *self, PyObject *el)\n{\n /* equivalent to (self == el).any() */\n\n PyObject *res; \n int ret;\n\n res = PyArray_EnsureArray(PyObject_RichCompare((PyObject *)self, el, Py_EQ));\n if (res == NULL) return -1;\n ret = array_any_nonzero((PyArrayObject *)res);\n Py_DECREF(res);\n return ret;\n}\n\n\nstatic PySequenceMethods array_as_sequence = {\n (inquiry)array_length,\t\t/*sq_length*/\n (binaryfunc)NULL, /* sq_concat is handled by nb_add*/\n (intargfunc)NULL, /* sq_repeat is handled nb_multiply*/\n (intargfunc)array_item_nice,\t\t/*sq_item*/\n (intintargfunc)array_slice,\t\t/*sq_slice*/\n (intobjargproc)array_ass_item,\t/*sq_ass_item*/\n (intintobjargproc)array_ass_slice,\t/*sq_ass_slice*/\n\t(objobjproc) array_contains, /* sq_contains */\n\t(binaryfunc) NULL, /* sg_inplace_concat */\n\t(intargfunc) NULL /* sg_inplace_repeat */\n};\n\n\n/****************** End of Sequence Protocol ****************************/\n\n\nstatic int \ndump_data(char **string, int *n, int *max_n, char *data, int nd, \n intp *dimensions, intp *strides, PyArrayObject* self) \n{\n PyArray_Descr *descr=self->descr;\n PyObject *op, *sp;\n char *ostring;\n int i, N;\n\t\n#define CHECK_MEMORY if (*n >= *max_n-16) { *max_n *= 2; \\\n\t\t*string = (char *)_pya_realloc(*string, *max_n); }\n\t\n if (nd == 0) {\n\t\t\n if ((op = descr->f->getitem(data, self)) == NULL) return -1;\n sp = PyObject_Repr(op);\n if (sp == NULL) {Py_DECREF(op); return -1;}\n ostring = PyString_AsString(sp);\n N = PyString_Size(sp)*sizeof(char);\n *n += N;\n CHECK_MEMORY\n memmove(*string+(*n-N), ostring, N);\n Py_DECREF(sp);\n Py_DECREF(op);\n return 0;\n } else {\n CHECK_MEMORY\n (*string)[*n] = '[';\n *n += 1;\n for(i=0; idata, \n\t\t self->nd, self->dimensions, \n self->strides, self) < 0) { \n\t\t_pya_free(string); return NULL; \n\t}\n\t\n\tif (PyArray_ISEXTENDED(self)) {\n\t\tchar buf[100];\n\t\tsnprintf(buf, sizeof(buf), \"%d\", self->descr->elsize);\n\t\tsprintf(string+n, \", '%c%s')\", self->descr->type, buf);\n\t\tret = PyString_FromStringAndSize(string, n+6+strlen(buf));\n\t}\n\telse {\n\t\tsprintf(string+n, \", '%c')\", self->descr->type);\n\t\tret = PyString_FromStringAndSize(string, n+6);\n\t}\n\t\n\n _pya_free(string);\n return ret;\n}\n\nstatic PyObject *PyArray_StrFunction=NULL;\nstatic PyObject *PyArray_ReprFunction=NULL;\n\n/*OBJECT_API\n Set the array print function to be a Python function.\n*/\nstatic void \nPyArray_SetStringFunction(PyObject *op, int repr) \n{\n if (repr) {\n\t\t/* Dispose of previous callback */\n Py_XDECREF(PyArray_ReprFunction); \n\t\t/* Add a reference to new callback */\n Py_XINCREF(op); \n\t\t/* Remember new callback */\n PyArray_ReprFunction = op; \n } else {\n\t\t/* Dispose of previous callback */\n Py_XDECREF(PyArray_StrFunction); \n\t\t/* Add a reference to new callback */\n Py_XINCREF(op); \n\t\t/* Remember new callback */\n PyArray_StrFunction = op; \n }\n}\n\nstatic PyObject *\narray_repr(PyArrayObject *self) \n{\n PyObject *s, *arglist;\n\t\n if (PyArray_ReprFunction == NULL) {\n s = array_repr_builtin(self);\n } else {\n arglist = Py_BuildValue(\"(O)\", self);\n s = PyEval_CallObject(PyArray_ReprFunction, arglist);\n Py_DECREF(arglist); \n }\n return s;\n}\n\nstatic PyObject *\narray_str(PyArrayObject *self) \n{\n PyObject *s, *arglist;\n\t\n if (PyArray_StrFunction == NULL) {\n s = array_repr(self);\n } else {\n arglist = Py_BuildValue(\"(O)\", self);\n s = PyEval_CallObject(PyArray_StrFunction, arglist);\n Py_DECREF(arglist); \n }\n return s;\n}\n\nstatic PyObject *\narray_richcompare(PyArrayObject *self, PyObject *other, int cmp_op) \n{\n PyObject *array_other, *result;\n\n switch (cmp_op) \n {\n case Py_LT:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.less);\n case Py_LE:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.less_equal);\n case Py_EQ:\n /* Try to convert other to an array */\n array_other = PyArray_FromObject(other, \n\t\t\t\t\t\t\t PyArray_NOTYPE, 0, 0);\n /* If not successful, then return the integer\n\t\t\t object 0. This fixes code that used to\n\t\t\t allow equality comparisons between arrays\n\t\t\t and other objects which would give a result\n\t\t\t of 0\n */\n if ((array_other == NULL) || \\\n\t\t\t (array_other == Py_None)) {\n Py_XDECREF(array_other);\n PyErr_Clear();\n Py_INCREF(Py_False);\n return Py_False;\n }\n result = PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t array_other, \n\t\t\t\t\t\t\t n_ops.equal);\n /* If the comparison results in NULL, then the \n\t\t\t two array objects can not be compared together so \n\t\t\t return zero \n */\n Py_DECREF(array_other);\n if (result == NULL) {\n PyErr_Clear();\n Py_INCREF(Py_False);\n return Py_False;\n }\n return result;\n case Py_NE:\n /* Try to convert other to an array */\n array_other = PyArray_FromObject(other, \n\t\t\t\t\t\t\t PyArray_NOTYPE, 0, 0);\n /* If not successful, then objects cannot be \n\t\t\t compared and cannot be equal, therefore, \n\t\t\t return True;\n */\n if ((array_other == NULL) || \\\n\t\t\t (array_other == Py_None)) {\n Py_XDECREF(array_other);\n PyErr_Clear();\n Py_INCREF(Py_True);\n return Py_True;\n }\n result = PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t array_other, \n\t\t\t\t\t\t\t n_ops.not_equal);\n Py_DECREF(array_other);\n if (result == NULL) {\n PyErr_Clear();\n Py_INCREF(Py_True);\n return Py_True;\n }\n return result;\n case Py_GT:\n return PyArray_GenericBinaryFunction(self, other, \n\t\t\t\t\t\t\t n_ops.greater);\n case Py_GE:\n return PyArray_GenericBinaryFunction(self, \n\t\t\t\t\t\t\t other, \n\t\t\t\t\t \t n_ops.greater_equal);\n }\n return NULL;\n}\n\nstatic PyObject *\n_check_axis(PyArrayObject *arr, int *axis, int flags)\n{\n\tPyObject *temp;\n\tint n = arr->nd;\n\n\tif ((*axis >= MAX_DIMS) || (n==0)) {\n\t\ttemp = PyArray_Ravel(arr,0);\n\t\t*axis = 0;\n\t\treturn temp;\n\t}\n\telse {\n\t\tif (flags) {\n\t\t\ttemp = PyArray_FromAny((PyObject *)arr, NULL, \n\t\t\t\t\t 0, 0, flags);\n\t\t\tif (temp == NULL) return NULL;\n\t\t}\n\t\telse {\n\t\t\tPy_INCREF(arr);\n\t\t\ttemp = (PyObject *)arr;\n\t\t}\n\t}\n\tif (*axis < 0) *axis += n;\n\tif ((*axis < 0) || (*axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", *axis);\n\t\tPy_DECREF(temp);\n\t\treturn NULL;\n\t}\n\treturn temp;\n}\n\n#include \"arraymethods.c\"\n\n/* Lifted from numarray */\nstatic PyObject *\nPyArray_IntTupleFromIntp(int len, intp *vals)\n{\n\tint i;\n PyObject *intTuple = PyTuple_New(len);\n if (!intTuple) goto fail;\n for(i=0; ind == 0) return 1;\n\tsd = ap->descr->elsize;\n\tif (ap->nd == 1) return sd == ap->strides[0];\n\tfor (i = ap->nd-1; i >= 0; --i) {\n\t\t/* contiguous by definition */\n\t\tif (ap->dimensions[i] == 0) return 1; \n\t\t\n\t\tif (ap->strides[i] != sd) return 0;\n\t\tsd *= ap->dimensions[i];\n\t}\n\treturn 1;\n}\n\n\nstatic int \n_IsFortranContiguous(PyArrayObject *ap) \n{\n\tintp sd;\n\tint i;\n\t\n\tif (ap->nd == 0) return 1;\n\tsd = ap->descr->elsize;\n\tif (ap->nd == 1) return sd == ap->strides[0];\n\tfor (i=0; i< ap->nd; ++i) {\n\t\t/* contiguous by definition */\n\t\tif (ap->dimensions[i] == 0) return 1; \n\t\t\n\t\tif (ap->strides[i] != sd) return 0;\n\t\tsd *= ap->dimensions[i];\n\t}\n\treturn 1;\n}\n\nstatic int\n_IsAligned(PyArrayObject *ap) \n{\n\tint i, alignment, aligned=1;\n\tintp ptr;\n\tint type = ap->descr->type_num;\n\n\tif ((type == PyArray_STRING) || (type == PyArray_VOID))\n\t\treturn 1;\n\n\talignment = ap->descr->alignment;\n\tif (alignment == 1) return 1;\n\n\tptr = (intp) ap->data;\n aligned = (ptr % alignment) == 0;\n for (i=0; i nd; i++)\n aligned &= ((ap->strides[i] % alignment) == 0);\n return aligned != 0;\n}\n\nstatic Bool\n_IsWriteable(PyArrayObject *ap)\n{\n\tPyObject *base=ap->base;\n\tvoid *dummy;\n\tint n;\n\n\t/* If we own our own data, then no-problem */\n\tif ((base == NULL) || (ap->flags & OWN_DATA)) return TRUE;\n\n\t/* Get to the final base object \n\t If it is a writeable array, then return TRUE\n\t If we can find an array object \n\t or a writeable buffer object as the final base object\n\t or a string object (for pickling support memory savings).\n\t - this last could be removed if a proper pickleable \n\t buffer was added to Python.\n\t*/\n\n\twhile(PyArray_Check(base)) {\n\t\tif (PyArray_CHKFLAGS(base, OWN_DATA)) \n\t\t\treturn (Bool) (PyArray_ISWRITEABLE(base));\n\t\tbase = PyArray_BASE(base);\n\t}\n\n\t/* here so pickle support works seamlessly \n\t and unpickled array can be set and reset writeable \n\t -- could be abused -- */\n\tif PyString_Check(base) return TRUE;\n\n\tif (PyObject_AsWriteBuffer(base, &dummy, &n) < 0)\n\t\treturn FALSE;\n\t\n\treturn TRUE;\n}\n\n\n/*OBJECT_API\n Update Several Flags at once.\n*/\nstatic void\nPyArray_UpdateFlags(PyArrayObject *ret, int flagmask)\n{\n\n\tif (flagmask & FORTRAN) {\n\t\tif (_IsFortranContiguous(ret)) {\n\t\t\tret->flags |= FORTRAN;\n\t\t\tif (ret->nd > 1) ret->flags &= ~CONTIGUOUS;\n\t\t}\n\t\telse ret->flags &= ~FORTRAN;\n\t}\n\tif (flagmask & CONTIGUOUS) {\n\t\tif (_IsContiguous(ret)) {\n\t\t\tret->flags |= CONTIGUOUS;\n\t\t\tif (ret->nd > 1) ret->flags &= ~FORTRAN;\n\t\t}\n\t\telse ret->flags &= ~CONTIGUOUS;\n\t}\n\tif (flagmask & ALIGNED) {\n\t\tif (_IsAligned(ret)) ret->flags |= ALIGNED;\n\t\telse ret->flags &= ~ALIGNED;\n\t}\n\t/* This is not checked by default WRITEABLE is not part of UPDATE_ALL_FLAGS */\n\tif (flagmask & WRITEABLE) {\n\t if (_IsWriteable(ret)) ret->flags |= WRITEABLE;\n\t \telse ret->flags &= ~WRITEABLE;\t\n }\n\treturn;\n}\n\n/* This routine checks to see if newstrides (of length nd) will not \n walk outside of the memory implied by a single segment array of the provided \n dimensions and element size. If numbytes is 0 it will be calculated from \n the provided shape and element size.\n*/\n/*OBJECT_API*/\nstatic Bool\nPyArray_CheckStrides(int elsize, int nd, intp numbytes, \n\t\t intp *dims, intp *newstrides)\n{\n\tint i;\n\t\n\tif (numbytes == 0) \n\t\tnumbytes = PyArray_MultiplyList(dims, nd) * elsize;\n\t\n\tfor (i=0; i numbytes) {\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\treturn TRUE;\n\t\n}\n\n\n/* This is the main array creation routine. */\n\n/* Flags argument has multiple related meanings \n depending on data and strides: \n\n If data is given, then flags is flags associated with data. \n If strides is not given, then a contiguous strides array will be created\n and the CONTIGUOUS bit will be set. If the flags argument \n has the FORTRAN bit set, then a FORTRAN-style strides array will be\n created (and of course the FORTRAN flag bit will be set). \n\n If data is not given but created here, then flags will be DEFAULT_FLAGS\n and a non-zero flags argument can be used to indicate a FORTRAN style\n array is desired. \n*/\n\nstatic intp\n_array_fill_strides(intp *strides, intp *dims, int nd, intp itemsize, \n\t\t int inflag, int *objflags) \n{\n\tint i;\n\t/* Only make Fortran strides if not contiguous as well */\n\tif ((inflag & FORTRAN) && !(inflag & CONTIGUOUS)) {\n\t\tfor (i=0; i 1) *objflags &= ~CONTIGUOUS;\n\t\telse *objflags |= CONTIGUOUS;\n\t}\n\telse {\n\t\tfor (i=nd-1;i>=0;i--) {\n\t\t\tstrides[i] = itemsize;\n\t\t\titemsize *= dims[i] ? dims[i] : 1;\n\t\t}\n\t\t*objflags |= CONTIGUOUS;\n\t\tif (nd > 1) *objflags &= ~FORTRAN;\n\t\telse *objflags |= FORTRAN;\n\t}\n\treturn itemsize;\n}\n\n/*OBJECT_API\n Generic new array creation routine.\n*/\nstatic PyObject *\nPyArray_New(PyTypeObject *subtype, int nd, intp *dims, int type_num,\n intp *strides, void *data, int itemsize, int flags,\n\t PyObject *obj)\n{\n\tPyArray_Descr *descr;\n\tPyObject *new;\n\n\tdescr = PyArray_DescrFromType(type_num);\n\tif (descr == NULL) return NULL;\t\n\tif (descr->elsize == 0) {\n\t\tif (itemsize < 1) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"data type must provide an itemsize\");\n\t\t\tPy_DECREF(descr);\n\t\t\treturn NULL;\n\t\t}\n\t\tPyArray_DESCR_REPLACE(descr);\n\t\tdescr->elsize = itemsize;\n\t}\n\tnew = PyArray_NewFromDescr(subtype, descr, nd, dims, strides,\n\t\t\t\t data, flags, obj);\n\treturn new;\n}\n\n/* Change a sub-array field to the base descriptor */\nstatic int\n_update_descr_and_dimensions(PyArray_Descr **des, intp *newdims, \n\t\t\t intp *newstrides, int oldnd)\n{\n\tPyArray_Descr *old;\n\tint newnd;\n\tint numnew;\n\tintp *mydim;\n\tint i;\n\t\n\told = *des;\n\t*des = old->subarray->base;\n\n\tmydim = newdims + oldnd;\n\tif (PyTuple_Check(old->subarray->shape)) {\n\t\tnumnew = PyTuple_GET_SIZE(old->subarray->shape);\n\t\t\n\t\tfor (i=0; isubarray->shape, i));\n\t\t}\n\t}\n\telse {\n\t\tnumnew = 1;\n\t\tmydim[0] = (intp) PyInt_AsLong(old->subarray->shape);\n\t}\n\t\n\tnewnd = oldnd + numnew;\n\n\tif (newstrides) {\n\t\tintp tempsize;\n\t\tintp *mystrides;\n\t\tmystrides = newstrides + oldnd;\n\t\t/* Make new strides */\n\t\ttempsize = (*des)->elsize;\n\t\tfor (i=numnew-1; i>=0; i--) {\n\t\t\tmystrides[i] = tempsize;\n\t\t\ttempsize *= mydim[i] ? mydim[i] : 1;\n\t\t}\n\t}\n\tPy_INCREF(*des); \n\tPy_DECREF(old); \n\treturn newnd;\n}\n\n\n/* steals a reference to descr (even on failure) */\n/*OBJECT_API\n Generic new array creation routine.\n*/\nstatic PyObject *\nPyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd, \n\t\t intp *dims, intp *strides, void *data, \n\t\t int flags, PyObject *obj)\n{\t\n\tPyArrayObject *self;\n\tregister int i;\n\tintp sd;\n\n\tif (descr->subarray) {\n\t\tPyObject *ret;\n\t\tintp newdims[2*MAX_DIMS];\n\t\tintp *newstrides=NULL;\n\t\tmemcpy(newdims, dims, nd*sizeof(intp));\n\t\tif (strides) {\n\t\t\tnewstrides = newdims + MAX_DIMS;\n\t\t\tmemcpy(newstrides, strides, nd*sizeof(intp));\n\t\t}\n\t\tnd =_update_descr_and_dimensions(&descr, newdims, \n\t\t\t\t\t\t newstrides, nd);\n\t\tret = PyArray_NewFromDescr(subtype, descr, nd, newdims, \n\t\t\t\t\t newstrides,\n\t\t\t\t\t data, flags, obj);\n\t\treturn ret;\n\t}\n\n\tif (nd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"number of dimensions must be >=0\");\n\t\tPy_DECREF(descr);\n\t\treturn NULL;\n\t}\n if (nd > MAX_DIMS) {\n PyErr_Format(PyExc_ValueError,\n \"maximum number of dimensions is %d\", MAX_DIMS);\n\t\tPy_DECREF(descr);\n return NULL;\n\t}\n\n\t/* Check dimensions */\n\tfor (i=nd-1;i>=0;i--) {\n\t\tif (dims[i] < 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"negative dimensions \"\t\\\n\t\t\t\t\t\"are not allowed\");\n\t\t\tPy_DECREF(descr);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tself = (PyArrayObject *) subtype->tp_alloc(subtype, 0);\n\tif (self == NULL) {\n\t\tPy_DECREF(descr);\n\t\treturn NULL;\t\n\t}\n\tself->dimensions = NULL;\n\tif (data == NULL) { /* strides is NULL too */\n\t\tself->flags = DEFAULT_FLAGS;\n\t\tif (flags) {\n\t\t\tself->flags |= FORTRAN; \n\t\t\tif (nd > 1) self->flags &= ~CONTIGUOUS;\n\t\t\tflags = FORTRAN;\n\t\t}\n\t}\n\telse self->flags = (flags & ~UPDATEIFCOPY);\n\t\t\n\tsd = descr->elsize;\n\t\n\tif (nd > 0) {\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\tgoto fail;\n\t\t}\n\t\tself->strides = self->dimensions + nd;\n\t\tmemcpy(self->dimensions, dims, sizeof(intp)*nd);\n\t\tif (strides == NULL) { /* fill it in */\n\t\t\tsd = _array_fill_strides(self->strides, dims, nd, sd,\n\t\t\t\t\t\t flags, &(self->flags));\n\t\t}\n\t\telse {\n\t\t\tif (data == NULL) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"if 'strides' is given in \" \\\n\t\t\t\t\t\t\"array creation, data must \" \\\n\t\t\t\t\t\t\"be given too\");\n\t\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t\tself->ob_type->tp_free((PyObject *)self);\n\t\t\t\treturn NULL;\n\t\t\t}\t\t\t\t\n\t\t\tmemcpy(self->strides, strides, sizeof(intp)*nd);\n\t\t}\n\t}\n \t\n\tself->descr = descr;\n\n\t\t\n\tif (data == NULL) {\n\n\t\t/* Allocate something even for zero-space arrays \n\t\t e.g. shape=(0,) -- otherwise buffer exposure \n\t\t (a.data) doesn't work as it should. */\n\n\t\tif (sd==0) sd = sizeof(intp);\n\n\t\tif ((data = PyDataMem_NEW(sd))==NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\tgoto fail;\n\t\t}\n\t\tself->flags |= OWN_DATA;\n\n\t\t/* It is bad to have unitialized OBJECT pointers */\n\t\tif (descr == &OBJECT_Descr) {\n\t\t\tmemset(data, 0, sd);\n\t\t}\n\t}\n\telse {\n self->flags &= ~OWN_DATA; /* If data is passed in, \n\t\t\t\t\t this object won't own it \n\t\t\t\t\t by default.\n\t\t\t\t\t Caller must arrange for \n\t\t\t\t\t this to be reset if truly\n\t\t\t\t\t desired */\n }\n self->data = data;\n\tself->nd = nd;\n\tself->base = (PyObject *)NULL;\n self->weakreflist = (PyObject *)NULL;\n\n /* call the __array_finalize__\n\t method if a subtype and some object passed in */\n\tif ((obj != NULL) && (subtype != &PyArray_Type) && \n\t (subtype != &PyBigArray_Type)) {\n\t\tPyObject *res;\n\t\tif (!(self->flags & OWNDATA)) { /* did not allocate own data */\n\t\t\t /* update flags before calling back into\n\t\t\t Python */\n\t\t\tPyArray_UpdateFlags(self, UPDATE_ALL_FLAGS);\n\t\t}\n\t\tres = PyObject_CallMethod((PyObject *)self, \n\t\t\t\t\t \"__array_finalize__\",\n\t\t\t\t\t \"O\", obj);\n\t\tif (res == NULL) {\n\t\t\tif (self->flags & OWNDATA) PyDataMem_FREE(self);\n\t\t\tPyDimMem_FREE(self->dimensions);\n\t\t\t/* theoretically should free self\n\t\t\t but this causes segmentation faults...\n\t\t\t Not sure why */\n\t\t\treturn NULL;\n\t\t}\n\t\telse Py_DECREF(res);\n\t}\n\n\treturn (PyObject *)self;\n\n fail:\n\tPy_DECREF(descr);\n\tPyDimMem_FREE(self->dimensions);\n\tsubtype->tp_free((PyObject *)self);\n\treturn NULL;\n\n}\n\n\n\n/*OBJECT_API\n Resize (reallocate data). Only works if nothing else is referencing\n this array and it is contiguous.\n*/\nstatic PyObject * \nPyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape)\n{\n intp oldsize, newsize;\n int new_nd=newshape->len, k, n, elsize;\n int refcnt;\n intp* new_dimensions=newshape->ptr;\n intp new_strides[MAX_DIMS];\n intp sd;\n intp *dimptr;\n char *new_data;\n\t\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \n \"resize only works on contiguous arrays\");\n return NULL;\n }\n\n\n newsize = PyArray_MultiplyList(new_dimensions, new_nd);\n\n if (newsize == 0) {\n PyErr_SetString(PyExc_ValueError, \n \"newsize is zero; cannot delete an array \"\\\n \"in this way\");\n return NULL;\n }\n oldsize = PyArray_SIZE(self);\n \n\tif (oldsize != newsize) {\n\t\tif (!(self->flags & OWN_DATA)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"cannot resize this array: \"\t\\\n\t\t\t\t\t\"it does not own its data\");\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\trefcnt = REFCOUNT(self);\n\t\tif ((refcnt > 2) || (self->base != NULL) || \\\n\t\t (self->weakreflist != NULL)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"cannot resize an array that has \"\\\n\t\t\t\t\t\"been referenced or is referencing\\n\"\\\n\t\t\t\t\t\"another array in this way. Use the \"\\\n\t\t\t\t\t\"resize function\");\n\t\t\treturn NULL;\n\t\t} \n\t\t\n\t\t/* Reallocate space if needed */\n\t\tnew_data = PyDataMem_RENEW(self->data, \n\t\t\t\t\t newsize*(self->descr->elsize));\n\t\tif (new_data == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n\t\t\t\t\t\"cannot allocate memory for array\");\n\t\t\treturn NULL;\n\t\t}\n\t\tself->data = new_data;\n\t}\n \n if ((newsize > oldsize) && PyArray_ISWRITEABLE(self)) { \n\t\t/* Fill new memory with zeros */\n elsize = self->descr->elsize;\n\t\tif ((PyArray_TYPE(self) == PyArray_OBJECT)) {\n\t\t\tPyObject *zero = PyInt_FromLong(0);\n PyObject **optr;\n\t\t\toptr = ((PyObject **)self->data) + oldsize;\n\t\t\tn = newsize - oldsize;\n\t\t\tfor (k=0; kdata+oldsize*elsize, 0, \n\t\t\t (newsize-oldsize)*elsize);\n\t\t}\n\t}\n \n if (self->nd != new_nd) { /* Different number of dimensions. */\n self->nd = new_nd;\n \n /* Need new dimensions and strides arrays */\n dimptr = PyDimMem_RENEW(self->dimensions, 2*new_nd);\n if (dimptr == NULL) {\n\t\t\tPyErr_SetString(PyExc_MemoryError, \n \"cannot allocate memory for array \" \\\n \"(array may be corrupted)\");\n return NULL;\n }\n self->dimensions = dimptr;\n\t\tself->strides = dimptr + new_nd;\n }\n\n /* make new_strides variable */\n sd = (intp) self->descr->elsize;\n sd = _array_fill_strides(new_strides, new_dimensions, new_nd, sd,\n 0, &(self->flags));\n\n \n memmove(self->dimensions, new_dimensions, new_nd*sizeof(intp));\n memmove(self->strides, new_strides, new_nd*sizeof(intp));\n\n Py_INCREF(Py_None);\t\n return Py_None;\n \n}\n\n\n/* Assumes contiguous */\n/*OBJECT_API*/\nstatic void\nPyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj)\n{\n PyObject **optr;\n intp i,n;\n optr = (PyObject **)(arr->data);\n n = PyArray_SIZE(arr);\n if (obj == NULL) {\n for (i=0; ielsize;\n\tPy_INCREF(descr);\n\tnewarr = PyArray_FromAny(obj, descr, 0,0, ALIGNED);\n\tif (newarr == NULL) return -1;\n\tfromptr = PyArray_DATA(newarr);\n\tsize=PyArray_SIZE(arr);\n\tswap=!PyArray_ISNOTSWAPPED(arr);\n\tcopyswap = arr->descr->f->copyswap;\n\tif (PyArray_ISONESEGMENT(arr)) {\n\t\tchar *toptr=PyArray_DATA(arr);\n\t\twhile (size--) {\n\t\t\tcopyswap(toptr, fromptr, swap, itemsize);\n\t\t\ttoptr += itemsize;\n\t\t}\n\t}\n\telse {\n\t\tPyArrayIterObject *iter;\n\t\t\n\t\titer = (PyArrayIterObject *)\\\n\t\t\tPyArray_IterNew((PyObject *)arr);\n\t\tif (iter == NULL) {\n\t\t\tPy_DECREF(newarr);\n\t\t\treturn -1;\n\t\t}\n\t\twhile(size--) {\n\t\t\tcopyswap(iter->dataptr, fromptr, swap, itemsize);\n\t\t\tPyArray_ITER_NEXT(iter);\n\t\t}\n\t\tPy_DECREF(iter);\n\t}\n\tPy_DECREF(newarr);\n\treturn 0;\n}\n\nstatic PyObject *\narray_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\", \"dtype\", \"buffer\", \n\t\t\t\t \"offset\", \"strides\",\n\t\t\t\t \"fortran\", NULL};\n\tPyArray_Descr *descr=NULL;\n\tint type_num;\n\tint itemsize;\n PyArray_Dims dims = {NULL, 0};\n PyArray_Dims strides = {NULL, 0};\n PyArray_Chunk buffer;\n\tlonglong offset=0;\n\tint fortran = 0;\n\tPyArrayObject *ret;\n\n\tbuffer.ptr = NULL; \n /* Usually called with shape and type\n but can also be called with buffer, strides, and swapped info\n */\n\n\t/* For now, let's just use this to create an empty, contiguous \n\t array of a specific type and shape. \n\t*/\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&LO&i\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &dims, \n PyArray_DescrConverter,\n\t\t\t\t\t &descr,\n PyArray_BufferConverter,\n &buffer,\n\t\t\t\t\t &offset,\n &PyArray_IntpConverter, \n &strides,\n &fortran)) \n\t\tgoto fail;\n\t\n\ttype_num = descr->type_num;\n\titemsize = descr->elsize;\t\n\n if (dims.ptr == NULL) {\n PyErr_SetString(PyExc_ValueError, \"need to give a \"\\\n \"valid shape as the first argument\");\n goto fail;\n }\n if (buffer.ptr == NULL) {\n ret = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(subtype, descr,\n\t\t\t\t\t (int)dims.len, \n\t\t\t\t\t dims.ptr, \n\t\t\t\t\t NULL, NULL, fortran, NULL);\n if (ret == NULL) {descr=NULL;goto fail;}\n if (type_num == PyArray_OBJECT) { /* place Py_None */\n PyArray_FillObjectArray(ret, Py_None);\n }\n }\n else { /* buffer given -- use it */\n\t\tbuffer.len -= offset;\n\t\tbuffer.ptr += offset;\n if (dims.len == 1 && dims.ptr[0] == -1) {\n dims.ptr[0] = buffer.len / itemsize;\n }\n else if (buffer.len < itemsize* \\\n PyArray_MultiplyList(dims.ptr, dims.len)) {\n PyErr_SetString(PyExc_TypeError, \n \"buffer is too small for \" \\\n \"requested array\");\n goto fail;\n }\n if (strides.ptr != NULL) {\n\t\t\tif (strides.len != dims.len) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"strides, if given, must be \"\\\n\t\t\t\t\t\t\"the same length as shape\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tif (!PyArray_CheckStrides(itemsize, strides.len, \n\t\t\t\t\t\t buffer.len,\n\t\t\t\t\t\t dims.ptr, strides.ptr)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"strides is incompatible \"\\\n\t\t\t\t\t\t\"with shape of requested\"\\\n\t\t\t\t\t\t\"array and size of buffer\");\n\t\t\t\tgoto fail;\n\t\t\t}\n }\n if (type_num == PyArray_OBJECT) {\n PyErr_SetString(PyExc_TypeError, \"cannot construct \"\\\n \"an object array from buffer data\");\n goto fail;\n }\n /* get writeable and aligned */\n if (fortran) buffer.flags |= FORTRAN;\n ret = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(subtype, descr,\n\t\t\t\t\t dims.len, dims.ptr,\n\t\t\t\t\t strides.ptr,\n\t\t\t\t\t (char *)buffer.ptr, \n\t\t\t\t\t buffer.flags, NULL); \n if (ret == NULL) {descr=NULL; goto fail;}\n PyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n ret->base = buffer.base;\n Py_INCREF(buffer.base); \n }\n\n PyDimMem_FREE(dims.ptr);\n if (strides.ptr) PyDimMem_FREE(strides.ptr);\n return (PyObject *)ret;\n \n fail:\n\tPy_XDECREF(descr);\n if (dims.ptr) PyDimMem_FREE(dims.ptr);\n if (strides.ptr) PyDimMem_FREE(strides.ptr);\n return NULL;\n}\n\n\nstatic PyObject *\narray_iter(PyArrayObject *arr)\n{\n\tif (arr->nd == 0) {\n\t\tPyErr_SetString(PyExc_TypeError,\n\t\t\t\t\"iteration over a scalar (0-dim array)\");\n\t\treturn NULL;\n\t}\n\treturn PySeqIter_New((PyObject *)arr);\n}\n\n\n/******************* array attribute get and set routines ******************/\n\nstatic PyObject *\narray_ndim_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong(self->nd);\n}\n\nstatic PyObject *\narray_flags_get(PyArrayObject *self)\n{\n return PyObject_CallMethod(_numpy_internal, \"flagsobj\", \"Oii\", \n self, self->flags, 0);\n}\n\nstatic PyObject *\narray_shape_get(PyArrayObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->dimensions);\n}\n\n\nstatic int\narray_shape_set(PyArrayObject *self, PyObject *val)\n{\n \tint nd;\n\tPyObject *ret;\n\n\tret = PyArray_Reshape(self, val);\n\tif (ret == NULL) return -1;\n\n\t/* Free old dimensions and strides */\n\tPyDimMem_FREE(self->dimensions);\n\tnd = PyArray_NDIM(ret);\n\tself->nd = nd;\n\tif (nd > 0) { /* create new dimensions and strides */\n\t\tself->dimensions = PyDimMem_NEW(2*nd);\n\t\tif (self->dimensions == NULL) {\n\t\t\tPy_DECREF(ret);\n\t\t\tPyErr_SetString(PyExc_MemoryError,\"\");\n\t\t\treturn -1;\n\t\t}\n\t\tself->strides = self->dimensions + nd;\n\t\tmemcpy(self->dimensions, PyArray_DIMS(ret), \n\t\t nd*sizeof(intp));\n\t\tmemcpy(self->strides, PyArray_STRIDES(ret), \n\t\t nd*sizeof(intp));\n\t}\n\telse {self->dimensions=NULL; self->strides=NULL;}\n\tPy_DECREF(ret);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\treturn 0;\n}\n\n\nstatic PyObject *\narray_strides_get(PyArrayObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->strides);\n}\n\nstatic int\narray_strides_set(PyArrayObject *self, PyObject *obj)\n{\n\tPyArray_Dims newstrides = {NULL, 0};\n\tPyArrayObject *new;\n\tintp numbytes;\n\n\tif (!PyArray_IntpConverter(obj, &newstrides) || \\\n\t newstrides.ptr == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \"invalid strides\");\n\t\treturn -1;\n\t}\n\tif (newstrides.len != self->nd) {\n\t\tPyErr_Format(PyExc_ValueError, \"strides must be \"\t\\\n\t\t\t \" same length as shape (%d)\", self->nd);\n\t\tgoto fail;\n\t}\n\tnew = self;\n\twhile(new->base != NULL) {\n\t\tif (PyArray_Check(new->base)) \n\t\t\tnew = (PyArrayObject *)new->base;\n\t}\n\tnumbytes = PyArray_MultiplyList(new->dimensions, \n\t\t\t\t\tnew->nd)*new->descr->elsize;\n\t\n\tif (!PyArray_CheckStrides(self->descr->elsize, self->nd, numbytes, \n\t\t\t\t self->dimensions, newstrides.ptr)) {\n\t\tPyErr_SetString(PyExc_ValueError, \"strides is not \"\\\n\t\t\t\t\"compatible with available memory\");\n\t\tgoto fail;\n\t}\n\tmemcpy(self->strides, newstrides.ptr, sizeof(intp)*newstrides.len);\n\tPyArray_UpdateFlags(self, CONTIGUOUS | FORTRAN);\n\tPyDimMem_FREE(newstrides.ptr);\n\treturn 0;\n\n fail:\n\tPyDimMem_FREE(newstrides.ptr);\n\treturn -1;\n}\n\n\nstatic PyObject *\narray_protocol_strides_get(PyArrayObject *self)\n{\n\tif PyArray_ISCONTIGUOUS(self) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn PyArray_IntTupleFromIntp(self->nd, self->strides);\n}\n\nstatic PyObject *\narray_priority_get(PyArrayObject *self)\n{\n\tif (PyArray_CheckExact(self)) \n\t\treturn PyFloat_FromDouble(PyArray_PRIORITY);\n\telse if (PyBigArray_CheckExact(self)) \n\t\treturn PyFloat_FromDouble(PyArray_BIG_PRIORITY);\n\telse\n\t\treturn PyFloat_FromDouble(PyArray_SUBTYPE_PRIORITY);\n}\n\n\nstatic PyObject *\narray_dataptr_get(PyArrayObject *self)\n{\n\treturn Py_BuildValue(\"NO\",\n\t\t\t PyString_FromFormat(\"%p\", self->data),\n\t\t\t (self->flags & WRITEABLE ? Py_False :\n\t\t\t Py_True));\n}\n\nstatic PyObject *\narray_data_get(PyArrayObject *self)\n{\n\tintp nbytes;\n\tif (!(PyArray_ISONESEGMENT(self))) {\n\t\tPyErr_SetString(PyExc_AttributeError, \"cannot get single-\"\\\n\t\t\t\t\"segment buffer for discontiguous array\");\n\t\treturn NULL;\n\t}\t\t\n\tnbytes = PyArray_NBYTES(self);\n\tif PyArray_ISWRITEABLE(self) \n\t\treturn PyBuffer_FromReadWriteObject((PyObject *)self, 0, \n\t\t\t\t\t\t (int) nbytes);\n\telse\n\t\treturn PyBuffer_FromObject((PyObject *)self, 0, (int) nbytes);\n}\n\nstatic int\narray_data_set(PyArrayObject *self, PyObject *op)\n{\n\tvoid *buf;\n\tint buf_len;\n\tint writeable=1;\n\n\tif (PyObject_AsWriteBuffer(op, &buf, &buf_len) < 0) {\n\t\twriteable = 0;\n\t\tif (PyObject_AsReadBuffer(op, (const void **)&buf, \n\t\t\t\t\t &buf_len) < 0) {\n\t\t\tPyErr_SetString(PyExc_AttributeError, \n\t\t\t\t\t\"object does not have single-segment \" \\\n\t\t\t\t\t\"buffer interface\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\tif (!PyArray_ISONESEGMENT(self)) {\n\t\tPyErr_SetString(PyExc_AttributeError, \"cannot set single-\" \\\n\t\t\t\t\"segment buffer for discontiguous array\");\n\t\treturn -1;\n\t}\n\tif (PyArray_NBYTES(self) > buf_len) {\n\t\tPyErr_SetString(PyExc_AttributeError, \n\t\t\t\t\"not enough data for array\");\n\t\treturn -1;\n\t}\n\tif (self->flags & OWN_DATA) {\n\t\tPyArray_XDECREF(self);\n\t\tPyDataMem_FREE(self->data);\n\t}\n\tif (self->base) {\n\t\tif (self->flags & UPDATEIFCOPY) {\n\t\t\t((PyArrayObject *)self->base)->flags |= WRITEABLE;\n\t\t\tself->flags &= ~UPDATEIFCOPY;\n\t\t}\n\t\tPy_DECREF(self->base);\n\t}\n\tPy_INCREF(op);\n\tself->base = op;\n\tself->data = buf;\n\tself->flags = CARRAY_FLAGS;\n\tif (!writeable)\n\t\tself->flags &= ~WRITEABLE;\n\treturn 0;\n}\n\n\nstatic PyObject *\narray_itemsize_get(PyArrayObject *self)\n{\n\treturn PyInt_FromLong((long) self->descr->elsize);\n}\n\nstatic PyObject *\narray_size_get(PyArrayObject *self)\n{\n\tintp size=PyArray_SIZE(self);\n#if SIZEOF_INTP <= SIZEOF_LONG\n return PyInt_FromLong((long) size);\n#else\n\tif (size > MAX_LONG || size < MIN_LONG)\n\t\treturn PyLong_FromLongLong(size);\n\telse \n\t\treturn PyInt_FromLong((long) size);\n#endif\n}\n\nstatic PyObject *\narray_nbytes_get(PyArrayObject *self)\n{\n intp nbytes = PyArray_NBYTES(self);\n#if SIZEOF_INTP <= SIZEOF_LONG\n return PyInt_FromLong((long) nbytes);\n#else\n\tif (nbytes > MAX_LONG || nbytes < MIN_LONG)\n\t\treturn PyLong_FromLongLong(nbytes);\n\telse \n\t\treturn PyInt_FromLong((long) nbytes);\n#endif\n}\n\n\nstatic PyObject *\narray_typechar_get(PyArrayObject *self)\n{\n\tif PyArray_ISEXTENDED(self) \n\t\treturn PyString_FromFormat(\"%c%d\", (self->descr->type),\n\t\t\t\t\t self->descr->elsize);\n\telse \n\t\treturn PyString_FromStringAndSize(&(self->descr->type), 1);\n}\n\nstatic PyObject *arraydescr_protocol_typestr_get(PyArray_Descr *);\n\nstatic PyObject *\narray_typestr_get(PyArrayObject *self)\n{\n\treturn arraydescr_protocol_typestr_get(self->descr);\n}\n\nstatic PyObject *\narray_descr_get(PyArrayObject *self) \n{\n\tPy_INCREF(self->descr);\n\treturn (PyObject *)self->descr;\n}\n\n\n/* If the type is changed. \n Also needing change: strides, itemsize\n\n Either itemsize is exactly the same\n or the array is single-segment (contiguous or fortran) with\n compatibile dimensions\n\n The shape and strides will be adjusted in that case as well.\n*/\n\nstatic int\narray_descr_set(PyArrayObject *self, PyObject *arg)\n{\n PyArray_Descr *newtype=NULL;\n intp newdim;\n int index;\n char *msg = \"new type not compatible with array.\";\n\n if (!(PyArray_DescrConverter(arg, &newtype)) ||\n newtype == NULL) {\n PyErr_SetString(PyExc_TypeError, \"invalid type for array\");\n\t\treturn -1;\n }\n\tif (newtype->type_num == PyArray_OBJECT || \\\n\t self->descr->type_num == PyArray_OBJECT) {\n\t\tPyErr_SetString(PyExc_TypeError, \\\n\t\t\t\t\"Cannot change descriptor for object\"\\\n\t\t\t\t\"array.\");\n\t\tPy_DECREF(newtype);\n\t\treturn -1;\n\t}\n\n\tif ((newtype->elsize != self->descr->elsize) &&\t\t\\\n\t (self->nd == 0 || !PyArray_ISONESEGMENT(self) || \\\n\t newtype->subarray)) goto fail;\n\t\n\tif (PyArray_ISCONTIGUOUS(self)) index = self->nd - 1;\n\telse index = 0;\n\t\n\tif (newtype->elsize < self->descr->elsize) {\n\t\t/* if it is compatible increase the size of the \n\t\t dimension at end (or at the front for FORTRAN)\n\t\t*/\n\t\tif (self->descr->elsize % newtype->elsize != 0) \n\t\t\tgoto fail;\n\t\tnewdim = self->descr->elsize / newtype->elsize;\n\t\tself->dimensions[index] *= newdim;\n\t\tself->strides[index] = newtype->elsize;\n\t}\n\t\n\telse if (newtype->elsize > self->descr->elsize) {\n\t\t\n\t\t/* Determine if last (or first if FORTRAN) dimension\n\t\t is compatible */\n\t\t\n\t\tnewdim = self->dimensions[index] * self->descr->elsize;\n\t\tif ((newdim % newtype->elsize) != 0) goto fail;\n\t\t\n\t\tself->dimensions[index] = newdim / newtype->elsize;\n\t\tself->strides[index] = newtype->elsize;\n\t}\n\n /* fall through -- adjust type*/\n\n\tPy_DECREF(self->descr);\n\tif (newtype->subarray) {\n\t\t/* create new array object from data and update \n\t\t dimensions, strides and descr from it */\n\t\tPyArrayObject *temp;\n\n\t\ttemp = (PyArrayObject *)\\\n\t\t\tPyArray_NewFromDescr(&PyArray_Type, newtype, self->nd,\n\t\t\t\t\t self->dimensions, self->strides,\n\t\t\t\t\t self->data, self->flags, NULL);\n\t\tPyDimMem_FREE(self->dimensions);\n\t\tself->dimensions = temp->dimensions;\n\t\tself->nd = temp->nd;\n\t\tself->strides = temp->strides;\n\t\tPy_DECREF(newtype);\n\t\tnewtype = temp->descr;\n\t\t/* Fool deallocator */\n\t\ttemp->nd = 0;\n\t\ttemp->dimensions = NULL;\n\t\ttemp->descr = NULL;\n\t\tPy_DECREF(temp);\n\t}\n\n\tself->descr = newtype; \n\tPyArray_UpdateFlags(self, UPDATE_ALL_FLAGS);\n\t\n return 0;\n\n fail:\n\tPyErr_SetString(PyExc_ValueError, msg);\n\tPy_DECREF(newtype);\n\treturn -1;\n}\n\nstatic PyObject *\narray_protocol_descr_get(PyArrayObject *self)\n{\n\tPyObject *res;\n\tPyObject *dobj;\n\t\n\tres = PyObject_GetAttrString((PyObject *)self->descr, \"arrdescr\");\n\tif (res) return res;\n\tPyErr_Clear();\n\n\t/* get default */\n\tdobj = PyTuple_New(2);\n\tif (dobj == NULL) return NULL;\n\tPyTuple_SET_ITEM(dobj, 0, PyString_FromString(\"\"));\n\tPyTuple_SET_ITEM(dobj, 1, array_typestr_get(self));\n\tres = PyList_New(1);\n\tif (res == NULL) {Py_DECREF(dobj); return NULL;}\n\tPyList_SET_ITEM(res, 0, dobj);\n\treturn res;\n}\n\nstatic PyObject *\narray_struct_get(PyArrayObject *self)\n{\n PyArrayInterface *inter;\n \n inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface));\n inter->version = 2;\n inter->nd = self->nd;\n inter->typekind = self->descr->kind;\n inter->itemsize = self->descr->elsize;\n inter->flags = self->flags;\n /* reset unused flags */\n\tinter->flags &= ~(UPDATEIFCOPY | OWNDATA); \n\tif (PyArray_ISNOTSWAPPED(self)) inter->flags |= NOTSWAPPED;\n inter->strides = self->strides;\n inter->shape = self->dimensions;\n inter->data = self->data;\n\tPy_INCREF(self);\n return PyCObject_FromVoidPtrAndDesc(inter, self, gentype_struct_free);\n}\n\nstatic PyObject *\narray_type_get(PyArrayObject *self)\n{\n Py_INCREF(self->descr->typeobj);\n return (PyObject *)self->descr->typeobj;\n}\n\n\n\nstatic PyObject *\narray_base_get(PyArrayObject *self)\n{\n\tif (self->base == NULL) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\telse {\n\t\tPy_INCREF(self->base);\n\t\treturn self->base;\n\t}\n}\n\n\nstatic PyObject *\narray_real_get(PyArrayObject *self)\n{\n\tPyArrayObject *ret;\n\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n\t\t\t\t\t\t self->data,\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) return NULL;\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\treturn (PyObject *)ret;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *)self;\n\t}\n}\n\n\nstatic int\narray_real_set(PyArrayObject *self, PyObject *val)\n{\n\tPyArrayObject *ret;\n\tPyArrayObject *new;\n\tint rint;\n\n\tnew = (PyArrayObject *)PyArray_FromAny(val, NULL, 0, 0, 0);\n\tif (new == NULL) return -1;\n\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n\t\t\t\t\t\t self->data,\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) {Py_DECREF(new); return -1;}\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\tret = self;\n\t}\t\n\trint = PyArray_CopyInto(ret, new);\n\tPy_DECREF(ret);\n\tPy_DECREF(new);\n\treturn rint;\n}\n\nstatic PyObject *\narray_imag_get(PyArrayObject *self)\n{\t\n\tPyArrayObject *ret;\n PyArray_Descr *type;\n\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\ttype = PyArray_DescrFromType(self->descr->type_num - \n\t\t\t\t\t PyArray_NUM_FLOATTYPE);\n\t\tret = (PyArrayObject *)\t\t\t\t\\\n\t\t\tPyArray_NewFromDescr(self->ob_type,\n\t\t\t\t\t type,\n\t\t\t\t\t self->nd,\n\t\t\t\t\t self->dimensions,\n\t\t\t\t\t self->strides,\n\t\t\t\t\t self->data + type->elsize,\n\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) return NULL;\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\treturn (PyObject *) ret;\n\t}\n\telse {\n\t\ttype = self->descr;\n\t\tPy_INCREF(type);\n\t\tret = (PyArrayObject *)PyArray_Zeros(self->nd, \n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t type, \n\t\t\t\t\t\t PyArray_ISFORTRAN(self));\n\t\tret->flags &= ~WRITEABLE;\n\t\treturn (PyObject *)ret;\n\t}\n}\n\nstatic int\narray_imag_set(PyArrayObject *self, PyObject *val)\n{\t\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tPyArrayObject *ret;\n\t\tPyArrayObject *new;\n\t\tint rint;\n\n\t\tnew = (PyArrayObject *)PyArray_FromAny(val, NULL, 0, 0, 0); \n\t\tif (new == NULL) return -1;\n\t\tret = (PyArrayObject *)PyArray_New(self->ob_type,\n\t\t\t\t\t\t self->nd,\n\t\t\t\t\t\t self->dimensions,\n\t\t\t\t\t\t self->descr->type_num - \\\n\t\t\t\t\t\t PyArray_NUM_FLOATTYPE,\n\t\t\t\t\t\t self->strides,\n \t\t\t\t\t\t self->data +\t\t\\\n\t\t\t\t\t\t (self->descr->elsize >> 1),\n\t\t\t\t\t\t 0,\n\t\t\t\t\t\t self->flags, (PyObject *)self);\n\t\tif (ret == NULL) {\n\t\t\tPy_DECREF(new); \n\t\t\treturn -1;\n\t\t}\n\t\tret->flags &= ~CONTIGUOUS;\n\t\tret->flags &= ~FORTRAN;\n\t\tPy_INCREF(self);\n\t\tret->base = (PyObject *)self;\n\t\trint = PyArray_CopyInto(ret, new);\n\t\tPy_DECREF(ret);\t\t\n\t\tPy_DECREF(new);\n\t\treturn rint;\n\t}\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError, \"does not have imaginary \" \\\n\t\t\t\t\"part to set\");\n\t\treturn -1;\n\t}\n}\n\nstatic PyObject *\narray_flat_get(PyArrayObject *self)\n{\n return PyArray_IterNew((PyObject *)self);\n}\n\nstatic int \narray_flat_set(PyArrayObject *self, PyObject *val)\n{\n\tPyObject *arr=NULL;\n\tint retval = -1;\n\tPyArrayIterObject *selfit=NULL, *arrit=NULL;\n\tPyArray_Descr *typecode;\n int swap;\n PyArray_CopySwapFunc *copyswap;\n\n\ttypecode = self->descr;\n\tPy_INCREF(typecode);\n\tarr = PyArray_FromAny(val, typecode, \n\t\t\t 0, 0, FORCECAST | FORTRAN_IF(self));\n\tif (arr == NULL) return -1;\n\tarrit = (PyArrayIterObject *)PyArray_IterNew(arr);\n\tif (arrit == NULL) goto exit;\n\tselfit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\tif (selfit == NULL) goto exit;\n\n swap = PyArray_ISNOTSWAPPED(self) != PyArray_ISNOTSWAPPED(arr);\n copyswap = self->descr->f->copyswap;\n if (PyArray_ISOBJECT(self)) {\n while(selfit->index < selfit->size) {\n Py_XDECREF(*((PyObject **)selfit->dataptr));\n Py_INCREF(*((PyObject **)arrit->dataptr)); \n memmove(selfit->dataptr, arrit->dataptr, \n sizeof(PyObject *));\n PyArray_ITER_NEXT(selfit);\n PyArray_ITER_NEXT(arrit);\n if (arrit->index == arrit->size) \n PyArray_ITER_RESET(arrit);\n }\n retval = 0; \n goto exit;\n }\n\n\twhile(selfit->index < selfit->size) {\n\t\tmemmove(selfit->dataptr, arrit->dataptr, self->descr->elsize);\n copyswap(selfit->dataptr, NULL, swap, self->descr->elsize);\n\t\tPyArray_ITER_NEXT(selfit);\n\t\tPyArray_ITER_NEXT(arrit);\n\t\tif (arrit->index == arrit->size) \n\t\t\tPyArray_ITER_RESET(arrit);\n\t}\n\tretval = 0;\n exit:\n\tPy_XDECREF(selfit);\n\tPy_XDECREF(arrit);\n\tPy_XDECREF(arr);\n\treturn retval;\n}\n\nstatic PyGetSetDef array_getsetlist[] = {\n {\"ndim\", \n\t (getter)array_ndim_get, \n\t NULL, \n\t \"number of array dimensions\"},\n {\"flags\", \n\t (getter)array_flags_get, \n NULL,\n\t \"special dictionary of flags\"},\n {\"shape\", \n\t (getter)array_shape_get, \n\t (setter)array_shape_set, \n\t \"tuple of array dimensions\"},\n {\"strides\", \n\t (getter)array_strides_get, \n\t (setter)array_strides_set,\n\t \"tuple of bytes steps in each dimension\"},\n {\"data\", \n\t (getter)array_data_get, \n\t (setter)array_data_set, \n\t \"pointer to start of data\"},\n {\"itemsize\", \n\t (getter)array_itemsize_get, \n\t NULL,\n\t \"length of one element in bytes\"},\n {\"size\",\n (getter)array_size_get,\n\t NULL,\n \"number of elements in the array\"},\n {\"nbytes\",\n (getter)array_nbytes_get,\n NULL,\n \"number of bytes in the array\"},\n\t{\"base\",\n\t (getter)array_base_get,\n\t NULL,\n\t \"base object\"},\n {\"dtype\", \n\t (getter)array_type_get, \n\t NULL,\n\t \"get array type class\"},\n\t{\"dtypechar\",\n\t (getter)array_typechar_get,\n\t NULL,\n\t \"get array type character code\"},\n\t{\"dtypestr\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"get array type string\"},\n\t{\"dtypedescr\", \n\t (getter)array_descr_get,\n\t (setter)array_descr_set,\n\t \"get(set) data-type-descriptor for array\"},\n {\"real\", \n\t (getter)array_real_get, \n\t (setter)array_real_set, \n\t \"real part of array\"},\n {\"imag\", \n\t (getter)array_imag_get, \n\t (setter)array_imag_set, \n\t \"imaginary part of array\"},\n\t{\"flat\", \n\t (getter)array_flat_get, \n\t (setter)array_flat_set, \n\t \"a 1-d view of a contiguous array\"}, \n\t{\"__array_data__\", \n\t (getter)array_dataptr_get,\n\t NULL,\n\t \"Array protocol: data\"},\n\t{\"__array_typestr__\",\n\t (getter)array_typestr_get,\n\t NULL,\n\t \"Array protocol: typestr\"},\n\t{\"__array_descr__\",\n\t (getter)array_protocol_descr_get,\n\t NULL,\n\t \"Array protocol: descr\"},\n\t{\"__array_shape__\", \n\t (getter)array_shape_get,\n\t NULL,\n\t \"Array protocol: shape\"},\n\t{\"__array_strides__\",\n\t (getter)array_protocol_strides_get,\n\t NULL,\n\t \"Array protocol: strides\"},\n {\"__array_struct__\",\n (getter)array_struct_get,\n NULL,\n \"Array protocol: struct\"},\n\t{\"__array_priority__\",\n\t (getter)array_priority_get,\n\t NULL,\n\t \"Array priority\"},\n \t{NULL, NULL, NULL, NULL}, /* Sentinel */\n};\n\n/****************** end of attribute get and set routines *******************/\n\n\nstatic PyObject *\narray_alloc(PyTypeObject *type, int nitems)\n{\n PyObject *obj;\n /* nitems will always be 0 */ \n obj = (PyObject *)_pya_malloc(sizeof(PyArrayObject));\n PyObject_Init(obj, type);\n return obj;\n}\n\n\nstatic char Arraytype__doc__[] = \n \"A array object represents a multidimensional, homogeneous array\\n\"\n\t\" of fixed-size items. An associated data-type-descriptor object\\n\"\n\t\" details the data-type in an array (including byteorder and any\\n\"\n\t\" fields). An array can be constructed using the numpy.array\\n\"\n\t\" command. Arrays are sequence, mapping and numeric objects.\\n\"\n\t\" More information is available in the numpy module and by looking\\n\"\n\t\" at the methods and attributes of an array.\\n\\n\"\n\t\" ndarray.__new__(subtype, shape=, dtype=int_, buffer=None, \\n\"\n\t\" offset=0, strides=None, fortran=False)\\n\\n\"\n\t\" There are two modes of creating an array using __new__:\\n\"\n\t\" 1) If buffer is None, then only shape, dtype, and fortran \\n\"\n\t\" are used\\n\"\n\t\" 2) If buffer is an object exporting the buffer interface, then\\n\"\n\t\" all keywords are interpreted.\\n\"\n\t\" The dtype parameter can be any object that can be interpreted \\n\"\n\t\" as a numpy.dtypedescr object.\\n\\n\"\n\t\" No __init__ method is needed because the array is fully \\n\"\n\t\" initialized after the __new__ method.\";\n\t\nstatic PyTypeObject PyBigArray_Type = { \n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /*ob_size*/\n \"numpy.bigndarray\",\t\t /*tp_name*/\n sizeof(PyArrayObject),\t\t /*tp_basicsize*/\n 0,\t\t\t\t\t /*tp_itemsize*/\n /* methods */\n (destructor)array_dealloc,\t\t /*tp_dealloc */\n (printfunc)NULL,\t\t\t /*tp_print*/\n 0,\t\t\t\t\t /*tp_getattr*/\n 0,\t\t\t\t\t /*tp_setattr*/\n (cmpfunc)0, \t\t /*tp_compare*/\n (reprfunc)array_repr,\t\t /*tp_repr*/\n &array_as_number,\t\t\t /*tp_as_number*/\n NULL, \t\t\t /*tp_as_sequence*/\n &array_as_mapping,\t\t\t /*tp_as_mapping*/\n (hashfunc)0,\t\t\t /*tp_hash*/\n (ternaryfunc)0,\t\t\t /*tp_call*/\n (reprfunc)array_str, \t /*tp_str*/\n\t\t\n (getattrofunc)0,\t\t\t /*tp_getattro*/\n (setattrofunc)0,\t\t\t /*tp_setattro*/\n NULL, \t /*tp_as_buffer*/\n (Py_TPFLAGS_DEFAULT \n | Py_TPFLAGS_BASETYPE\n | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/\n /*Documentation string */\n Arraytype__doc__,\t\t\t /*tp_doc*/\n\n (traverseproc)0,\t\t\t /*tp_traverse */\n (inquiry)0,\t\t\t /*tp_clear */\n (richcmpfunc)array_richcompare,\t \n offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */\n\n /* Iterator support (use standard) */\n\n (getiterfunc)array_iter, \t /* tp_iter */\n (iternextfunc)0,\t\t\t /* tp_iternext */\n\n /* Sub-classing (new-style object) support */\n\n array_methods,\t\t\t /* tp_methods */\n 0,\t\t\t\t\t /* tp_members */\n array_getsetlist,\t\t /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n array_alloc,\t /* tp_alloc */ \n (newfunc)array_new,\t\t /* tp_new */\n _pya_free, \t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n\n/* A standard array will subclass from the Big Array and \n add the array_as_sequence table\n and the array_as_buffer table\n */\n\nstatic PyTypeObject PyArray_Type = { \n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /*ob_size*/\n \"numpy.ndarray\",\t\t\t /*tp_name*/\n sizeof(PyArrayObject),\t\t /*tp_basicsize*/\n 0,\t\t\t\t\t /*tp_itemsize*/\n};\n\n\n/* The rest of this code is to build the right kind of array from a python */\n/* object. */\n\nstatic int \ndiscover_depth(PyObject *s, int max, int stop_at_string, int stop_at_tuple) \n{\n int d=0;\n PyObject *e;\n\t\n if(max < 1) return -1;\n\n if(! PySequence_Check(s) || PyInstance_Check(s) || \\\n\t PySequence_Length(s) < 0) {\n PyErr_Clear(); return 0;\n }\n if (PyArray_Check(s))\n\t\treturn PyArray_NDIM(s);\n if(PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s))\n\t\treturn stop_at_string ? 0:1;\n\tif (stop_at_tuple && PyTuple_Check(s)) return 0;\n\tif ((e=PyObject_GetAttrString(s, \"__array_shape__\")) != NULL) {\n\t\tif (PyTuple_Check(e)) d=PyTuple_GET_SIZE(e);\n\t\telse d=-1;\n\t\tPy_DECREF(e);\n\t\tif (d>-1) return d;\n\t}\n\telse PyErr_Clear();\n\n if (PySequence_Length(s) == 0) \n\t\treturn 1;\t\n if ((e=PySequence_GetItem(s,0)) == NULL) return -1;\n if(e!=s) {\n\t\td=discover_depth(e, max-1, stop_at_string, stop_at_tuple);\n\t\tif(d >= 0) d++;\n\t}\n Py_DECREF(e);\n return d;\n}\n\nstatic int\ndiscover_itemsize(PyObject *s, int nd, int *itemsize) \n{\n\tint n, r, i;\n\tPyObject *e;\n\t\n\tn = PyObject_Length(s);\n\n\tif ((nd == 0) || PyString_Check(s) ||\t\t\\\n\t PyUnicode_Check(s) || PyBuffer_Check(s)) {\n\t\tif PyUnicode_Check(s) \n\t\t\t*itemsize = MAX(*itemsize, sizeof(Py_UNICODE)*n);\n\t\telse\n\t\t\t*itemsize = MAX(*itemsize, n);\n\t\treturn 0;\n\t}\n\tfor (i=0; i n_lower) n_lower = d[1];\n }\n d[1] = n_lower;\n\t\n return 0;\n}\n\n/* new reference */\n/* doesn't alter refcount of chktype or mintype --- \n unless one of them is returned */\nstatic PyArray_Descr *\n_array_small_type(PyArray_Descr *chktype, PyArray_Descr* mintype)\n{\n\tPyArray_Descr *outtype;\n\n\tif (chktype->type_num > mintype->type_num) outtype = chktype;\n\telse outtype = mintype;\n\n\tPy_INCREF(outtype);\n\tif (PyTypeNum_ISEXTENDED(outtype->type_num) &&\t\t\\\n\t (PyTypeNum_ISEXTENDED(mintype->type_num) ||\t\t\\\n\t mintype->type_num==0)) {\n\t\tint testsize = outtype->elsize;\n\t\tregister int chksize, minsize;\n\t\tchksize = chktype->elsize;\n\t\tminsize = mintype->elsize;\n\t\t/* Handle string->unicode case separately \n\t\t because string itemsize is twice as large */\n\t\tif (outtype->type_num == PyArray_UNICODE && \n\t\t mintype->type_num == PyArray_STRING) {\n\t\t\ttestsize = MAX(chksize, 2*minsize);\n\t\t}\n\t\telse {\n\t\t\ttestsize = MAX(chksize, minsize);\n\t\t}\n\t\tif (testsize != outtype->elsize) {\n\t\t\tPyArray_DESCR_REPLACE(outtype);\n\t\t\touttype->elsize = testsize;\n\t\t\tPy_XDECREF(outtype->fields);\n\t\t\touttype->fields = NULL;\n\t\t}\n\t}\n\treturn outtype;\n}\n\n/* op is an object to be converted to an ndarray. \n\n minitype is the minimum type-descriptor needed. \n \n max is the maximum number of dimensions -- used for recursive call\n to avoid infinite recursion...\n \n*/\n\nstatic PyArray_Descr *\n_array_find_type(PyObject *op, PyArray_Descr *minitype, int max)\n{\n int l;\n PyObject *ip;\n\tPyArray_Descr *chktype=NULL;\n\tPyArray_Descr *outtype;\n\t\n\tif (minitype == NULL) \n\t\tminitype = PyArray_DescrFromType(PyArray_BOOL);\n\telse Py_INCREF(minitype);\n\t\n if (max < 0) goto deflt;\n\t\n if (PyArray_Check(op)) {\n\t\tchktype = PyArray_DESCR(op);\n\t\tPy_INCREF(chktype);\n\t\tgoto finish;\n\t}\n\t\n\tif (PyArray_IsScalar(op, Generic)) {\n\t\tchktype = PyArray_DescrFromScalar(op);\n\t\tgoto finish;\n\t}\n\n\tif ((ip=PyObject_GetAttrString(op, \"__array_typestr__\"))!=NULL) {\n\t\tif (PyString_Check(ip)) {\n\t\t\tchktype =_array_typedescr_fromstr(PyString_AS_STRING(ip));\n\t\t}\n\t\tPy_DECREF(ip);\n if (chktype) goto finish;\n\t}\n\telse PyErr_Clear();\n \n if ((ip=PyObject_GetAttrString(op, \"__array_struct__\")) != NULL) {\n PyArrayInterface *inter;\n char buf[40];\n if (PyCObject_Check(ip)) {\n inter=(PyArrayInterface *)PyCObject_AsVoidPtr(ip);\n if (inter->version == 2) {\n snprintf(buf, 40, \"|%c%d\", inter->typekind, \n\t\t\t\t\t inter->itemsize);\n\t\t\t\tchktype = _array_typedescr_fromstr(buf);\n }\n }\n Py_DECREF(ip);\n if (chktype) goto finish;\n }\n\telse PyErr_Clear();\n \t\n if (PyString_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_STRING);\n\t\tchktype->elsize = PyString_GET_SIZE(op);\n\t\tgoto finish;\n }\n\n\tif (PyUnicode_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_UNICODE);\n\t\tchktype->elsize = PyUnicode_GET_DATA_SIZE(op);\n\t\tgoto finish;\n\t}\n\n\tif (PyBuffer_Check(op)) {\n\t\tchktype = PyArray_DescrNewFromType(PyArray_VOID);\n\t\tchktype->elsize = op->ob_type->tp_as_sequence->sq_length(op);\n PyErr_Clear();\n\t\tgoto finish;\n\t}\n\n if (PyObject_HasAttrString(op, \"__array__\")) {\n ip = PyObject_CallMethod(op, \"__array__\", NULL);\n if(ip && PyArray_Check(ip)) {\n\t\t\tchktype = PyArray_DESCR(ip);\n\t\t\tPy_INCREF(chktype);\n Py_DECREF(ip);\n\t\t\tgoto finish;\n\t\t}\n Py_XDECREF(ip);\n\t\tif (PyErr_Occurred()) PyErr_Clear();\n } \n\n\tif (PyInstance_Check(op)) goto deflt;\n\t\n if (PySequence_Check(op)) {\n\n l = PyObject_Length(op);\n if (l < 0 && PyErr_Occurred()) { \n\t\t\tPyErr_Clear(); \n\t\t\tgoto deflt;\n\t\t}\n if (l == 0 && minitype->type_num == PyArray_BOOL) {\n\t\t\tPy_DECREF(minitype);\n\t\t\tminitype = PyArray_DescrFromType(PyArray_INTP);\n\t\t}\n while (--l >= 0) {\n\t\t\tPyArray_Descr *newtype;\n ip = PySequence_GetItem(op, l);\n if (ip==NULL) {\n\t\t\t\tPyErr_Clear(); \n\t\t\t\tgoto deflt;\n\t\t\t}\n\t\t\tchktype = _array_find_type(ip, minitype, max-1);\n\t\t\tnewtype = _array_small_type(chktype, minitype);\n\t\t\tPy_DECREF(minitype);\n\t\t\tminitype = newtype;\n\t\t\tPy_DECREF(chktype);\n Py_DECREF(ip);\n }\n\t\tchktype = minitype;\n\t\tPy_INCREF(minitype);\n\t\tgoto finish;\n }\n\t\n\tif (PyBool_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_BOOL);\n\t\tgoto finish;\t\t\n\t}\n else if (PyInt_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_LONG);\n\t\tgoto finish;\n } else if (PyFloat_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_DOUBLE);\n\t\tgoto finish;\n\t} else if (PyComplex_Check(op)) {\n\t\tchktype = PyArray_DescrFromType(PyArray_CDOUBLE);\n\t\tgoto finish;\n\t}\n\n deflt:\n\tchktype = PyArray_DescrFromType(PyArray_OBJECT);\n\t\n finish:\n\t\n\touttype = _array_small_type(chktype, minitype);\n\tPy_DECREF(chktype);\n\tPy_DECREF(minitype);\n\treturn outtype; \n}\n\nstatic int \nAssign_Array(PyArrayObject *self, PyObject *v) \n{\n PyObject *e;\n int l, r;\n\t\n if (!PySequence_Check(v)) {\n PyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"assignment from non-sequence\");\n return -1;\n }\n\t\n l=PyObject_Length(v);\n if(l < 0) return -1; \n\t\n while(--l >= 0)\n {\n e=PySequence_GetItem(v,l);\n if (e == NULL) return -1; \n\t\t\tr = PySequence_SetItem((PyObject*)self,l,e);\n Py_DECREF(e);\n if(r == -1) return -1;\n }\n return 0;\n}\n\n/* \"Array Scalars don't call this code\" */ \n/* steals reference to typecode -- no NULL*/\nstatic PyObject *\nArray_FromScalar(PyObject *op, PyArray_Descr *typecode) \n{\n PyArrayObject *ret;\n\tint itemsize; \n\tint type;\n\t\n\titemsize = typecode->elsize;\n\ttype = typecode->type_num;\n\n\tif (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) {\n\t\titemsize = PyObject_Length(op);\n\t\tif (type == PyArray_UNICODE) itemsize *= sizeof(Py_UNICODE);\n\t}\n\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, typecode,\n\t\t\t\t\t\t 0, NULL, \n\t\t\t\t\t\t NULL, NULL, 0, NULL);\n\n\tif (ret == NULL) return NULL;\n\n ret->descr->f->setitem(op, ret->data, ret);\n\t\n if (PyErr_Occurred()) {\n Py_DECREF(ret);\n return NULL;\n } else {\n return (PyObject *)ret;\n }\n}\n\n\n/* steals reference to typecode unless return value is NULL*/\nstatic PyObject *\nArray_FromSequence(PyObject *s, PyArray_Descr *typecode, int fortran, \n\t\t int min_depth, int max_depth)\n{\n PyArrayObject *r;\n int nd;\n\tintp d[MAX_DIMS];\n\tint stop_at_string;\n\tint stop_at_tuple;\n\tint type = typecode->type_num;\n\tint itemsize = typecode->elsize;\n\tPyArray_Descr *savetype=typecode;\n\t\n\tstop_at_string = ((type == PyArray_OBJECT) ||\t\\\n\t\t\t (type == PyArray_STRING) ||\t\\\n\t\t\t (type == PyArray_UNICODE) || \\\n\t\t\t (type == PyArray_VOID));\n\n\tstop_at_tuple = (type == PyArray_VOID && ((typecode->fields &&\t\\\n\t\t\t\t\t\t typecode->fields!=Py_None) \\\n\t\t\t\t\t\t || (typecode->subarray)));\n\t\n if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string, \n\t\t\t\t stop_at_tuple)) > 0)) {\n\t\tif (nd==0)\n\t\t\treturn Array_FromScalar(s, typecode);\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"invalid input sequence\");\n return NULL;\n }\n\t\n if ((max_depth && nd > max_depth) ||\t\\\n\t (min_depth && nd < min_depth)) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"invalid number of dimensions\");\n return NULL;\n }\n\t\n\tif(discover_dimensions(s,nd,d, !stop_at_string) == -1) {\n\t\treturn NULL;\n\t}\n\tif (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) {\n\t\tif (discover_itemsize(s, nd, &itemsize) == -1) {\n\t\t\treturn NULL;\n\t\t}\n\t\tif (type == PyArray_UNICODE) itemsize*=sizeof(Py_UNICODE);\n\t}\n\n\tif (itemsize != typecode->elsize) {\n\t\tPyArray_DESCR_REPLACE(typecode);\n\t\ttypecode->elsize = itemsize;\n\t}\n\t\n r=(PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, typecode,\n\t\t\t\t\t nd, d, \n\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t fortran, NULL);\n\t\n if(!r) {Py_XINCREF(savetype); return NULL;}\n if(Assign_Array(r,s) == -1) {\n\t\tPy_XINCREF(savetype);\n\t\tPy_DECREF(r);\n\t\treturn NULL;\n\t}\n return (PyObject*)r;\n}\n\n\n/*OBJECT_API\n Is the typenum valid?\n*/\nstatic int \nPyArray_ValidType(int type) \n{\n\tPyArray_Descr *descr;\n\tint res=TRUE;\n\t\n\tdescr = PyArray_DescrFromType(type);\n\tif (descr==NULL) res = FALSE;\n\tPy_DECREF(descr);\n\treturn res;\n}\n\n\n/* If the output is not a CARRAY, then it is buffered also */\n\nstatic int\n_bufferedcast(PyArrayObject *out, PyArrayObject *in)\n{\n\tchar *inbuffer, *bptr, *optr;\n\tchar *outbuffer=NULL;\n\tPyArrayIterObject *it_in=NULL, *it_out=NULL;\n\tregister intp i, index;\n\tintp ncopies = PyArray_SIZE(out) / PyArray_SIZE(in);\n\tint elsize=in->descr->elsize;\n\tint nels = PyArray_BUFSIZE;\n\tint el;\n\tint inswap, outswap=0;\n\tint obuf=!PyArray_ISCARRAY(out);\n\tint oelsize = out->descr->elsize;\n\tPyArray_VectorUnaryFunc *castfunc;\n PyArray_CopySwapFunc *in_csn;\n PyArray_CopySwapFunc *out_csn;\n\tint retval = -1;\n\n\tcastfunc = in->descr->f->cast[out->descr->type_num];\n in_csn = in->descr->f->copyswap;\n out_csn = out->descr->f->copyswap;\n\n\t/* If the input or output is STRING, UNICODE, or VOID */\n\t/* then getitem and setitem are used for the cast */\n\t/* and byteswapping is handled by those methods */\n\n\tinswap = !(PyArray_ISFLEXIBLE(in) || PyArray_ISNOTSWAPPED(in));\n\t\n\tinbuffer = PyDataMem_NEW(PyArray_BUFSIZE*elsize);\n\tif (inbuffer == NULL) return -1;\n\tif (PyArray_ISOBJECT(in)) \n\t\tmemset(inbuffer, 0, PyArray_BUFSIZE*elsize);\n\tit_in = (PyArrayIterObject *)PyArray_IterNew((PyObject *)in);\n\tif (it_in == NULL) goto exit;\n\n\tif (obuf) {\n\t\toutswap = !(PyArray_ISFLEXIBLE(out) || \\\n\t\t\t PyArray_ISNOTSWAPPED(out));\n\t\toutbuffer = PyDataMem_NEW(PyArray_BUFSIZE*oelsize);\n\t\tif (outbuffer == NULL) goto exit;\n\t\tif (PyArray_ISOBJECT(out))\n\t\t\tmemset(outbuffer, 0, PyArray_BUFSIZE*oelsize);\n\t\t\n\t\tit_out = (PyArrayIterObject *)PyArray_IterNew((PyObject *)out);\n\t\tif (it_out == NULL) goto exit;\n\n\t\tnels = MIN(nels, PyArray_BUFSIZE);\n\t}\n\t\n\toptr = (obuf) ? outbuffer: out->data;\n\tbptr = inbuffer;\n\tel = 0;\t\n\twhile(ncopies--) {\n\t\tindex = it_in->size;\n\t\tPyArray_ITER_RESET(it_in);\n\t\twhile(index--) {\n in_csn(bptr, it_in->dataptr, inswap, elsize);\n\t\t\tbptr += elsize;\n\t\t\tPyArray_ITER_NEXT(it_in);\n\t\t\tel += 1;\n\t\t\tif ((el == nels) || (index == 0)) {\n\t\t\t\t/* buffer filled, do cast */\n\t\t\t\t\n\t\t\t\tcastfunc(inbuffer, optr, el, in, out);\n\t\t\t\t\n\t\t\t\tif (obuf) {\n\t\t\t\t\t/* Copy from outbuffer to array */\n\t\t\t\t\tfor(i=0; idataptr,\n optr, outswap,\n oelsize);\n\t\t\t\t\t\toptr += oelsize;\n\t\t\t\t\t\tPyArray_ITER_NEXT(it_out);\n\t\t\t\t\t}\n\t\t\t\t\toptr = outbuffer;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\toptr += out->descr->elsize * nels;\n\t\t\t\t}\n\t\t\t\tel = 0;\n\t\t\t\tbptr = inbuffer;\n\t\t\t}\n\t\t}\n\t}\n\tretval = 0;\n exit:\n\tPy_XDECREF(it_in);\n\tPyDataMem_FREE(inbuffer);\n\tPyDataMem_FREE(outbuffer);\t\n\tif (obuf) {\n\t\tPy_XDECREF(it_out);\n\t}\n\treturn retval;\n}\n\n\n/* For backward compatibility */\n\n/* steals reference to at --- cannot be NULL*/\n/*OBJECT_API\n Cast an array using typecode structure.\n*/\nstatic PyObject * \nPyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran)\n{\n\tPyObject *out;\n\tint ret;\n\tPyArray_Descr *mpd;\n\n\tmpd = mp->descr;\n\n\tif (((mpd == at) || ((mpd->type_num == at->type_num) &&\t\t\\\n\t\t\t PyArray_EquivByteorders(mpd->byteorder,\\\n\t\t\t\t\t\t at->byteorder) &&\t\\\n\t\t\t ((mpd->elsize == at->elsize) ||\t\t\\\n\t\t\t (at->elsize==0)))) &&\t\t\t\\\n\t PyArray_ISBEHAVED_RO(mp)) {\n\t\tPy_DECREF(at);\n\t\tPy_INCREF(mp);\n\t\treturn (PyObject *)mp;\n\t}\n\t\t\n\tif (at->elsize == 0) {\n\t\tPyArray_DESCR_REPLACE(at);\n\t\tif (at == NULL) return NULL;\n\t\tif (mpd->type_num == PyArray_STRING &&\t\\\n\t\t at->type_num == PyArray_UNICODE)\n\t\t\tat->elsize = mpd->elsize*sizeof(Py_UNICODE);\n\t\tif (mpd->type_num == PyArray_UNICODE &&\n\t\t at->type_num == PyArray_STRING) \n\t\t\tat->elsize = mpd->elsize/sizeof(Py_UNICODE);\n\t\tif (at->type_num == PyArray_VOID)\n\t\t\tat->elsize = mpd->elsize;\n\t}\n\n\tout = PyArray_NewFromDescr(mp->ob_type, at,\n\t\t\t\t mp->nd, \n\t\t\t\t mp->dimensions, \n\t\t\t\t NULL, NULL, \n\t\t\t\t fortran,\n\t\t\t\t (PyObject *)mp);\n\n\tif (out == NULL) return NULL;\n\tret = PyArray_CastTo((PyArrayObject *)out, mp);\n\tif (ret != -1) return out;\n\t\n\tPy_DECREF(out);\n\treturn NULL;\n\t\n}\n\t \n/* The number of elements in out must be an integer multiple\n of the number of elements in mp. \n*/\n\n/*OBJECT_API\n Cast to an already created array.\n*/\nstatic int\nPyArray_CastTo(PyArrayObject *out, PyArrayObject *mp)\n{\n\n\tint simple;\n\tintp mpsize = PyArray_SIZE(mp);\n\tintp outsize = PyArray_SIZE(out);\n\n\tif (mpsize == 0) return 0;\n\tif (!PyArray_ISWRITEABLE(out)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"output array is not writeable\");\n\t\treturn -1;\n\t}\n\tif (outsize % mpsize != 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"output array must have an integer-multiple\"\\\n\t\t\t\t\" of the number of elements in the input \"\\\n\t\t\t\t\"array\");\n\t\treturn -1; \n\t}\n\n\tif (out->descr->type_num >= PyArray_NTYPES) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Can only cast to builtin types.\");\n\t\treturn -1;\n\t\t\t\t\n\t}\n\n\tsimple = ((PyArray_ISCARRAY_RO(mp) && PyArray_ISCARRAY(out)) || \\\n (PyArray_ISFARRAY_RO(mp) && PyArray_ISFARRAY(out)));\n\t\n\tif (simple) {\n\t\tchar *inptr;\n\t\tchar *optr = out->data;\n\t\tintp obytes = out->descr->elsize * outsize;\n\t\tintp ncopies = outsize / mpsize;\n\n\t\twhile(ncopies--) {\n\t\t\tinptr = mp->data;\n\t\t\tmp->descr->f->cast[out->descr->type_num](inptr, \n\t\t\t\t\t\t\t optr,\n\t\t\t\t\t\t\t mpsize,\n\t\t\t\t\t\t\t mp, out);\n\t\t\toptr += obytes;\n\t\t}\n\t\treturn 0;\n\t}\n\t\n\t/* If not a well-behaved cast, then use buffers */\n\tif (_bufferedcast(out, mp) == -1) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n/* steals reference to newtype --- acc. NULL */\nstatic PyObject *\narray_fromarray(PyArrayObject *arr, PyArray_Descr *newtype, int flags) \n{\n\t\n\tPyArrayObject *ret=NULL;\n\tint type, itemsize;\n\tint copy = 0;\n\tint arrflags;\n\tPyArray_Descr *oldtype;\n\tchar *msg = \"cannot copy back to a read-only array\";\n PyTypeObject *subtype;\n\n\toldtype = PyArray_DESCR(arr);\n\n subtype = arr->ob_type;\n\t\n\tif (newtype == NULL) {newtype = oldtype; Py_INCREF(oldtype);}\n\ttype = newtype->type_num;\n\titemsize = newtype->elsize;\n\n\t/* Don't copy if sizes are compatible */\n\tif (PyArray_EquivTypes(oldtype, newtype)) {\n\t\tarrflags = arr->flags;\n\n\t\tcopy = (flags & ENSURECOPY) || \\\n\t\t\t((flags & CONTIGUOUS) && (!(arrflags & CONTIGUOUS))) \\\n\t\t\t|| ((flags & ALIGNED) && (!(arrflags & ALIGNED))) \\\n\t\t\t|| (arr->nd > 1 &&\t\t\t\t\\\n\t\t\t ((flags & FORTRAN) != (arrflags & FORTRAN))) || \\\n\t\t\t((flags & WRITEABLE) && (!(arrflags & WRITEABLE)));\n\t\t\n\t\tif (copy) {\n if ((flags & UPDATEIFCOPY) && \\\n (!PyArray_ISWRITEABLE(arr))) {\n\t\t\t\tPy_DECREF(newtype);\n PyErr_SetString(PyExc_ValueError, msg);\n return NULL;\n }\n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n subtype = &PyArray_Type;\n }\n\t\t\tret = (PyArrayObject *) \\\n\t\t\t\tPyArray_NewFromDescr(subtype, newtype,\n\t\t\t\t\t\t arr->nd, \n\t\t\t\t\t\t arr->dimensions,\n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t flags & FORTRAN,\n\t\t\t\t\t\t (PyObject *)arr);\n if (ret == NULL) return NULL;\n\t\t\tif (PyArray_CopyInto(ret, arr) == -1) \n\t\t\t\t{Py_DECREF(ret); return NULL;}\n\t\t\tif (flags & UPDATEIFCOPY) {\n\t\t\t\tret->flags |= UPDATEIFCOPY;\n\t\t\t\tret->base = (PyObject *)arr;\n PyArray_FLAGS(ret->base) &= ~WRITEABLE;\n\t\t\t\tPy_INCREF(arr);\n\t\t\t}\n\t\t} \n\t\t/* If no copy then just increase the reference\n\t\t count and return the input */\n\t\telse { \n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n\t\t\t\tPy_DECREF(newtype);\n\t\t\t\tPy_INCREF(arr->descr);\n\t\t\t\tret = (PyArrayObject *)\t\t\t\\\n PyArray_NewFromDescr(&PyArray_Type,\n\t\t\t\t\t\t\t arr->descr,\n\t\t\t\t\t\t\t arr->nd,\n\t\t\t\t\t\t\t arr->dimensions,\n\t\t\t\t\t\t\t arr->strides,\n\t\t\t\t\t\t\t arr->data,\n\t\t\t\t\t\t\t arr->flags,NULL);\n if (ret == NULL) return NULL;\n ret->base = (PyObject *)arr;\n }\n else {\n ret = arr;\n }\n\t\t\tPy_INCREF(arr);\n\t\t}\n\t}\n\t\n\t/* The desired output type is different than the input\n\t array type */\n\telse {\n\t\t/* Cast to the desired type if we can do it safely\n\t\t Also cast if source is a ndim-0 array to mimic\n\t\t behavior with Python scalars */\n\t\tif (flags & FORCECAST || PyArray_NDIM(arr)==0 ||\n\t\t PyArray_CanCastTo(oldtype, newtype)) {\n if ((flags & UPDATEIFCOPY) &&\t\t\\\n (!PyArray_ISWRITEABLE(arr))) {\n\t\t\t\tPy_DECREF(newtype);\n PyErr_SetString(PyExc_ValueError, msg);\n return NULL;\n }\n if ((flags & ENSUREARRAY) && \\\n (subtype != &PyBigArray_Type)) {\n subtype = &PyArray_Type;\n }\n ret = (PyArrayObject *)\\\n PyArray_NewFromDescr(subtype, \n\t\t\t\t\t\t newtype, \n\t\t\t\t\t\t arr->nd,\n\t\t\t\t\t\t arr->dimensions, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t flags & FORTRAN,\n\t\t\t\t\t\t (PyObject *)arr);\n if (ret == NULL) return NULL;\n if (PyArray_CastTo(ret, arr) < 0) {\n Py_DECREF(ret);\n return NULL;\n }\n\t\t\tif (flags & UPDATEIFCOPY) {\n\t\t\t\tret->flags |= UPDATEIFCOPY;\n\t\t\t\tret->base = (PyObject *)arr;\n PyArray_FLAGS(ret->base) &= ~WRITEABLE;\n\t\t\t\tPy_INCREF(arr);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"array cannot be safely cast \" \\\n\t\t\t\t\t\"to required type\");\n\t\t\tret = NULL;\n\t\t}\n\t}\n\treturn (PyObject *)ret;\n}\n\n/* new reference */\nstatic PyArray_Descr *\n_array_typedescr_fromstr(char *str)\n{\n\tPyArray_Descr *descr; \n\tint type_num;\n\tchar typechar;\n\tint size;\n\tchar msg[] = \"unsupported typestring\";\n\tint swap;\n\tchar swapchar;\n\n\tswapchar = str[0];\n\tstr += 1;\n\t\n#define _MY_FAIL {\t\t\t\t \\\n\t\tPyErr_SetString(PyExc_ValueError, msg); \\\n\t\treturn NULL;\t\t\t\t\\\n\t}\t\t\n\t\n\ttypechar = str[0];\n\tsize = atoi(str + 1);\n\tswitch (typechar) {\n\tcase 'b':\n\t\tif (size == sizeof(Bool))\n\t\t\ttype_num = PyArray_BOOL;\t \n\t\telse _MY_FAIL \n\t\t\tbreak;\t\t \n\tcase 'u':\n\t\tif (size == sizeof(uintp))\n\t\t\ttype_num = PyArray_UINTP;\n\t\telse if (size == sizeof(char))\n\t\t\ttype_num = PyArray_UBYTE;\n\t\telse if (size == sizeof(short)) \n\t\t\ttype_num = PyArray_USHORT;\n\t\telse if (size == sizeof(ulong)) \n\t\t\ttype_num = PyArray_ULONG;\n\t\telse if (size == sizeof(int)) \n\t\t\ttype_num = PyArray_UINT;\n\t\telse if (size == sizeof(ulonglong))\n\t\t\ttype_num = PyArray_ULONGLONG;\n\t\telse _MY_FAIL\n\t\t\tbreak;\t\t \n\tcase 'i':\n\t\tif (size == sizeof(intp))\n\t\t\ttype_num = PyArray_INTP;\n\t\telse if (size == sizeof(char)) \n\t\t type_num = PyArray_BYTE;\n\t\telse if (size == sizeof(short)) \n\t\t\ttype_num = PyArray_SHORT;\n\t\telse if (size == sizeof(long)) \n\t\t\ttype_num = PyArray_LONG;\n\t\telse if (size == sizeof(int))\n\t\t\ttype_num = PyArray_INT;\n\t\telse if (size == sizeof(longlong))\n\t\t\ttype_num = PyArray_LONGLONG;\n\t\telse _MY_FAIL\n\t\t\tbreak;\t\t \n\tcase 'f':\n\t\tif (size == sizeof(float))\n\t\t\ttype_num = PyArray_FLOAT;\n\t\telse if (size == sizeof(double))\n\t\t\ttype_num = PyArray_DOUBLE;\n\t\telse if (size == sizeof(longdouble))\n\t\t\ttype_num = PyArray_LONGDOUBLE;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'c':\n\t\tif (size == sizeof(float)*2)\n\t\t\ttype_num = PyArray_CFLOAT;\n\t\telse if (size == sizeof(double)*2)\n\t\t\ttype_num = PyArray_CDOUBLE;\n\t\telse if (size == sizeof(longdouble)*2)\n\t\t\ttype_num = PyArray_CLONGDOUBLE;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'O':\n\t\tif (size == sizeof(PyObject *))\n\t\t\ttype_num = PyArray_OBJECT;\n\t\telse _MY_FAIL\n\t\t\tbreak;\n\tcase 'S':\n\t\ttype_num = PyArray_STRING;\n\t\tbreak;\n\tcase 'U':\n\t\ttype_num = PyArray_UNICODE;\n\t\tsize *= sizeof(Py_UNICODE);\n\t\tbreak;\t \n\tcase 'V':\n\t\ttype_num = PyArray_VOID;\n\t\tbreak;\n\tdefault:\n\t\t_MY_FAIL\n\t}\n\t\n#undef _MY_FAIL\n\n descr = PyArray_DescrFromType(type_num);\n if (descr == NULL) return NULL;\n swap = !PyArray_ISNBO(swapchar);\n if (descr->elsize == 0 || swap) {\n\t /* Need to make a new PyArray_Descr */\n\t PyArray_DESCR_REPLACE(descr);\n\t if (descr==NULL) return NULL;\n\t if (descr->elsize == 0)\n\t\t descr->elsize = size;\n\t if (swap) \n\t\t descr->byteorder = swapchar;\n }\n return descr;\n}\n\n/* steals a reference to intype unless NotImplemented */\nstatic PyObject *\narray_fromstructinterface(PyObject *input, PyArray_Descr *intype, int flags)\n{\n\tPyArray_Descr *thetype;\n\tchar buf[40];\n\tPyArrayInterface *inter;\n\tPyObject *attr, *r, *ret;\n\tchar endian = PyArray_NATBYTE;\n \n attr = PyObject_GetAttrString(input, \"__array_struct__\");\n if (attr == NULL) {\n\t\tPyErr_Clear();\n\t\treturn Py_NotImplemented;\n\t}\n if (!PyCObject_Check(attr) || \\\n ((inter=((PyArrayInterface *)\\\n\t\t PyCObject_AsVoidPtr(attr)))->version != 2)) {\n PyErr_SetString(PyExc_ValueError, \"invalid __array_struct__\");\n\t\tPy_XDECREF(intype);\n\t\tPy_DECREF(attr);\n return NULL;\n }\n\tif ((inter->flags & NOTSWAPPED) != NOTSWAPPED) {\n\t\tendian = PyArray_OPPBYTE;\n\t\tinter->flags &= ~NOTSWAPPED;\n\t}\n\n snprintf(buf, 40, \"%c%c%d\", endian, inter->typekind, inter->itemsize);\n if (!(thetype=_array_typedescr_fromstr(buf))) {\n\t\tPy_XDECREF(intype);\n\t\tPy_DECREF(attr);\n return NULL;\n }\n\n r = PyArray_NewFromDescr(&PyArray_Type, thetype,\n\t\t\t\t inter->nd, inter->shape,\n\t\t\t\t inter->strides, inter->data,\n\t\t\t\t inter->flags, NULL);\n\tPy_INCREF(input);\n\tPyArray_BASE(r) = input;\n Py_DECREF(attr);\n PyArray_UpdateFlags((PyArrayObject *)r, UPDATE_ALL_FLAGS);\n ret = array_fromarray((PyArrayObject*)r, intype, flags);\n Py_DECREF(r);\n return ret;\n}\n\n/* steals a reference to intype unless NotImplemented */\nstatic PyObject *\narray_frominterface(PyObject *input, PyArray_Descr *intype, int flags)\n{\n\tPyObject *attr=NULL, *item=NULL, *r;\n PyObject *tstr=NULL, *shape=NULL; \n\tPyArrayObject *ret=NULL;\n\tPyArray_Descr *type=NULL;\n\tchar *data;\n\tint buffer_len;\n\tint res, i, n;\n\tintp dims[MAX_DIMS], strides[MAX_DIMS];\n\tint dataflags = BEHAVED_FLAGS;\n\n\t/* Get the memory from __array_data__ and __array_offset__ */\n\t/* Get the shape */\n\t/* Get the typestring -- ignore array_descr */\n\t/* Get the strides */\n\t\n shape = PyObject_GetAttrString(input, \"__array_shape__\");\n if (shape == NULL) {PyErr_Clear(); return Py_NotImplemented;}\n tstr = PyObject_GetAttrString(input, \"__array_typestr__\");\n if (tstr == NULL) {Py_DECREF(shape); PyErr_Clear(); return Py_NotImplemented;}\n \n\tattr = PyObject_GetAttrString(input, \"__array_data__\");\n\tif ((attr == NULL) || (attr==Py_None) || (!PyTuple_Check(attr))) {\n\t\tif (attr && (attr != Py_None)) item=attr;\n\t\telse item=input;\n\t\tres = PyObject_AsWriteBuffer(item, (void **)&data, \n\t\t\t\t\t &buffer_len);\n\t\tif (res < 0) {\n\t\t\tPyErr_Clear();\n\t\t\tres = PyObject_AsReadBuffer(item, (const void **)&data,\n\t\t\t\t\t\t &buffer_len);\n\t\t\tif (res < 0) goto fail;\n\t\t\tdataflags &= ~WRITEABLE;\n\t\t}\n\t\tPy_XDECREF(attr);\n\t\tattr = PyObject_GetAttrString(input, \"__array_offset__\");\n\t\tif (attr) {\n\t\t\tlong num = PyInt_AsLong(attr);\n\t\t\tif (error_converting(num)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\t\"__array_offset__ \"\\\n\t\t\t\t\t\t\"must be an integer\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tdata += num;\n\t\t}\n\t\telse PyErr_Clear();\n\t}\n\telse {\n\t\tif (PyTuple_GET_SIZE(attr) != 2) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_data__ must return \"\t\\\n\t\t\t\t\t\"a 2-tuple with ('data pointer \"\\\n\t\t\t\t\t\"string', read-only flag)\");\n\t\t\tgoto fail;\n\t\t}\n\t\tres = sscanf(PyString_AsString(PyTuple_GET_ITEM(attr,0)),\n\t\t\t \"%p\", (void **)&data);\n\t\tif (res < 1) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_data__ string cannot be \" \\\n\t\t\t\t\t\"converted\");\n\t\t\tgoto fail;\n\t\t}\n\t\tif (PyObject_IsTrue(PyTuple_GET_ITEM(attr,1))) {\n\t\t\tdataflags &= ~WRITEABLE;\n\t\t}\n\t}\n\tPy_XDECREF(attr);\n\tattr = tstr;\n\tif (!PyString_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_typestr__ must be a string\");\n\t\tPy_INCREF(attr); /* decref'd twice below */\n\t\tgoto fail;\n\t}\n\ttype = _array_typedescr_fromstr(PyString_AS_STRING(attr)); \n\tPy_DECREF(attr); attr=NULL; tstr=NULL;\n\tif (type==NULL) goto fail;\n\tattr = shape;\n\tif (!PyTuple_Check(attr)) {\n\t\tPyErr_SetString(PyExc_TypeError, \"__array_shape__ must be a tuple\");\n\t\tPy_INCREF(attr); /* decref'd twice below */\n\t\tPy_DECREF(type);\n\t\tgoto fail;\n\t}\n\tn = PyTuple_GET_SIZE(attr);\n\tfor (i=0; ibase = input;\n \n\tattr = PyObject_GetAttrString(input, \"__array_strides__\");\n\tif (attr != NULL && attr != Py_None) {\n\t\tif (!PyTuple_Check(attr)) {\n\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\"__array_strides__ must be a tuple\");\n\t\t\tPy_DECREF(attr);\n\t\t\tPy_DECREF(ret);\n\t\t\tPy_XDECREF(intype);\n\t\t\treturn NULL;\n\t\t}\n\t\tif (n != PyTuple_GET_SIZE(attr)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"mismatch in length of \"\\\n\t\t\t\t\t\"__array_strides__ and \"\\\n\t\t\t\t\t\"__array_shape__\");\n\t\t\tPy_DECREF(attr);\n\t\t\tPy_DECREF(ret);\n\t\t\tPy_XDECREF(intype);\n\t\t\treturn NULL;\n\t\t}\n\t\tfor (i=0; istrides, strides, n*sizeof(intp));\n\t}\n\telse PyErr_Clear();\n\tPyArray_UpdateFlags(ret, UPDATE_ALL_FLAGS);\n\tr = array_fromarray(ret, intype, flags);\n\tPy_DECREF(ret);\n\treturn r;\n\n fail:\n\tPy_XDECREF(intype);\n\tPy_XDECREF(attr);\n\tPy_XDECREF(shape);\n\tPy_XDECREF(tstr);\n\treturn NULL;\n}\n\n/* steals a reference to typecode */\nstatic PyObject *\narray_fromattr(PyObject *op, PyArray_Descr *typecode, int flags) \n{\n PyObject *new, *r;\n\t \n if (typecode == NULL) {\n new = PyObject_CallMethod(op, \"__array__\", NULL);\n } else {\n\t\tPyObject *obj;\n\n\t\tif (PyTypeNum_ISEXTENDED(typecode->type_num)) {\n\t\t\tobj = PyString_FromFormat(\"%c%d\", typecode->type,\n\t\t\t\t\t\t typecode->elsize);\n\t\t}\n\t\telse { \n\t\t\tobj = (PyObject *)(typecode->typeobj); Py_INCREF(obj);\n\t\t}\n\t\tnew = PyObject_CallMethod(op, \"__array__\", \"N\", obj);\n }\n if (new == NULL) {Py_XDECREF(typecode); return NULL;}\n if (!PyArray_Check(new)) {\n PyErr_SetString(PyExc_ValueError, \n \"object __array__ method not \" \\\n \"producing an array\");\n Py_DECREF(new);\n\t\tPy_DECREF(typecode);\n return NULL;\n }\n r = array_fromarray((PyArrayObject *)new, typecode, flags);\n Py_DECREF(new);\n return r;\n} \n\n/* Steals a reference to newtype --- which can be NULL */\nstatic PyObject *\narray_fromobject(PyObject *op, PyArray_Descr *newtype, int min_depth, \n\t\t int max_depth, int flags) \n{\n /* This is the main code to make a SciPy array from a Python\n Object. It is called from lot's of different places which\n is why there are so many checks. The comments try to\n explain some of the checks. */\n\n PyObject *r=NULL;\n int seq = FALSE;\n\n\t/* Is input object already an array? */\n\t/* This is where the flags are used */\n if (PyArray_Check(op)) \n\t\tr = array_fromarray((PyArrayObject *)op, newtype, flags);\n\telse if (PyArray_IsScalar(op, Generic)) {\n\t\tr = PyArray_FromScalar(op, newtype);\n\t}\n else if ((r = array_fromstructinterface(op, newtype, flags)) != \\\n\t\t Py_NotImplemented) {\n }\n else if ((r = array_frominterface(op, newtype, flags)) !=\t\\\n\t\t Py_NotImplemented) {\n\t}\n else if (PyObject_HasAttrString(op, \"__array__\")) {\n /* Code that returns the object to convert for a non\n\t\t multiarray input object from the __array__ attribute of the\n\t\t object. */\n r = array_fromattr(op, newtype, flags);\n }\n\telse {\n\t\tif (newtype == NULL) {\n\t\t\tnewtype = _array_find_type(op, NULL, MAX_DIMS);\n\t\t}\n\t\tif (PySequence_Check(op)) {\n\t\t\t/* necessary but not sufficient */\n\t\t\t\n\t\t\tr = Array_FromSequence(op, newtype, flags & FORTRAN,\n\t\t\t\t\t min_depth, max_depth);\n\t\t\tif (PyErr_Occurred() && r == NULL)\n /* It wasn't really a sequence after all.\n * Try interpreting it as a scalar */\n PyErr_Clear();\n else\n seq = TRUE;\n }\n if (!seq)\n\t\t\tr = Array_FromScalar(op, newtype);\n\t}\n\n /* If we didn't succeed return NULL */\n if (r == NULL) return NULL;\n\t\n\t/* Be sure we succeed here */\n\t\n if(!PyArray_Check(r)) {\n PyErr_SetString(PyExc_RuntimeError, \n\t\t\t\t\"internal error: array_fromobject \"\\\n\t\t\t\t\"not producing an array\");\n\t\tPy_DECREF(r);\n return NULL;\n }\n\n if (min_depth != 0 && ((PyArrayObject *)r)->nd < min_depth) {\n PyErr_SetString(PyExc_ValueError, \n \"object of too small depth for desired array\");\n Py_DECREF(r);\n return NULL;\n }\n if (max_depth != 0 && ((PyArrayObject *)r)->nd > max_depth) {\n PyErr_SetString(PyExc_ValueError, \n \"object too deep for desired array\");\n Py_DECREF(r);\n return NULL;\n }\n return r;\n}\n\n/* new reference -- accepts NULL for mintype*/\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrFromObject(PyObject *op, PyArray_Descr *mintype)\n{\n\treturn _array_find_type(op, mintype, MAX_DIMS);\n}\n\n/*OBJECT_API\n Return the typecode of the array a Python object would be converted\n to\n*/\nstatic int \nPyArray_ObjectType(PyObject *op, int minimum_type) \n{\n\tPyArray_Descr *intype;\n\tPyArray_Descr *outtype;\n\tint ret;\n\n\tintype = PyArray_DescrFromType(minimum_type);\n\tif (intype == NULL) PyErr_Clear();\n\touttype = _array_find_type(op, intype, MAX_DIMS);\n\tret = outtype->type_num;\n\tPy_DECREF(outtype);\n\tPy_DECREF(intype);\n\treturn ret;\n}\n\n\n/* flags is any of \n CONTIGUOUS, \n FORTRAN,\n ALIGNED, \n WRITEABLE, \n NOTSWAPPED,\n ENSURECOPY, \n UPDATEIFCOPY,\n FORCECAST,\n ENSUREARRAY\n\n or'd (|) together\n\n Any of these flags present means that the returned array should \n guarantee that aspect of the array. Otherwise the returned array\n won't guarantee it -- it will depend on the object as to whether or \n not it has such features. \n\n Note that ENSURECOPY is enough\n to guarantee CONTIGUOUS, ALIGNED and WRITEABLE\n and therefore it is redundant to include those as well. \n\n BEHAVED_FLAGS == ALIGNED | WRITEABLE\n CARRAY_FLAGS = CONTIGUOUS | BEHAVED_FLAGS\n FARRAY_FLAGS = FORTRAN | BEHAVED_FLAGS\n \n FORTRAN can be set in the FLAGS to request a FORTRAN array. \n Fortran arrays are always behaved (aligned, \n notswapped, and writeable) and not (C) CONTIGUOUS (if > 1d). \n\n UPDATEIFCOPY flag sets this flag in the returned array if a copy is\n made and the base argument points to the (possibly) misbehaved array.\n When the new array is deallocated, the original array held in base\n is updated with the contents of the new array. \n\n FORCECAST will cause a cast to occur regardless of whether or not\n it is safe. \n*/\n\n\n/* steals a reference to descr -- accepts NULL */\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromAny(PyObject *op, PyArray_Descr *descr, int min_depth, \n\t\tint max_depth, int requires) \n{\n\tif (requires & ENSURECOPY) {\n\t\trequires |= DEFAULT_FLAGS;\n\t}\n\tif (requires & NOTSWAPPED) {\n\t\tif (!descr && PyArray_Check(op) && \\\n\t\t !PyArray_ISNBO(PyArray_DESCR(op)->byteorder)) {\n\t\t\tdescr = PyArray_DescrNew(PyArray_DESCR(op));\n\t\t}\n\t\telse if ((descr && !PyArray_ISNBO(descr->byteorder))) {\n\t\t\tPyArray_DESCR_REPLACE(descr);\n\t\t}\n\t\tdescr->byteorder = PyArray_NATIVE;\n\t}\n\n\treturn array_fromobject(op, descr, min_depth, max_depth,\n \t\t\t\trequires);\t\n}\n\n/* This is a quick wrapper around PyArray_FromAny(op, NULL, 0, 0, \n ENSUREARRAY) */\n/* that special cases Arrays and PyArray_Scalars up front */\n/* It *steals a reference* to the object */\n/* It also guarantees that the result is PyArray_Type or PyBigArray_Type */\n\n/* Because it decrefs op if any conversion needs to take place \n so it can be used like PyArray_EnsureArray(some_function(...)) */\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_EnsureArray(PyObject *op)\n{\n PyObject *new;\n\n if (op == NULL) return NULL;\n\n if (PyArray_CheckExact(op) || PyBigArray_CheckExact(op)) return op;\n \n if (PyArray_IsScalar(op, Generic)) {\n new = PyArray_FromScalar(op, NULL);\n Py_DECREF(op);\n return new;\n }\n new = PyArray_FROM_OF(op, ENSUREARRAY);\n Py_DECREF(op);\n return new;\n}\n\n\n\n/*OBJECT_API\n Check the type coercion rules.\n*/\nstatic int \nPyArray_CanCastSafely(int fromtype, int totype) \n{\n\tPyArray_Descr *from, *to;\n\tregister int felsize, telsize;\n\n if (fromtype == totype) return 1;\n if (fromtype == PyArray_BOOL) return 1;\n\tif (totype == PyArray_BOOL) return 0;\n if (totype == PyArray_OBJECT || totype == PyArray_VOID) return 1;\n\tif (fromtype == PyArray_OBJECT || fromtype == PyArray_VOID) return 0;\n\n\tfrom = PyArray_DescrFromType(fromtype);\n\tto = PyArray_DescrFromType(totype);\n\ttelsize = to->elsize;\n\tfelsize = from->elsize;\n\tPy_DECREF(from);\n\tPy_DECREF(to);\n\n switch(fromtype) {\n case PyArray_BYTE:\n\tcase PyArray_SHORT:\n case PyArray_INT:\n case PyArray_LONG:\n\tcase PyArray_LONGLONG:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISUNSIGNED(totype)) {\n\t\t\t\treturn (telsize > felsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (telsize >= felsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n if (felsize < 8)\n return (telsize > felsize);\n else\n return (telsize >= felsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n if (felsize < 8)\n return ((telsize >> 1) > felsize);\n else\n return ((telsize >> 1) >= felsize);\n\t\t}\n\t\telse return totype > fromtype;\n case PyArray_UBYTE:\n case PyArray_USHORT:\n case PyArray_UINT:\n\tcase PyArray_ULONG:\n\tcase PyArray_ULONGLONG:\n\t\tif (PyTypeNum_ISINTEGER(totype)) {\n\t\t\tif (PyTypeNum_ISSIGNED(totype)) {\n\t\t\t\treturn (telsize > felsize);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn (telsize >= felsize);\n\t\t\t}\n\t\t}\n\t\telse if (PyTypeNum_ISFLOAT(totype)) {\n if (felsize < 8)\n return (telsize > felsize);\n else\n return (telsize >= felsize);\n\t\t}\n\t\telse if (PyTypeNum_ISCOMPLEX(totype)) {\n if (felsize < 8)\n return ((telsize >> 1) > felsize);\n else\n return ((telsize >> 1) >= felsize);\n\t\t}\n\t\telse return totype > fromtype;\n case PyArray_FLOAT:\n case PyArray_DOUBLE:\n\tcase PyArray_LONGDOUBLE:\n\t\tif (PyTypeNum_ISCOMPLEX(totype)) \n\t\t\treturn ((telsize >> 1) >= felsize);\n\t\telse\n\t\t\treturn (totype > fromtype);\n case PyArray_CFLOAT:\n case PyArray_CDOUBLE:\n\tcase PyArray_CLONGDOUBLE:\n\t\treturn (totype > fromtype);\n\tcase PyArray_STRING:\n\tcase PyArray_UNICODE:\n\t\treturn (totype > fromtype);\n default:\n return 0;\n }\n}\n\n/* leaves reference count alone --- cannot be NULL*/\n/*OBJECT_API*/\nstatic Bool\nPyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to)\n{\n\tint fromtype=from->type_num;\n\tint totype=to->type_num;\n\tBool ret;\n\n\tret = (Bool) PyArray_CanCastSafely(fromtype, totype);\n\tif (ret) { /* Check String and Unicode more closely */\n\t\tif (fromtype == PyArray_STRING) {\n\t\t\tif (totype == PyArray_STRING) {\n\t\t\t\tret = (from->elsize <= to->elsize);\n\t\t\t}\n\t\t\telse if (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->elsize * sizeof(Py_UNICODE)\\\n\t\t\t\t <= to->elsize);\n\t\t\t}\n\t\t}\n\t\telse if (fromtype == PyArray_UNICODE) {\n\t\t\tif (totype == PyArray_UNICODE) {\n\t\t\t\tret = (from->elsize <= to->elsize);\n\t\t\t}\n\t\t}\n\t\t/* TODO: If totype is STRING or unicode \n\t\t see if the length is long enough to hold the\n\t\t stringified value of the object.\t\t \n\t\t*/\n\t}\n\treturn ret;\n}\n\n\n\n/*********************** Element-wise Array Iterator ***********************/\n/* Aided by Peter J. Verveer's nd_image package and numpy's arraymap ****/\n/* and Python's array iterator ***/\n \n\n/*OBJECT_API\n Get Iterator.\n*/\nstatic PyObject *\nPyArray_IterNew(PyObject *obj)\n{\n PyArrayIterObject *it;\n\tint i, nd; \n\tPyArrayObject *ao = (PyArrayObject *)obj;\n\n if (!PyArray_Check(ao)) {\n PyErr_BadInternalCall();\n return NULL;\n }\n\n it = (PyArrayIterObject *)_pya_malloc(sizeof(PyArrayIterObject));\n PyObject_Init((PyObject *)it, &PyArrayIter_Type);\n /* it = PyObject_New(PyArrayIterObject, &PyArrayIter_Type);*/\n if (it == NULL)\n return NULL;\n\n\tnd = ao->nd;\n\tPyArray_UpdateFlags(ao, CONTIGUOUS);\n\tit->contiguous = 0;\n\tif PyArray_ISCONTIGUOUS(ao) it->contiguous = 1;\n Py_INCREF(ao);\n it->ao = ao;\n\tit->size = PyArray_SIZE(ao);\n\tit->nd_m1 = nd - 1;\n\tit->factors[nd-1] = 1;\n\tfor (i=0; i < nd; i++) {\n\t\tit->dims_m1[i] = it->ao->dimensions[i] - 1;\n\t\tit->strides[i] = it->ao->strides[i];\n\t\tit->backstrides[i] = it->strides[i] *\t\\\n\t\t\tit->dims_m1[i];\n\t\tif (i > 0)\n\t\t\tit->factors[nd-i-1] = it->factors[nd-i] *\t\\\n\t\t\t\tit->ao->dimensions[nd-i];\n\t}\n\tPyArray_ITER_RESET(it);\n\t\n return (PyObject *)it;\n}\n\n\n/*OBJECT_API\n Get Iterator that iterates over all but one axis (don't use this with\n PyArray_ITER_GOTO1D) \n*/\nstatic PyObject *\nPyArray_IterAllButAxis(PyObject *obj, int axis)\n{\n\tPyArrayIterObject *it;\n\tit = (PyArrayIterObject *)PyArray_IterNew(obj);\n\tif (it == NULL) return NULL;\n\t\n\t/* adjust so that will not iterate over axis */\n\tit->contiguous = 0;\n\tif (it->size != 0) {\n\t\tit->size /= PyArray_DIM(obj,axis);\n\t}\n\tit->dims_m1[axis] = 0;\n\tit->backstrides[axis] = 0;\n\t\n\t/* (won't fix factors so don't use\n\t PyArray_ITER_GOTO1D with this iterator) */\n\treturn (PyObject *)it;\n}\n\n/* Returns an array scalar holding the element desired */\n\nstatic PyObject *\narrayiter_next(PyArrayIterObject *it)\n{\n\tPyObject *ret;\n\n\tif (it->index < it->size) {\n\t\tret = PyArray_ToScalar(it->dataptr, it->ao);\n\t\tPyArray_ITER_NEXT(it);\n\t\treturn ret;\n\t}\n return NULL;\n}\n\nstatic void\narrayiter_dealloc(PyArrayIterObject *it)\n{\n Py_XDECREF(it->ao);\n _pya_free(it);\n}\n\nstatic int\niter_length(PyArrayIterObject *self) \n{\n return (int) self->size;\n}\n\n\nstatic PyObject *\niter_subscript_Bool(PyArrayIterObject *self, PyArrayObject *ind)\n{\n\tint index, strides, itemsize;\n\tintp count=0;\n\tchar *dptr, *optr;\n\tPyObject *r;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\n\tif (ind->nd != 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"boolean index array should have 1 dimension\");\n\t\treturn NULL;\n\t}\n\tindex = (ind->dimensions[0]);\n\tstrides = ind->strides[0];\n\tdptr = ind->data;\n\t/* Get size of return array */\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0)\n\t\t\tcount++;\n\t\tdptr += strides;\n\t}\n\titemsize = self->ao->descr->elsize;\n\tPy_INCREF(self->ao->descr);\n\tr = PyArray_NewFromDescr(self->ao->ob_type,\n\t\t\t\t self->ao->descr, 1, &count, \n\t\t\t\t NULL, NULL,\n\t\t\t\t 0, (PyObject *)self->ao);\n\tif (r==NULL) return NULL;\n\n\t/* Set up loop */\n\toptr = PyArray_DATA(r);\n\tindex = ind->dimensions[0];\n\tdptr = ind->data;\n\n copyswap = self->ao->descr->f->copyswap;\n\t/* Loop over Boolean array */\n\tswap = !(PyArray_ISNOTSWAPPED(self->ao));\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n copyswap(optr, self->dataptr, swap, itemsize);\n\t\t\toptr += itemsize;\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t}\n\tPyArray_ITER_RESET(self);\n\treturn r;\n}\n\nstatic PyObject *\niter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)\n{\n\tintp num;\n\tPyObject *r;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint swap;\n\tchar *optr;\n\tint index;\n PyArray_CopySwapFunc *copyswap;\n\n\titemsize = self->ao->descr->elsize;\n\tif (ind->nd == 0) {\n\t\tnum = *((intp *)ind->data);\n\t\tPyArray_ITER_GOTO1D(self, num);\n\t\tr = PyArray_ToScalar(self->dataptr, self->ao);\n\t\tPyArray_ITER_RESET(self);\n\t\treturn r;\n\t}\n\t\n\tPy_INCREF(self->ao->descr);\n\tr = PyArray_NewFromDescr(self->ao->ob_type, self->ao->descr, \n\t\t\t\t ind->nd, ind->dimensions,\n\t\t\t\t NULL, NULL, \n\t\t\t\t 0, (PyObject *)self->ao);\n\tif (r==NULL) return NULL;\n\n\toptr = PyArray_DATA(r);\n\tind_it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ind);\n\tif (ind_it == NULL) {Py_DECREF(r); return NULL;}\n\tindex = ind_it->size;\n copyswap = PyArray_DESCR(r)->f->copyswap;\n swap = !PyArray_ISNOTSWAPPED(self->ao);\n\twhile(index--) {\n\t\tnum = *((intp *)(ind_it->dataptr));\n\t\tif (num < 0) num += self->size;\n\t\tif (num < 0 || num >= self->size) {\n\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t \"index %d out of bounds\"\t\t\\\n\t\t\t\t \" 0<=index<%d\", (int) num, \n\t\t\t\t (int) self->size);\n\t\t\tPy_DECREF(ind_it);\n\t\t\tPy_DECREF(r);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\treturn NULL;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(optr, self->dataptr, swap, itemsize);\n\t\toptr += itemsize;\n\t\tPyArray_ITER_NEXT(ind_it);\n\t}\n\tPy_DECREF(ind_it);\n\tPyArray_ITER_RESET(self);\n\treturn r;\n}\n\n\nstatic PyObject *\niter_subscript(PyArrayIterObject *self, PyObject *ind)\n{\n\tPyArray_Descr *indtype=NULL;\n\tintp start, step_size;\n\tintp n_steps;\n\tPyObject *r;\n\tchar *dptr;\n\tint size;\n\tPyObject *obj = NULL;\n\tint swap;\n PyArray_CopySwapFunc *copyswap;\n\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\tobj = iter_subscript(self, ind);\n\t\tPy_DECREF(ind);\n\t\treturn obj;\n\t}\n\tif (PyTuple_Check(ind)) {\n\t\tint len;\n\t\tlen = PyTuple_GET_SIZE(ind);\n\t\tif (len > 1) goto fail;\n\t\tind = PyTuple_GET_ITEM(ind, 0);\n\t}\n\n\t/* Tuples >1d not accepted --- i.e. no NewAxis */\n\t/* Could implement this with adjusted strides\n\t and dimensions in iterator */\n\n\t/* Check for Boolean -- this is first becasue\n\t Bool is a subclass of Int */\n\tPyArray_ITER_RESET(self);\n\n\tif (PyBool_Check(ind)) {\n\t\tif (PyObject_IsTrue(ind)) {\n\t\t\treturn PyArray_ToScalar(self->dataptr, self->ao);\n\t\t}\n\t\telse { /* empty array */\n\t\t\tintp ii = 0;\n\t\t\tPy_INCREF(self->ao->descr);\n\t\t\tr = PyArray_NewFromDescr(self->ao->ob_type, \n\t\t\t\t\t\t self->ao->descr,\n\t\t\t\t\t\t 1, &ii, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)self->ao);\n\t\t\treturn r;\t\t\t\n\t\t}\n\t}\n\n\t/* Check for Integer or Slice */ \t\n\t\n\tif (PyLong_Check(ind) || PyInt_Check(ind) || PySlice_Check(ind)) {\n\t\tstart = parse_subindex(ind, &step_size, &n_steps, \n\t\t\t\t self->size);\n\t\tif (start == -1) \n\t\t\tgoto fail;\n\t\tif (n_steps == RubberIndex || n_steps == PseudoIndex) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"cannot use Ellipsis or NewAxes here\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, start)\n\t\tif (n_steps == SingleIndex) { /* Integer */\n\t\t\tr = PyArray_ToScalar(self->dataptr, self->ao);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\treturn r;\n\t\t}\n\t\tsize = self->ao->descr->elsize;\n\t\tPy_INCREF(self->ao->descr);\n\t\tr = PyArray_NewFromDescr(self->ao->ob_type, \n\t\t\t\t\t self->ao->descr, \n\t\t\t\t\t 1, &n_steps, \n\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t 0, (PyObject *)self->ao);\n\t\tif (r==NULL) goto fail; \n\t\tdptr = PyArray_DATA(r);\n swap = !PyArray_ISNOTSWAPPED(self->ao);\n copyswap = PyArray_DESCR(r)->f->copyswap;\n\t\twhile(n_steps--) {\n copyswap(dptr, self->dataptr, swap, size);\n\t\t\tstart += step_size;\n\t\t\tPyArray_ITER_GOTO1D(self, start)\n\t\t\tdptr += size;\n\t\t}\n\t\tPyArray_ITER_RESET(self);\n\t\treturn r;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_IsScalar(ind, Integer) || PyList_Check(ind)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromAny(ind, indtype, 0, 0, FORCECAST);\n\t\tif (obj == NULL) goto fail;\n\t}\n\telse {\n\t\tPy_INCREF(ind);\n\t\tobj = ind;\n\t}\n\t\n\tif (PyArray_Check(obj)) {\n\t\t/* Check for Boolean object */\n\t\tif (PyArray_TYPE(obj)==PyArray_BOOL) {\n\t\t\tr = iter_subscript_Bool(self, (PyArrayObject *)obj);\n\t\t\tPy_DECREF(indtype);\n\t\t} \n\t\t/* Check for integer array */\n\t\telse if (PyArray_ISINTEGER(obj)) {\n\t\t\tPyObject *new;\n\t\t\tnew = PyArray_FromAny(obj, indtype, 0, 0, \n\t\t\t\t\t FORCECAST | ALIGNED);\n\t\t\tif (new==NULL) goto fail;\n Py_DECREF(obj);\n\t\t\tobj = new;\n\t\t\tr = iter_subscript_int(self, (PyArrayObject *)obj);\n\t\t}\n\t\telse {\n\t\t\tgoto fail;\n\t\t}\n\t\tPy_DECREF(obj);\n\t\treturn r;\n\t}\n\telse Py_DECREF(indtype);\n\n\n fail:\n\tif (!PyErr_Occurred())\n\t\tPyErr_SetString(PyExc_IndexError, \"unsupported iterator index\");\n\tPy_XDECREF(indtype);\n\tPy_XDECREF(obj);\n\treturn NULL;\n\n}\n\n\nstatic int\niter_ass_sub_Bool(PyArrayIterObject *self, PyArrayObject *ind,\n\t\t PyArrayIterObject *val, int swap)\n{\n\tint index, strides, itemsize;\n\tchar *dptr;\n PyArray_CopySwapFunc *copyswap;\n\n\tif (ind->nd != 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"boolean index array should have 1 dimension\");\n\t\treturn -1;\n\t}\n\titemsize = self->ao->descr->elsize;\n\tindex = ind->dimensions[0];\n\tstrides = ind->strides[0];\n\tdptr = ind->data;\n\tPyArray_ITER_RESET(self);\n\t/* Loop over Boolean array */\n copyswap = self->ao->descr->f->copyswap;\n\twhile(index--) {\n\t\tif (*((Bool *)dptr) != 0) {\n copyswap(self->dataptr, val->dataptr, swap,\n\t\t\t\t itemsize);\n\t\t\tPyArray_ITER_NEXT(val);\n\t\t\tif (val->index==val->size) \n\t\t\t\tPyArray_ITER_RESET(val);\n\t\t}\n\t\tdptr += strides;\n\t\tPyArray_ITER_NEXT(self);\n\t}\n\tPyArray_ITER_RESET(self);\n\treturn 0;\n}\n\nstatic int\niter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,\n\t\t PyArrayIterObject *val, int swap)\n{\n\tPyArray_Descr *typecode;\n\tintp num;\n\tPyArrayIterObject *ind_it;\n\tint itemsize;\n\tint index;\n PyArray_CopySwapFunc *copyswap;\n\n\ttypecode = self->ao->descr;\n\titemsize = typecode->elsize;\n copyswap = self->ao->descr->f->copyswap;\n\tif (ind->nd == 0) {\n\t\tnum = *((intp *)ind->data);\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(self->dataptr, val->dataptr, swap, itemsize);\n\t\treturn 0;\n\t}\n\tind_it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ind);\n\tif (ind_it == NULL) return -1;\n\tindex = ind_it->size;\n\twhile(index--) {\n\t\tnum = *((intp *)(ind_it->dataptr));\n\t\tif (num < 0) num += self->size;\n\t\tif ((num < 0) || (num >= self->size)) {\n\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t \"index %d out of bounds\"\t\t\\\n\t\t\t\t \" 0<=index<%d\", (int) num, \n\t\t\t\t (int) self->size);\n\t\t\tPy_DECREF(ind_it);\n\t\t\treturn -1;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, num);\n copyswap(self->dataptr, val->dataptr, swap, itemsize);\n\t\tPyArray_ITER_NEXT(ind_it);\n\t\tPyArray_ITER_NEXT(val);\n\t\tif (val->index == val->size) \n\t\t\tPyArray_ITER_RESET(val);\n\t}\n\tPy_DECREF(ind_it);\n\treturn 0;\n}\n\nstatic int\niter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val) \n{\n\tPyObject *arrval=NULL;\n\tPyArrayIterObject *val_it=NULL;\n\tPyArray_Descr *type;\n\tPyArray_Descr *indtype=NULL;\n\tint swap, retval=-1;\n\tint itemsize;\n\tintp start, step_size;\n\tintp n_steps;\n\tPyObject *obj=NULL;\n PyArray_CopySwapFunc *copyswap;\n\n\t\n\tif (ind == Py_Ellipsis) {\n\t\tind = PySlice_New(NULL, NULL, NULL);\n\t\tretval = iter_ass_subscript(self, ind, val);\n\t\tPy_DECREF(ind);\n\t\treturn retval;\n\t}\n\n\tif (PyTuple_Check(ind)) {\n\t\tint len;\n\t\tlen = PyTuple_GET_SIZE(ind);\n\t\tif (len > 1) goto finish;\n\t\tind = PyTuple_GET_ITEM(ind, 0);\n\t}\n\n\ttype = self->ao->descr;\n\titemsize = type->elsize;\n\t\n\tPy_INCREF(type);\n\tarrval = PyArray_FromAny(val, type, 0, 0, 0);\n\tif (arrval==NULL) return -1;\n\tval_it = (PyArrayIterObject *)PyArray_IterNew(arrval);\n\tif (val_it==NULL) goto finish;\n\n\t/* Check for Boolean -- this is first becasue\n\t Bool is a subclass of Int */\n\n copyswap = PyArray_DESCR(arrval)->f->copyswap;\n\tswap = (PyArray_ISNOTSWAPPED(self->ao)!=PyArray_ISNOTSWAPPED(arrval));\n\tif (PyBool_Check(ind)) {\n\t\tif (PyObject_IsTrue(ind)) {\n copyswap(self->dataptr, PyArray_DATA(arrval), \n swap, itemsize);\n\t\t}\n\t\tretval=0;\n\t\tgoto finish;\n\t}\n\n\t/* Check for Integer or Slice */\n\t\n\tif (PyLong_Check(ind) || PyInt_Check(ind) || PySlice_Check(ind)) {\n\t\tstart = parse_subindex(ind, &step_size, &n_steps, \n\t\t\t\t self->size);\n\t\tif (start == -1) goto finish;\n\t\tif (n_steps == RubberIndex || n_steps == PseudoIndex) {\n\t\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\"cannot use Ellipsis or NewAxes here\");\n\t\t\tgoto finish;\n\t\t}\n\t\tPyArray_ITER_GOTO1D(self, start);\n\t\tif (n_steps == SingleIndex) { /* Integer */\n copyswap(self->dataptr, PyArray_DATA(arrval),\n swap, itemsize);\n\t\t\tPyArray_ITER_RESET(self);\n\t\t\tretval=0;\n\t\t\tgoto finish;\n\t\t}\n\t\twhile(n_steps--) {\n copyswap(self->dataptr, val_it->dataptr,\n swap, itemsize);\n\t\t\tstart += step_size;\n\t\t\tPyArray_ITER_GOTO1D(self, start)\n\t\t\tPyArray_ITER_NEXT(val_it);\n\t\t\tif (val_it->index == val_it->size) \n\t\t\t\tPyArray_ITER_RESET(val_it);\n\t\t}\n\t\tPyArray_ITER_RESET(self);\n\t\tretval = 0;\n\t\tgoto finish;\n\t} \n\n\t/* convert to INTP array if Integer array scalar or List */\n\n\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\tif (PyArray_IsScalar(ind, Integer)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromScalar(ind, indtype);\n\t}\n\telse if (PyList_Check(ind)) {\n\t\tPy_INCREF(indtype);\n\t\tobj = PyArray_FromAny(ind, indtype, 0, 0, FORCECAST);\n\t}\n\telse {\n\t\tPy_INCREF(ind);\n\t\tobj = ind;\n\t}\n\t\n\tif (PyArray_Check(obj)) {\n\t\t/* Check for Boolean object */\n\t\tif (PyArray_TYPE(obj)==PyArray_BOOL) {\n\t\t\tif (iter_ass_sub_Bool(self, (PyArrayObject *)obj,\n\t\t\t\t\t val_it, swap) < 0)\n\t\t\t\tgoto finish;\n\t\t\tretval=0;\n\t\t} \n\t\t/* Check for integer array */\n\t\telse if (PyArray_ISINTEGER(obj)) {\n\t\t\tPyObject *new;\n\t\t\tPy_INCREF(indtype);\n\t\t\tnew = PyArray_FromAny(obj, indtype, 0, 0, \n\t\t\t\t\t FORCECAST | BEHAVED_FLAGS);\n\t\t\tPy_DECREF(obj);\n\t\t\tobj = new;\n\t\t\tif (new==NULL) goto finish;\n\t\t\tif (iter_ass_sub_int(self, (PyArrayObject *)obj,\n\t\t\t\t\t val_it, swap) < 0)\n\t\t\t\tgoto finish;\n\t\t\tretval=0;\n\t\t}\n\t}\n\n finish:\n\tif (!PyErr_Occurred() && retval < 0)\n\t\tPyErr_SetString(PyExc_IndexError, \n\t\t\t\t\"unsupported iterator index\");\n\tPy_XDECREF(indtype);\n\tPy_XDECREF(obj);\n\tPy_XDECREF(val_it);\n\tPy_XDECREF(arrval);\n\treturn retval;\n\t\n}\n\n\nstatic PyMappingMethods iter_as_mapping = {\n (inquiry)iter_length,\t\t /*mp_length*/\n (binaryfunc)iter_subscript,\t /*mp_subscript*/\n (objobjargproc)iter_ass_subscript,\t/*mp_ass_subscript*/\n};\n\nstatic char doc_iter_array[] = \"__array__(type=None)\\n Get array \"\\\n \"from iterator\";\n\nstatic PyObject *\niter_array(PyArrayIterObject *it, PyObject *op) \n{\n \n PyObject *r;\n intp size;\n\n /* Any argument ignored */\n\n /* Two options: \n 1) underlying array is contiguous\n -- return 1-d wrapper around it \n 2) underlying array is not contiguous\n -- make new 1-d contiguous array with updateifcopy flag set\n to copy back to the old array\n */\n\n size = PyArray_SIZE(it->ao);\n\tPy_INCREF(it->ao->descr);\n if (PyArray_ISCONTIGUOUS(it->ao)) {\n r = PyArray_NewFromDescr(it->ao->ob_type, \n\t\t\t\t\t it->ao->descr,\n\t\t\t\t\t 1, &size, \n\t\t\t\t\t NULL, it->ao->data, \n\t\t\t\t\t it->ao->flags,\n\t\t\t\t\t (PyObject *)it->ao); \n\t\tif (r==NULL) return NULL;\n }\n else {\n r = PyArray_NewFromDescr(it->ao->ob_type, \n\t\t\t\t\t it->ao->descr,\n\t\t\t\t\t 1, &size, \n\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t 0, (PyObject *)it->ao);\n\t\tif (r==NULL) return NULL;\n\t\tif (PyArray_CopyInto((PyArrayObject *)r, it->ao) < 0) {\n\t\t\tPy_DECREF(r); \n\t\t\treturn NULL;\n\t\t}\n PyArray_FLAGS(r) |= UPDATEIFCOPY;\n it->ao->flags &= ~WRITEABLE;\n }\n Py_INCREF(it->ao);\n PyArray_BASE(r) = (PyObject *)it->ao;\n return r;\n \n}\n\nstatic char doc_iter_copy[] = \"copy()\\n Get a copy of 1-d array\";\n\nstatic PyObject *\niter_copy(PyArrayIterObject *it, PyObject *args)\n{\n if (!PyArg_ParseTuple(args, \"\")) return NULL;\t\n\treturn PyArray_Flatten(it->ao, 0);\n}\n\nstatic PyMethodDef iter_methods[] = {\n /* to get array */\n {\"__array__\", (PyCFunction)iter_array, 1, doc_iter_array},\n\t{\"copy\", (PyCFunction)iter_copy, 1, doc_iter_copy},\n {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic PyMemberDef iter_members[] = {\n\t{\"base\", T_OBJECT, offsetof(PyArrayIterObject, ao), RO, NULL},\n\t{NULL},\n};\n\nstatic PyTypeObject PyArrayIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.flatiter\",\t\t /* tp_name */\n sizeof(PyArrayIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arrayiter_dealloc,\t\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, \t\t\t /* tp_as_sequence */\n &iter_as_mapping, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n (iternextfunc)arrayiter_next,\t\t/* tp_iternext */\n iter_methods,\t\t\t\t/* tp_methods */\n iter_members,\t \t /* tp_members */\n 0, /* tp_getset */\n\n};\n\n/** END of Array Iterator **/\n\n\n\n/*********************** Subscript Array Iterator *************************\n * *\n * This object handles subscript behavior for array objects. *\n * It is an iterator object with a next method *\n * It abstracts the n-dimensional mapping behavior to make the looping *\n * code more understandable (maybe) *\n * and so that indexing can be set up ahead of time *\n */ \n\n/* This checks the args for any fancy indexing objects */\n\n#define SOBJ_NOTFANCY 0 \n#define SOBJ_ISFANCY 1\n#define SOBJ_BADARRAY 2\n#define SOBJ_TOOMANY 3\n#define SOBJ_LISTTUP 4\n\nstatic int\nfancy_indexing_check(PyObject *args)\n{\n\tint i, n;\n\tPyObject *obj;\n\tint retval = SOBJ_NOTFANCY;\n\n\tif (PyTuple_Check(args)) {\n\t\tn = PyTuple_GET_SIZE(args);\n\t\tif (n >= MAX_DIMS) return SOBJ_TOOMANY;\n\t\tfor (i=0; i=MAX_DIMS) return SOBJ_ISFANCY;\n\t\tfor (i=0; i SOBJ_ISFANCY) return retval;\n\t\t}\n\t}\n\n\treturn retval;\n}\n\n/* convert an indexing object to an INTP indexing array iterator\n if possible -- otherwise, it is a Slice or Ellipsis object\n and has to be interpreted on bind to a particular \n array so leave it NULL for now.\n */\nstatic int\n_convert_obj(PyObject *obj, PyArrayIterObject **iter)\n{\n\tPyArray_Descr *indtype;\n\tPyObject *arr;\n\n\tif (PySlice_Check(obj) || (obj == Py_Ellipsis))\n\t\t*iter = NULL;\n\telse {\n\t\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\t\tarr = PyArray_FromAny(obj, indtype, 0, 0, FORCECAST);\n\t\tif (arr == NULL) return -1;\n\t\t*iter = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\tPy_DECREF(arr);\n\t\tif (*iter == NULL) return -1;\n\t}\n\treturn 0;\n}\n\n/* Adjust dimensionality and strides for index object iterators \n --- i.e. broadcast\n */\n/*OBJECT_API*/\nstatic int\nPyArray_Broadcast(PyArrayMultiIterObject *mit)\n{\n\tint i, nd, k, j;\n\tintp tmp;\n\tPyArrayIterObject *it;\n\t\n\t/* Discover the broadcast number of dimensions */\n\tfor (i=0, nd=0; inumiter; i++) \n\t\tnd = MAX(nd, mit->iters[i]->ao->nd);\n\tmit->nd = nd;\n\n\t/* Discover the broadcast shape in each dimension */\n\tfor (i=0; idimensions[i] = 1;\n\t\tfor (j=0; jnumiter; j++) {\n\t\t\tit = mit->iters[j];\n\t\t\t/* This prepends 1 to shapes not already \n\t\t\t equal to nd */\n\t\t\tk = i + it->ao->nd - nd;\n\t\t\tif (k>=0) {\n\t\t\t\ttmp = it->ao->dimensions[k];\n\t\t\t\tif (tmp == 1) continue;\n\t\t\t\tif (mit->dimensions[i] == 1) \n\t\t\t\t\tmit->dimensions[i] = tmp;\n\t\t\t\telse if (mit->dimensions[i] != tmp) {\n\t\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\t\"index objects are \" \\\n\t\t\t\t\t\t\t\"not broadcastable \" \\\n\t\t\t\t\t\t\t\"to a single shape\");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Reset the iterator dimensions and strides of each iterator\n\t object -- using 0 valued strides for broadcasting */\n\n\ttmp = PyArray_MultiplyList(mit->dimensions, mit->nd);\n\tmit->size = tmp;\n\tfor (i=0; inumiter; i++) {\n\t\tit = mit->iters[i];\n\t\tit->nd_m1 = mit->nd - 1;\n\t\tit->size = tmp;\n\t\tnd = it->ao->nd;\n\t\tit->factors[mit->nd-1] = 1;\n\t\tfor (j=0; j < mit->nd; j++) {\n\t\t\tit->dims_m1[j] = mit->dimensions[j] - 1;\n\t\t\tk = j + nd - mit->nd;\n\t\t\t/* If this dimension was added or shape\n\t\t\t of underlying array was 1 */\n\t\t\tif ((k < 0) || \\\n\t\t\t it->ao->dimensions[k] != mit->dimensions[j]) {\n\t\t\t\tit->contiguous = 0;\n\t\t\t\tit->strides[j] = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tit->strides[j] = it->ao->strides[k];\n\t\t\t}\n\t\t\tit->backstrides[j] = it->strides[j] *\t\\\n\t\t\t\tit->dims_m1[j];\n\t\t\tif (j > 0)\n\t\t\t\tit->factors[mit->nd-j-1] =\t\t\\\n\t\t\t\t\tit->factors[mit->nd-j] *\t\\\n\t\t\t\t\tmit->dimensions[mit->nd-j];\n\t\t}\n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn 0;\n}\n\n/* Reset the map iterator to the beginning */\nstatic void\nPyArray_MapIterReset(PyArrayMapIterObject *mit)\n{\n\tint i,j; intp coord[MAX_DIMS];\n\tPyArrayIterObject *it;\n\tPyArray_CopySwapFunc *copyswap;\n\n\tmit->index = 0;\n\n\tcopyswap = mit->iters[0]->ao->descr->f->copyswap;\n\n\tif (mit->subspace != NULL) {\n\t\tmemcpy(coord, mit->bscoord, sizeof(intp)*mit->ait->ao->nd);\n\t\tPyArray_ITER_RESET(mit->subspace);\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_RESET(it);\n\t\t\tj = mit->iteraxes[i];\n\t\t\tcopyswap(coord+j,it->dataptr,\n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->subspace->dataptr = mit->ait->dataptr;\n\t\tmit->dataptr = mit->subspace->dataptr;\n\t}\n\telse {\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_RESET(it);\n\t\t\tcopyswap(coord+i,it->dataptr, \n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->dataptr = mit->ait->dataptr;\n\t}\n\treturn;\n}\n\n/* This function needs to update the state of the map iterator\n and point mit->dataptr to the memory-location of the next object\n*/\nstatic void\nPyArray_MapIterNext(PyArrayMapIterObject *mit)\n{\n\tint i, j;\n\tintp coord[MAX_DIMS];\n\tPyArrayIterObject *it;\n\tPyArray_CopySwapFunc *copyswap;\n\n\tmit->index += 1;\n\tif (mit->index >= mit->size) return;\n\tcopyswap = mit->iters[0]->ao->descr->f->copyswap;\n\t/* Sub-space iteration */\n\tif (mit->subspace != NULL) {\n\t\tPyArray_ITER_NEXT(mit->subspace);\n\t\tif (mit->subspace->index == mit->subspace->size) {\n\t\t\t/* reset coord to coordinates of \n\t\t\t beginning of the subspace */\n\t\t\tmemcpy(coord, mit->bscoord, \n\t\t\t sizeof(intp)*mit->ait->ao->nd);\n\t\t\tPyArray_ITER_RESET(mit->subspace);\n\t\t\tfor (i=0; inumiter; i++) {\n\t\t\t\tit = mit->iters[i];\n\t\t\t\tPyArray_ITER_NEXT(it);\n\t\t\t\tj = mit->iteraxes[i];\n\t\t\t\tcopyswap(coord+j,it->dataptr,\n\t\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t\t sizeof(intp));\n\t\t\t}\n\t\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\t\tmit->subspace->dataptr = mit->ait->dataptr;\n\t\t}\n\t\tmit->dataptr = mit->subspace->dataptr;\n\t}\n\telse {\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tit = mit->iters[i];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tcopyswap(coord+i,it->dataptr, \n\t\t\t\t !PyArray_ISNOTSWAPPED(it->ao),\n\t\t\t\t sizeof(intp));\n\t\t}\n\t\tPyArray_ITER_GOTO(mit->ait, coord);\n\t\tmit->dataptr = mit->ait->dataptr;\n\t}\n\treturn;\n}\n\n/* Bind a mapiteration to a particular array */\n\n/* Determine if subspace iteration is necessary. If so, \n 1) Fill in mit->iteraxes\n\t 2) Create subspace iterator\n\t 3) Update nd, dimensions, and size. \n\n Subspace iteration is necessary if: arr->nd > mit->numiter\n*/\n\n/* Need to check for index-errors somewhere. \n\n Let's do it at bind time and also convert all <0 values to >0 here\n as well. \n*/\nstatic void\nPyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)\n{\n\tint subnd;\n\tPyObject *sub, *obj=NULL;\n\tint i, j, n, curraxis, ellipexp, noellip;\n\tPyArrayIterObject *it;\n\tintp dimsize;\n\tintp *indptr;\n\t\n\tsubnd = arr->nd - mit->numiter;\n\tif (subnd < 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"too many indices for array\");\n\t\treturn;\n\t}\n\n\tmit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);\n\tif (mit->ait == NULL) return;\n\n\t/* If this is just a view, then do nothing more */\n\t/* views are handled by just adjusting the strides\n\t and dimensions of the object.\n\t*/\n\t \n\tif (mit->view) return;\n\n\t/* no subspace iteration needed. Finish up and Return */\n\tif (subnd == 0) {\n\t\tn = arr->nd;\n\t\tfor (i=0; iiteraxes[i] = i;\n\t\t}\n\t\tgoto finish;\n\t}\n\n\t/* all indexing arrays have been converted to 0 \n\t therefore we can extract the subspace with a simple\n\t getitem call which will use view semantics\n\t*/\n\t\n\tsub = PyObject_GetItem((PyObject *)arr, mit->indexobj);\n\tif (sub == NULL) goto fail;\n\tmit->subspace = (PyArrayIterObject *)PyArray_IterNew(sub);\n\tPy_DECREF(sub);\n\tif (mit->subspace == NULL) goto fail;\n\t\n\t/* Expand dimensions of result */\n\tn = mit->subspace->ao->nd;\n\tfor (i=0; idimensions[mit->nd+i] = mit->subspace->ao->dimensions[i];\n\tmit->nd += n;\n\n\t/* Now, we still need to interpret the ellipsis and slice objects \n\t to determine which axes the indexing arrays are referring to\n\t*/\n\tn = PyTuple_GET_SIZE(mit->indexobj);\n\n\t/* The number of dimensions an ellipsis takes up */\n\tellipexp = arr->nd - n + 1;\n\t/* Now fill in iteraxes -- remember indexing arrays have been \n converted to 0's in mit->indexobj */\n\tcurraxis = 0;\n\tj = 0;\n\tnoellip = 1; /* Only expand the first ellipsis */\n\tmemset(mit->bscoord, 0, sizeof(intp)*arr->nd);\n\tfor (i=0; iindexobj, i);\n\t\tif (PyInt_Check(obj) || PyLong_Check(obj)) \n\t\t\tmit->iteraxes[j++] = curraxis++;\n\t\telse if (noellip && obj == Py_Ellipsis) {\n\t\t\tcurraxis += ellipexp;\n\t\t\tnoellip = 0;\n\t\t}\n\t\telse {\n\t\t\tintp start=0;\n\t\t\tintp stop, step;\n\t\t\t/* Should be slice object or\n\t\t\t another Ellipsis */\n\t\t\tif (obj == Py_Ellipsis) {\n\t\t\t\tmit->bscoord[curraxis] = 0;\n\t\t\t}\n\t\t\telse if (!PySlice_Check(obj) || \\\n\t\t\t\t (slice_GetIndices((PySliceObject *)obj, \n\t\t\t\t\t\t arr->dimensions[curraxis],\n\t\t\t\t\t\t &start, &stop, &step,\n\t\t\t\t\t\t &dimsize) < 0)) {\n\t\t\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t\t\t \"unexpected object \"\t\\\n\t\t\t\t\t \"(%s) in selection position %d\",\n\t\t\t\t\t obj->ob_type->tp_name, i);\n\t\t\t goto fail;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmit->bscoord[curraxis] = start;\n\t\t\t}\n\t\t\tcurraxis += 1; \n\t\t}\n\t}\n finish:\n\t/* Here check the indexes (now that we have iteraxes) */\n\tmit->size = PyArray_MultiplyList(mit->dimensions, mit->nd);\n\tfor (i=0; inumiter; i++) {\n\t\tit = mit->iters[i];\n\t\tPyArray_ITER_RESET(it);\n\t\tdimsize = arr->dimensions[mit->iteraxes[i]];\n\t\twhile(it->index < it->size) {\n\t\t\tindptr = ((intp *)it->dataptr);\n\t\t\tif (*indptr < 0) *indptr += dimsize;\n\t\t\tif (*indptr < 0 || *indptr >= dimsize) {\n\t\t\t\tPyErr_Format(PyExc_IndexError,\n\t\t\t\t\t \"index (%d) out of range \"\\\n\t\t\t\t\t \"(0<=index<=%d) in dimension %d\",\n\t\t\t\t\t (int) *indptr, (int) (dimsize-1), \n\t\t\t\t\t mit->iteraxes[i]);\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t} \n\t\tPyArray_ITER_RESET(it);\n\t}\n\treturn;\n\n fail:\n\tPy_XDECREF(mit->subspace);\n\tPy_XDECREF(mit->ait);\n\tmit->subspace = NULL;\n\tmit->ait = NULL;\n\treturn;\n}\n\n/* This function takes a Boolean array and constructs index objects and\n iterators as if nonzero(Bool) had been called\n*/\nstatic int\n_nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)\n{\n\tPyArray_Descr *typecode;\n\tPyArrayObject *ba =NULL, *new=NULL;\n\tint nd, j;\n\tintp size, i, count;\n\tBool *ptr;\n\tintp coords[MAX_DIMS], dims_m1[MAX_DIMS];\n\tintp *dptr[MAX_DIMS];\n\n\ttypecode=PyArray_DescrFromType(PyArray_BOOL);\n\tba = (PyArrayObject *)PyArray_FromAny(myBool, typecode, 0, 0, \n\t\t\t\t\t CARRAY_FLAGS);\n\tif (ba == NULL) return -1;\n\tnd = ba->nd;\n\tfor (j=0; jdata;\n\tcount = 0;\n\n\t/* pre-determine how many nonzero entries there are */\n\tfor (i=0; iao->data;\n\t\tcoords[j] = 0;\n\t\tdims_m1[j] = ba->dimensions[j]-1;\n\t}\n\n\tptr = (Bool *)ba->data;\n\n\tif (count == 0) goto finish;\n\t\n\t/* Loop through the Boolean array and copy coordinates\n\t for non-zero entries */\n\tfor (i=0; i=0; j--) {\n\t\t\tif (coords[j] < dims_m1[j]) {\n\t\t\t\tcoords[j]++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcoords[j] = 0;\n\t\t\t}\n\t\t}\n\t}\n\n finish:\n\tPy_DECREF(ba);\n\treturn nd;\n\n fail:\n\tfor (j=0; jiters[i] = NULL;\n \tmit->view = 0;\n \tmit->index = 0;\n \tmit->ait = NULL;\n \tmit->subspace = NULL;\n\tmit->numiter = 0;\n\tmit->consec = 1;\n\tfancy = fancy_indexing_check(indexobj);\n\tPy_INCREF(indexobj);\n\tmit->indexobj = indexobj;\n\tif (fancy == SOBJ_NOTFANCY) { /* bail out */\n\t\tmit->view = 1;\n\t\tgoto ret;\n\t}\n\n\tif (fancy == SOBJ_BADARRAY) {\n\t\tPyErr_SetString(PyExc_IndexError,\t\t\t\\\n\t\t\t\t\"arrays used as indices must be of \" \\\n\t\t\t\t\"integer type\");\n\t\tgoto fail;\n\t}\n\tif (fancy == SOBJ_TOOMANY) {\n\t\tPyErr_SetString(PyExc_IndexError, \"too many indices\");\n\t\tgoto fail;\n\t}\n\n\tif (fancy == SOBJ_LISTTUP) {\n\t\tPyObject *newobj;\n\t\tnewobj = PySequence_Tuple(indexobj);\n\t\tif (newobj == NULL) goto fail;\n\t\tPy_DECREF(indexobj);\n\t\tindexobj = newobj;\n\t\tmit->indexobj = indexobj;\n\t}\n\n#undef SOBJ_NOTFANCY \n#undef SOBJ_ISFANCY \n#undef SOBJ_BADARRAY \n#undef SOBJ_TOOMANY \n#undef SOBJ_LISTTUP \n\n\tif (oned) return (PyObject *)mit;\n\n\t/* Must have some kind of fancy indexing if we are here */\n\t/* indexobj is either a list, an arrayobject, or a tuple \n\t (with at least 1 list or arrayobject or Bool object), */\n\t\n\t/* convert all inputs to iterators */\n\tif (PyArray_Check(indexobj) &&\t\t\t\\\n\t (PyArray_TYPE(indexobj) == PyArray_BOOL)) {\n\t\tmit->numiter = _nonzero_indices(indexobj, mit->iters);\n\t\tif (mit->numiter < 0) goto fail;\n\t\tmit->nd = 1;\n\t\tmit->dimensions[0] = mit->iters[0]->dims_m1[0]+1;\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = PyTuple_New(mit->numiter);\n\t\tif (mit->indexobj == NULL) goto fail;\n\t\tfor (i=0; inumiter; i++) {\n\t\t\tPyTuple_SET_ITEM(mit->indexobj, i, \n\t\t\t\t\t PyInt_FromLong(0));\n\t\t}\n\t}\n\n\telse if (PyArray_Check(indexobj) || !PyTuple_Check(indexobj)) {\n\t\tmit->numiter = 1;\n\t\tindtype = PyArray_DescrFromType(PyArray_INTP);\n\t\tarr = PyArray_FromAny(indexobj, indtype, 0, 0, FORCECAST);\n\t\tif (arr == NULL) goto fail;\n\t\tmit->iters[0] = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\tif (mit->iters[0] == NULL) {Py_DECREF(arr); goto fail;}\n\t\tmit->nd = PyArray_NDIM(arr);\n\t\tmemcpy(mit->dimensions,PyArray_DIMS(arr),mit->nd*sizeof(intp));\n\t\tmit->size = PyArray_SIZE(arr);\n\t\tPy_DECREF(arr);\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = Py_BuildValue(\"(N)\", PyInt_FromLong(0));\n\t}\n\telse { /* must be a tuple */\n\t\tPyObject *obj;\n\t\tPyArrayIterObject *iter;\n\t\tPyObject *new;\n\t\t/* Make a copy of the tuple -- we will be replacing \n\t\t index objects with 0's */\n\t\tn = PyTuple_GET_SIZE(indexobj);\n\t\tnew = PyTuple_New(n);\n\t\tif (new == NULL) goto fail;\n\t\tstarted = 0;\n\t\tnonindex = 0;\n\t\tfor (i=0; iconsec = 0;\n\t\t\t\tmit->iters[(mit->numiter)++] = iter;\n\t\t\t\tPyTuple_SET_ITEM(new,i,\n\t\t\t\t\t\t PyInt_FromLong(0));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (started) nonindex = 1;\n\t\t\t\tPy_INCREF(obj);\n\t\t\t\tPyTuple_SET_ITEM(new,i,obj);\n\t\t\t}\n\t\t}\n\t\tPy_DECREF(mit->indexobj);\n\t\tmit->indexobj = new;\n\t\t/* Store the number of iterators actually converted */\n\t\t/* These will be mapped to actual axes at bind time */\n\t\tif (PyArray_Broadcast((PyArrayMultiIterObject *)mit) < 0)\n\t\t\tgoto fail;\n\t}\n\n ret:\n return (PyObject *)mit;\n \n fail:\n Py_DECREF(mit);\n\treturn NULL;\n}\n\n\nstatic void\narraymapiter_dealloc(PyArrayMapIterObject *mit)\n{\n\tint i;\n\tPy_XDECREF(mit->indexobj);\n Py_XDECREF(mit->ait);\n\tPy_XDECREF(mit->subspace);\n\tfor (i=0; inumiter; i++)\n\t\tPy_XDECREF(mit->iters[i]);\n _pya_free(mit);\n}\n\n/* The mapiter object must be created new each time. It does not work\n to bind to a new array, and continue.\n\n This was the orginal intention, but currently that does not work. \n Do not expose the MapIter_Type to Python.\n\n It's not very useful anyway, since mapiter(indexobj); mapiter.bind(a); \n mapiter is equivalent to a[indexobj].flat but the latter gets to use \n slice syntax.\n*/\n\nstatic PyTypeObject PyArrayMapIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.mapiter\",\t\t \t/* tp_name */\n sizeof(PyArrayIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraymapiter_dealloc,\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0,\t\t\t\t\t/* tp_as_sequence */\n 0,\t\t\t\t\t/* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0, \t\t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n (traverseproc)0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0,\t\t \t /* tp_iter */\n (iternextfunc)0, \t /* tp_iternext */\n 0, \t /* tp_methods */\n 0,\t\t\t\t\t /* tp_members */\n 0,\t\t\t /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n 0, \t /* tp_alloc */\n 0,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n\n};\n\n/** END of Subscript Iterator **/\n\n\n/*OBJECT_API\n Get MultiIterator,\n*/\nstatic PyObject *\nPyArray_MultiIterNew(int n, ...)\n{\n va_list va;\n\tPyArrayMultiIterObject *multi;\n\tPyObject *current;\n\tPyObject *arr;\n\t\n\tint i, err=0;\n\t\n\tif (n < 2 || n > MAX_DIMS) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"Need between 2 and (%d) \"\t\t\t\\\n\t\t\t \"array objects (inclusive).\", MAX_DIMS);\n\t}\n\t\n /* fprintf(stderr, \"multi new...\");*/\n multi = PyObject_New(PyArrayMultiIterObject, &PyArrayMultiIter_Type);\n if (multi == NULL)\n return NULL;\n\t\n\tfor (i=0; iiters[i] = NULL;\n\tmulti->numiter = n;\n\tmulti->index = 0;\n\n va_start(va, n);\n\tfor (i=0; iiters[i] = (PyArrayIterObject *)PyArray_IterNew(arr);\n\t\t\tPy_DECREF(arr);\n\t\t}\n\t}\n\n\tva_end(va);\t\n\t\n\tif (!err && PyArray_Broadcast(multi) < 0) err=1;\n\n\tif (err) {\n Py_DECREF(multi);\n\t\treturn NULL;\n\t}\n\t\n\tPyArray_MultiIter_RESET(multi);\n\t\n return (PyObject *)multi;\n}\n\nstatic PyObject *\narraymultiter_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)\n{\n\t\n\tint n, i;\n\tPyArrayMultiIterObject *multi;\n\tPyObject *arr;\n\t\n\tif (kwds != NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"keyword arguments not accepted.\");\n\t\treturn NULL;\n\t}\n\n\tn = PyTuple_Size(args);\n\tif (n < 2 || n > MAX_DIMS) {\n\t\tif (PyErr_Occurred()) return NULL;\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"Need at least two and fewer than (%d) \"\t\\\n\t\t\t \"array objects.\", MAX_DIMS);\n\t\treturn NULL;\n\t}\n\t\n\tmulti = _pya_malloc(sizeof(PyArrayMultiIterObject));\n if (multi == NULL) return PyErr_NoMemory();\n\tPyObject_Init((PyObject *)multi, &PyArrayMultiIter_Type);\n\n\tmulti->numiter = n;\n\tmulti->index = 0;\n\tfor (i=0; iiters[i] = NULL;\n\tfor (i=0; iiters[i] =\t\t\t\t\t\\\n\t\t (PyArrayIterObject *)PyArray_IterNew(arr))==NULL) \n\t\t\tgoto fail;\n\t\tPy_DECREF(arr);\n\t}\n\tif (PyArray_Broadcast(multi) < 0) goto fail;\n\tPyArray_MultiIter_RESET(multi);\n\t\n return (PyObject *)multi;\n\t\n fail:\n Py_DECREF(multi);\n\treturn NULL;\n}\n\nstatic PyObject *\narraymultiter_next(PyArrayMultiIterObject *multi)\n{\n\tPyObject *ret;\n\tint i, n;\n\n\tn = multi->numiter;\n\tret = PyTuple_New(n);\n\tif (ret == NULL) return NULL;\n\tif (multi->index < multi->size) {\n\t\tfor (i=0; i < n; i++) {\n\t\t\tPyArrayIterObject *it=multi->iters[i];\n\t\t\tPyTuple_SET_ITEM(ret, i, \n\t\t\t\t\t PyArray_ToScalar(it->dataptr, it->ao));\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t\tmulti->index++;\n\t\treturn ret;\n\t}\n return NULL;\n}\n\nstatic void\narraymultiter_dealloc(PyArrayMultiIterObject *multi)\n{\n\tint i;\n\n\tfor (i=0; inumiter; i++) \n\t\tPy_XDECREF(multi->iters[i]);\n\t_pya_free(multi);\n}\n\nstatic PyObject *\narraymultiter_size_get(PyArrayMultiIterObject *self)\n{\n#if SIZEOF_INTP <= SIZEOF_LONG\n\treturn PyInt_FromLong((long) self->size);\n#else\n\tif (self->size < MAX_LONG)\n\t\treturn PyInt_FromLong((long) self->size);\n\telse\n\t\treturn PyLong_FromLongLong((longlong) self->size);\n#endif\n}\n\nstatic PyObject *\narraymultiter_index_get(PyArrayMultiIterObject *self)\n{\n#if SIZEOF_INTP <= SIZEOF_LONG\n\treturn PyInt_FromLong((long) self->index);\n#else\n\tif (self->size < MAX_LONG)\n\t\treturn PyInt_FromLong((long) self->index);\n\telse\n\t\treturn PyLong_FromLongLong((longlong) self->index);\n#endif\n}\n\nstatic PyObject *\narraymultiter_shape_get(PyArrayMultiIterObject *self)\n{\n\treturn PyArray_IntTupleFromIntp(self->nd, self->dimensions);\t\n}\n\nstatic PyObject *\narraymultiter_iters_get(PyArrayMultiIterObject *self)\n{\n\tPyObject *res;\n\tint i, n;\n\tn = self->numiter;\n\tres = PyTuple_New(n);\n\tif (res == NULL) return res;\n\tfor (i=0; iiters[i]);\n\t\tPyTuple_SET_ITEM(res, i, (PyObject *)self->iters[i]);\n\t}\n\treturn res;\n}\n\nstatic PyGetSetDef arraymultiter_getsetlist[] = {\n {\"size\", \n\t (getter)arraymultiter_size_get,\n\t NULL, \n\t \"total size of broadcasted result\"},\n {\"index\", \n\t (getter)arraymultiter_index_get, \n NULL,\n\t \"current index in broadcasted result\"},\n\t{\"shape\",\n\t (getter)arraymultiter_shape_get,\n\t NULL,\n\t \"shape of broadcasted result\"},\n\t{\"iters\",\n\t (getter)arraymultiter_iters_get,\n\t NULL,\n\t \"tuple of individual iterators\"},\n\t{NULL, NULL, NULL, NULL},\n};\n\nstatic PyMemberDef arraymultiter_members[] = {\n\t{\"numiter\", T_INT, offsetof(PyArrayMultiIterObject, numiter), \n\t RO, NULL},\n\t{\"nd\", T_INT, offsetof(PyArrayMultiIterObject, nd), RO, NULL},\n\t{NULL},\n};\n\nstatic PyObject *\narraymultiter_reset(PyArrayMultiIterObject *self, PyObject *args)\n{\n\tif (!PyArg_ParseTuple(args, \"\")) return NULL;\n\n\tPyArray_MultiIter_RESET(self);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic PyMethodDef arraymultiter_methods[] = {\n\t{\"reset\", (PyCFunction) arraymultiter_reset, METH_VARARGS, NULL},\n\t{NULL, NULL},\n};\n\nstatic PyTypeObject PyArrayMultiIter_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.broadcast\",\t\t \t /* tp_name */\n sizeof(PyArrayMultiIterObject), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraymultiter_dealloc,\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n 0,\t\t\t\t\t/* tp_compare */\n 0,\t\t\t\t\t/* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, /* tp_as_sequence */\n 0, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n 0,\t\t\t\t\t/* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n (iternextfunc)arraymultiter_next,\t/* tp_iternext */\n arraymultiter_methods, \t /* tp_methods */\n arraymultiter_members,\t \t /* tp_members */\n arraymultiter_getsetlist, /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n (initproc)0,\t \t /* tp_init */\n 0, \t /* tp_alloc */\n arraymultiter_new,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrNewFromType(int type_num)\n{\n\tPyArray_Descr *old;\n\tPyArray_Descr *new;\n\n\told = PyArray_DescrFromType(type_num);\n\tnew = PyArray_DescrNew(old);\n\tPy_DECREF(old);\n\treturn new;\t\n}\n\n/*** Array Descr Objects for dynamic types **/\n\n/** There are some statically-defined PyArray_Descr objects corresponding\n to the basic built-in types. \n These can and should be DECREF'd and INCREF'd as appropriate, anyway.\n If a mistake is made in reference counting, deallocation on these \n builtins will be attempted leading to problems. \n\n This let's us deal with all PyArray_Descr objects using reference\n counting (regardless of whether they are statically or dynamically \n allocated). \n**/\n\n/* base cannot be NULL */\n/*OBJECT_API*/\nstatic PyArray_Descr *\nPyArray_DescrNew(PyArray_Descr *base)\n{\n\tPyArray_Descr *new;\n\n\tnew = PyObject_New(PyArray_Descr, &PyArrayDescr_Type);\n\tif (new == NULL) return NULL;\n\t/* Don't copy PyObject_HEAD part */\n\tmemcpy((char *)new+sizeof(PyObject),\n\t (char *)base+sizeof(PyObject),\n\t sizeof(PyArray_Descr)-sizeof(PyObject));\n\n\tif (new->fields == Py_None) new->fields = NULL;\n\tPy_XINCREF(new->fields);\n\tif (new->subarray) {\n\t\tnew->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tmemcpy(new->subarray, base->subarray, \n\t\t sizeof(PyArray_ArrayDescr));\n\t\tPy_INCREF(new->subarray->shape);\n\t\tPy_INCREF(new->subarray->base);\n\t}\n\tPy_INCREF(new->typeobj);\n\treturn new;\n}\n\n/* should never be called for builtin-types unless \n there is a reference-count problem \n*/\nstatic void\narraydescr_dealloc(PyArray_Descr *self)\n{\n\tPy_XDECREF(self->typeobj);\n\tPy_XDECREF(self->fields);\n\tif (self->subarray) {\n\t\tPy_DECREF(self->subarray->shape);\n\t\tPy_DECREF(self->subarray->base);\n\t\t_pya_free(self->subarray);\n\t}\n\tself->ob_type->tp_free(self);\n}\n\n/* we need to be careful about setting attributes because these\n objects are pointed to by arrays that depend on them for interpreting\n data. Currently no attributes of dtypedescr objects can be set. \n*/\nstatic PyMemberDef arraydescr_members[] = {\n\t{\"dtype\", T_OBJECT, offsetof(PyArray_Descr, typeobj), RO, NULL},\n\t{\"kind\", T_CHAR, offsetof(PyArray_Descr, kind), RO, NULL},\n\t{\"char\", T_CHAR, offsetof(PyArray_Descr, type), RO, NULL},\n\t{\"num\", T_INT, offsetof(PyArray_Descr, type_num), RO, NULL},\n\t{\"byteorder\", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL},\n\t{\"itemsize\", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL},\n\t{\"alignment\", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL},\n\t{NULL},\n};\n\nstatic PyObject *\narraydescr_subdescr_get(PyArray_Descr *self)\n{\n\tif (self->subarray == NULL) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn Py_BuildValue(\"OO\", (PyObject *)self->subarray->base, \n\t\t\t self->subarray->shape);\n}\n\nstatic PyObject *\narraydescr_protocol_typestr_get(PyArray_Descr *self)\n{\n\tchar basic_=self->kind;\n\tchar endian = self->byteorder;\n\t\n\tif (endian == '=') {\n\t\tendian = '<';\n\t\tif (!PyArray_IsNativeByteOrder(endian)) endian = '>';\n\t}\n\t\n\treturn PyString_FromFormat(\"%c%c%d\", endian, basic_,\n\t\t\t\t self->elsize);\n}\n\nstatic PyObject *\narraydescr_protocol_descr_get(PyArray_Descr *self)\n{\n\tPyObject *dobj, *res;\n\n\tif (self->fields == NULL || self->fields == Py_None) {\n\t\t/* get default */\n\t\tdobj = PyTuple_New(2);\n\t\tif (dobj == NULL) return NULL;\n\t\tPyTuple_SET_ITEM(dobj, 0, PyString_FromString(\"\"));\n\t\tPyTuple_SET_ITEM(dobj, 1, \\\n\t\t\t\t arraydescr_protocol_typestr_get(self));\n\t\tres = PyList_New(1);\n\t\tif (res == NULL) {Py_DECREF(dobj); return NULL;}\n\t\tPyList_SET_ITEM(res, 0, dobj);\n\t\treturn res;\n\t}\n\n return PyObject_CallMethod(_numpy_internal, \"_array_descr\", \n\t\t\t\t \"O\", self);\n}\n\n/* returns 1 for a builtin type\n and 2 for a user-defined data-type descriptor\n return 0 if neither (i.e. it's a copy of one)\n*/\nstatic PyObject *\narraydescr_isbuiltin_get(PyArray_Descr *self) \n{\n\tlong val;\n\tval = 0;\n\tif (self->fields == Py_None) val = 1;\n\tif (PyTypeNum_ISUSERDEF(self->type_num)) val = 2;\n\treturn PyInt_FromLong(val);\n}\n\nstatic PyObject *\narraydescr_isnative_get(PyArray_Descr *self)\n{\n\tPyObject *ret;\n\n\tret = (PyArray_ISNBO(self->byteorder) ? Py_True : Py_False);\n\tPy_INCREF(ret);\n\treturn ret;\n}\n\nstatic PyObject *\narraydescr_fields_get(PyArray_Descr *self)\n{\n\tif (self->fields == NULL || self->fields == Py_None) {\n\t\tPy_INCREF(Py_None);\n\t\treturn Py_None;\n\t}\n\treturn PyDictProxy_New(self->fields);\n}\n\nstatic PyGetSetDef arraydescr_getsets[] = {\n\t{\"subdescr\", \n\t (getter)arraydescr_subdescr_get,\n\t NULL,\n\t \"A tuple of (descr, shape) or None.\"},\n\t{\"arrdescr\",\n\t (getter)arraydescr_protocol_descr_get,\n\t NULL,\n\t \"The array_protocol type descriptor.\"},\n\t{\"dtypestr\",\n\t (getter)arraydescr_protocol_typestr_get,\n\t NULL,\n\t \"The array_protocol typestring.\"},\n\t{\"isbuiltin\",\n\t (getter)arraydescr_isbuiltin_get,\n\t NULL,\n\t \"Is this a buillt-in data-type descriptor?\"},\n\t{\"isnative\",\n\t (getter)arraydescr_isnative_get,\n\t NULL,\n\t \"Is the byte-order of this descriptor native?\"},\n\t{\"fields\",\n\t (getter)arraydescr_fields_get,\n\t NULL,\n\t NULL},\n\t{NULL, NULL, NULL, NULL},\n};\n\nstatic PyArray_Descr *_convert_from_list(PyObject *obj, int align, int try_descr);\nstatic PyArray_Descr *_convert_from_dict(PyObject *obj, int align);\nstatic PyArray_Descr *_convert_from_commastring(PyObject *obj, int align);\nstatic PyArray_Descr *_convert_from_array_descr(PyObject *obj);\n\nstatic PyObject *\narraydescr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)\n{\n\tPyObject *odescr;\n\tPyArray_Descr *descr, *conv;\n\tint align=0;\n\tBool copy=FALSE;\n\t\n\tif (!PyArg_ParseTuple(args, \"O|iO&\", &odescr, &align,\n\t\t\t PyArray_BoolConverter, ©))\n\t\treturn NULL;\n\t\n\tif (align) {\n\t\tconv = NULL;\n\t\tif PyDict_Check(odescr) \n\t\t\tconv = _convert_from_dict(odescr, 1);\n\t\telse if PyList_Check(odescr) \n\t\t\tconv = _convert_from_list(odescr, 1, 0);\n\t\telse if PyString_Check(odescr)\n\t\t\tconv = _convert_from_commastring(odescr, \n\t\t\t\t\t\t\t\t 1);\n\t\telse {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"align can only be non-zero for\" \\\n\t\t\t\t\t\"dictionary, list, and string objects.\");\n\t\t}\n\t\tif (conv) return (PyObject *)conv;\n\t\tif (!PyErr_Occurred()) {\n\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\"data-type-descriptor not understood\");\n\t\t}\n\t\treturn NULL;\n\t}\n\n\tif PyList_Check(odescr) {\n\t\tconv = _convert_from_array_descr(odescr);\n\t\tif (!conv) {\n\t\t\tPyErr_Clear();\n\t\t\tconv = _convert_from_list(odescr, 0, 0);\n\t\t}\n\t\treturn (PyObject *)conv;\n\t}\n\n\tif (!PyArray_DescrConverter(odescr, &conv)) \n\t\treturn NULL;\n\t/* Get a new copy of it unless it's already a copy */\n\tif (copy && conv->fields == Py_None) {\n\t\tdescr = PyArray_DescrNew(conv);\n\t\tPy_DECREF(conv);\n\t\tconv = descr;\n\t}\n\treturn (PyObject *)conv;\n}\n\nstatic char doc_arraydescr_reduce[] = \"self.__reduce__() for pickling.\";\n\n/* return a tuple of (callable object, args, state) */\nstatic PyObject *\narraydescr_reduce(PyArray_Descr *self, PyObject *args)\n{\n\tPyObject *ret, *mod, *obj;\n\tPyObject *state;\n\tchar endian;\n\tint elsize, alignment;\n\n\tret = PyTuple_New(3);\n\tif (ret == NULL) return NULL;\n\tmod = PyImport_ImportModule(\"numpy.core.multiarray\");\n\tif (mod == NULL) {Py_DECREF(ret); return NULL;}\n\tobj = PyObject_GetAttrString(mod, \"dtypedescr\");\n\tPy_DECREF(mod);\n\tif (obj == NULL) {Py_DECREF(ret); return NULL;}\n\tPyTuple_SET_ITEM(ret, 0, obj);\n\tif (PyTypeNum_ISUSERDEF(self->type_num) ||\t\t\\\n\t ((self->type_num == PyArray_VOID &&\t\t\t\\\n\t self->typeobj != &PyVoidArrType_Type))) {\n\t\tobj = (PyObject *)self->typeobj;\n\t\tPy_INCREF(obj);\n\t}\n\telse {\n\t\tobj = PyString_FromFormat(\"%c%d\",self->kind, self->elsize);\n\t}\n\tPyTuple_SET_ITEM(ret, 1, Py_BuildValue(\"(Nii)\", obj, 0, 1));\n\t\n\t/* Now return the state which is at least \n\t byteorder, subarray, and fields */\n\tendian = self->byteorder;\n\tif (endian == '=') {\n\t\tendian = '<';\n\t\tif (!PyArray_IsNativeByteOrder(endian)) endian = '>';\n\t}\n\tstate = PyTuple_New(5);\n\tPyTuple_SET_ITEM(state, 0, PyString_FromFormat(\"%c\", endian));\n\tPyTuple_SET_ITEM(state, 1, arraydescr_subdescr_get(self));\n\tif (self->fields && self->fields != Py_None) {\n\t\tPy_INCREF(self->fields);\n\t\tPyTuple_SET_ITEM(state, 2, self->fields);\n\t}\n\telse {\n\t\tPyTuple_SET_ITEM(state, 2, Py_None);\n\t\tPy_INCREF(Py_None);\n\t}\n\n\t/* for extended types it also includes elsize and alignment */\n\tif (PyTypeNum_ISEXTENDED(self->type_num)) {\n\t\telsize = self->elsize;\n\t\talignment = self->alignment;\n\t}\n\telse {elsize = -1; alignment = -1;}\n\n\tPyTuple_SET_ITEM(state, 3, PyInt_FromLong(elsize));\n\tPyTuple_SET_ITEM(state, 4, PyInt_FromLong(alignment));\n\n\tPyTuple_SET_ITEM(ret, 2, state);\n\treturn ret;\n}\n\n/* state is at least byteorder, subarray, and fields but could include elsize \n and alignment for EXTENDED arrays \n*/\nstatic char doc_arraydescr_setstate[] = \"self.__setstate__() for pickling.\";\n\nstatic PyObject *\narraydescr_setstate(PyArray_Descr *self, PyObject *args)\n{\n\tint elsize = -1, alignment = -1;\n\tchar endian;\n\tPyObject *subarray, *fields;\n\n\tif (self->fields == Py_None) {Py_INCREF(Py_None); return Py_None;}\n\n\tif (!PyArg_ParseTuple(args, \"(cOOii)\", &endian, &subarray, &fields,\n\t\t\t &elsize, &alignment)) return NULL;\n\t\n\tif (PyArray_IsNativeByteOrder(endian)) endian = '=';\n\n\tself->byteorder = endian;\n\tif (self->subarray) {\n\t\tPy_XDECREF(self->subarray->base);\n\t\tPy_XDECREF(self->subarray->shape);\n\t\t_pya_free(self->subarray);\n\t}\n\tself->subarray = NULL;\n\n\tif (subarray != Py_None) {\n\t\tself->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tself->subarray->base = (PyArray_Descr *)PyTuple_GET_ITEM(subarray, 0);\n\t\tPy_INCREF(self->subarray->base);\n\t\tself->subarray->shape = PyTuple_GET_ITEM(subarray, 1);\n\t\tPy_INCREF(self->subarray->shape);\n\t}\n\t\n\tif (fields != Py_None) {\n\t\tPy_XDECREF(self->fields);\n\t\tself->fields = fields;\n\t\tPy_INCREF(fields);\n\t}\n\t\n\tif (PyTypeNum_ISEXTENDED(self->type_num)) {\n\t\tself->elsize = elsize;\n\t\tself->alignment = alignment;\n\t}\n\t\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n\n/* returns a copy of the PyArray_Descr structure with the byteorder\n altered:\n no arguments: The byteorder is swapped (in all subfields as well)\n single argument: The byteorder is forced to the given state\n (in all subfields as well)\n\n Valid states: ('big', '>') or ('little' or '<')\n\t\t ('native', or '=')\n\n\t\t If a descr structure with | is encountered it's own\n\t\t byte-order is not changed but any fields are: \n*/\n\n/*OBJECT_API\n Deep bytorder change of a data-type descriptor\n*/\nstatic PyArray_Descr *\nPyArray_DescrNewByteorder(PyArray_Descr *self, char newendian)\n{\n\tPyArray_Descr *new;\n\tchar endian;\n\n\tnew = PyArray_DescrNew(self);\n\tendian = new->byteorder;\n\tif (endian != PyArray_IGNORE) {\n\t\tif (newendian == PyArray_SWAP) { /* swap byteorder */\n\t\t\tif PyArray_ISNBO(endian) endian = PyArray_OPPBYTE;\n\t\t\telse endian = PyArray_NATBYTE;\n\t\t\tnew->byteorder = endian;\n\t\t}\n\t\telse if (newendian != PyArray_IGNORE) {\n\t\t\tnew->byteorder = newendian;\n\t\t}\n\t}\n\tif (new->fields) {\n\t\tPyObject *newfields;\n\t\tPyObject *key, *value;\n\t\tPyObject *newvalue;\n\t\tPyObject *old;\n\t\tPyArray_Descr *newdescr;\n\t\tint pos = 0, len, i;\n\t\tnewfields = PyDict_New();\n\t\t/* make new dictionary with replaced */\n\t\t/* PyArray_Descr Objects */\n\t\twhile(PyDict_Next(self->fields, &pos, &key, &value)) {\n\t\t\tif (PyInt_Check(key) &&\t\t\t\\\n\t\t\t PyInt_AsLong(key) == -1) {\n\t\t\t\tPyDict_SetItem(newfields, key, value);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!PyString_Check(key) ||\t \\\n\t\t\t !PyTuple_Check(value) ||\t\t\t\\\n\t\t\t ((len=PyTuple_GET_SIZE(value)) < 2))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\told = PyTuple_GET_ITEM(value, 0);\n\t\t\tif (!PyArray_DescrCheck(old)) continue;\n\t\t\tnewdescr = PyArray_DescrNewByteorder\t\t\\\n\t\t\t\t((PyArray_Descr *)old, newendian);\n\t\t\tif (newdescr == NULL) {\n\t\t\t\tPy_DECREF(newfields); Py_DECREF(new);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tnewvalue = PyTuple_New(len);\n\t\t\tPyTuple_SET_ITEM(newvalue, 0,\t\t\\\n\t\t\t\t\t (PyObject *)newdescr);\n\t\t\tfor(i=1; ifields);\n\t\tnew->fields = newfields;\n\t}\n\tif (new->subarray) {\n\t\tPy_DECREF(new->subarray->base);\n\t\tnew->subarray->base = PyArray_DescrNewByteorder \\\n\t\t\t(self->subarray->base, newendian);\n\t}\n\treturn new;\n}\n\n\nstatic char doc_arraydescr_newbyteorder[] = \"self.newbyteorder()\"\n\t\" returns a copy of the dtypedescr object\\n\"\n\t\" with altered byteorders. If is not given all byteorders\\n\"\n\t\" are swapped. Otherwise endian can be '>', '<', or '=' to force\\n\"\n\t\" a byteorder. Descriptors in all fields are also updated in the\\n\"\n\t\" new dtypedescr object.\";\n\nstatic PyObject *\narraydescr_newbyteorder(PyArray_Descr *self, PyObject *args) \n{\n\tchar endian=PyArray_SWAP;\n\t\n\tif (!PyArg_ParseTuple(args, \"|O&\", PyArray_ByteorderConverter,\n\t\t\t &endian)) return NULL;\n\t\t\t\n\treturn (PyObject *)PyArray_DescrNewByteorder(self, endian);\n}\n\nstatic PyMethodDef arraydescr_methods[] = {\n /* for pickling */\n {\"__reduce__\", (PyCFunction)arraydescr_reduce, METH_VARARGS, \n\t doc_arraydescr_reduce},\n\t{\"__setstate__\", (PyCFunction)arraydescr_setstate, METH_VARARGS,\n\t doc_arraydescr_setstate},\n\n\t{\"newbyteorder\", (PyCFunction)arraydescr_newbyteorder, METH_VARARGS,\n\t doc_arraydescr_newbyteorder},\n {NULL,\t\tNULL}\t\t/* sentinel */\n};\n\nstatic PyObject *\narraydescr_str(PyArray_Descr *self)\n{\n\tPyObject *sub;\n\n\tif (self->fields && self->fields != Py_None) {\n\t\tPyObject *lst;\n\t\tlst = arraydescr_protocol_descr_get(self);\n\t\tif (!lst) sub = PyString_FromString(\"\");\n\t\telse sub = PyObject_Str(lst);\n\t\tPy_XDECREF(lst);\t\t\n\t\tif (self->type_num != PyArray_VOID) {\n\t\t\tPyObject *p;\n\t\t\tPyObject *t=PyString_FromString(\"'\");\n\t\t\tp = arraydescr_protocol_typestr_get(self);\n\t\t\tPyString_Concat(&p, t);\n\t\t\tPyString_ConcatAndDel(&t, p);\n\t\t\tp = PyString_FromString(\"(\");\n\t\t\tPyString_ConcatAndDel(&p, t);\n\t\t\tPyString_ConcatAndDel(&p, PyString_FromString(\", \"));\n\t\t\tPyString_ConcatAndDel(&p, sub);\n\t\t\tPyString_ConcatAndDel(&p, PyString_FromString(\")\"));\n\t\t\tsub = p;\n\t\t}\n\t}\n\telse if (self->subarray) {\n\t\tPyObject *p;\n\t\tPyObject *t = PyString_FromString(\"(\");\n\t\tp = arraydescr_str(self->subarray->base);\n\t\tPyString_ConcatAndDel(&t, p);\n\t\tPyString_ConcatAndDel(&t, PyString_FromString(\",\"));\n\t\tPyString_ConcatAndDel(&t, PyObject_Str(self->subarray->shape));\n\t\tPyString_ConcatAndDel(&t, PyString_FromString(\")\"));\n\t\tsub = t;\n\t}\n\telse {\n\t\tPyObject *t=PyString_FromString(\"'\");\n\t\tsub = arraydescr_protocol_typestr_get(self);\n\t\tPyString_Concat(&sub, t);\n\t\tPyString_ConcatAndDel(&t, sub);\n\t\tsub = t;\n\t}\n\treturn sub;\n}\n\nstatic PyObject *\narraydescr_repr(PyArray_Descr *self)\n{\n\tPyObject *sub, *s;\n\ts = PyString_FromString(\"dtypedescr(\");\n sub = arraydescr_str(self);\n\tPyString_ConcatAndDel(&s, sub);\n\tsub = PyString_FromString(\")\");\n\tPyString_ConcatAndDel(&s, sub);\n\treturn s;\n}\n\nstatic int\narraydescr_compare(PyArray_Descr *self, PyObject *other)\n{\n \tif (!PyArray_DescrCheck(other)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"not a dtypedescr object.\");\n\t\treturn -1;\n\t}\n\tif (PyArray_EquivTypes(self, (PyArray_Descr *)other)) return 0;\n\tif (PyArray_CanCastTo(self, (PyArray_Descr *)other)) return -1;\n\treturn 1;\n}\n\nstatic PyTypeObject PyArrayDescr_Type = {\n PyObject_HEAD_INIT(NULL)\n 0,\t\t\t\t\t /* ob_size */\n \"numpy.dtypedescr\",\t \t /* tp_name */\n sizeof(PyArray_Descr), /* tp_basicsize */\n 0,\t\t\t\t\t /* tp_itemsize */\n /* methods */\n (destructor)arraydescr_dealloc,\t\t/* tp_dealloc */\n 0,\t\t\t\t\t/* tp_print */\n 0,\t\t\t\t\t/* tp_getattr */\n 0,\t\t\t\t\t/* tp_setattr */\n\t(cmpfunc)arraydescr_compare,\t\t/* tp_compare */\n (reprfunc)arraydescr_repr,\t /* tp_repr */\n 0,\t\t\t\t\t/* tp_as_number */\n 0, \t\t\t /* tp_as_sequence */\n 0, \t /* tp_as_mapping */\n 0,\t\t\t\t\t/* tp_hash */\n 0,\t\t\t\t\t/* tp_call */\n (reprfunc)arraydescr_str, /* tp_str */\n 0,\t \t/* tp_getattro */\n 0,\t\t\t\t\t/* tp_setattro */\n 0,\t\t\t\t\t/* tp_as_buffer */\n Py_TPFLAGS_DEFAULT, /* tp_flags */\n 0,\t\t\t\t\t/* tp_doc */\n 0, \t /* tp_traverse */\n 0,\t\t\t\t\t/* tp_clear */\n 0,\t\t\t\t\t/* tp_richcompare */\n 0,\t\t\t\t\t/* tp_weaklistoffset */\n 0, \t /* tp_iter */\n 0,\t \t/* tp_iternext */\n arraydescr_methods,\t \t /* tp_methods */\n arraydescr_members,\t /* tp_members */\n arraydescr_getsets, /* tp_getset */\n 0,\t\t\t\t\t /* tp_base */\n 0,\t\t\t\t\t /* tp_dict */\n 0,\t\t\t\t\t /* tp_descr_get */\n 0,\t\t\t\t\t /* tp_descr_set */\n 0,\t\t\t\t\t /* tp_dictoffset */\n 0, \t \t /* tp_init */\n 0, \t /* tp_alloc */\n arraydescr_new,\t /* tp_new */\n 0,\t /* tp_free */\n 0,\t\t\t\t\t /* tp_is_gc */\n 0,\t\t\t\t\t /* tp_bases */\n 0,\t\t\t\t\t /* tp_mro */\n 0,\t\t\t\t\t /* tp_cache */\n 0,\t\t\t\t\t /* tp_subclasses */\n 0\t\t\t\t\t /* tp_weaklist */\n};\n", + "methods": [ + { + "name": "PyArray_PyIntAsIntp", + "long_name": "PyArray_PyIntAsIntp( PyObject * o)", + "filename": "arrayobject.c", + "nloc": 61, + "complexity": 19, + "token_count": 391, + "parameters": [ + "o" + ], + "start_line": 31, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 0 + }, + { + "name": "PyArray_PyIntAsInt", + "long_name": "PyArray_PyIntAsInt( PyObject * o)", + "filename": "arrayobject.c", + "nloc": 59, + "complexity": 19, + "token_count": 394, + "parameters": [ + "o" + ], + "start_line": 103, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetPriority", + "long_name": "PyArray_GetPriority( PyObject * obj , double default_)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 5, + "token_count": 86, + "parameters": [ + "obj", + "default_" + ], + "start_line": 173, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Zero", + "long_name": "PyArray_Zero( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 148, + "parameters": [ + "arr" + ], + "start_line": 212, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_One", + "long_name": "PyArray_One( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 148, + "parameters": [ + "arr" + ], + "start_line": 246, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "do_sliced_copy", + "long_name": "do_sliced_copy( char * dest , intp * dest_strides , intp * dest_dimensions , int dest_nd , char * src , intp * src_strides , intp * src_dimensions , int src_nd , int elsize , int copies)", + "filename": "arrayobject.c", + "nloc": 48, + "complexity": 13, + "token_count": 313, + "parameters": [ + "dest", + "dest_strides", + "dest_dimensions", + "dest_nd", + "src", + "src_strides", + "src_dimensions", + "src_nd", + "elsize", + "copies" + ], + "start_line": 281, + "end_line": 331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "optimize_slices", + "long_name": "optimize_slices( intp ** dest_strides , intp ** dest_dimensions , int * dest_nd , intp ** src_strides , intp ** src_dimensions , int * src_nd , int * elsize , int * copies)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 8, + "token_count": 214, + "parameters": [ + "dest_strides", + "dest_dimensions", + "dest_nd", + "src_strides", + "src_dimensions", + "src_nd", + "elsize", + "copies" + ], + "start_line": 354, + "end_line": 385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "contiguous_data", + "long_name": "contiguous_data( PyArrayObject * src)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 4, + "token_count": 215, + "parameters": [ + "src" + ], + "start_line": 388, + "end_line": 422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + }, + { + "name": "PyArray_INCREF", + "long_name": "PyArray_INCREF( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 6, + "token_count": 125, + "parameters": [ + "mp" + ], + "start_line": 438, + "end_line": 460, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "PyArray_XDECREF", + "long_name": "PyArray_XDECREF( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 6, + "token_count": 125, + "parameters": [ + "mp" + ], + "start_line": 466, + "end_line": 487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "byte_swap_vector", + "long_name": "byte_swap_vector( * p , int n , int size)", + "filename": "arrayobject.c", + "nloc": 38, + "complexity": 10, + "token_count": 340, + "parameters": [ + "p", + "n", + "size" + ], + "start_line": 491, + "end_line": 529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "copy_and_swap", + "long_name": "copy_and_swap( * dst , * src , int itemsize , intp numitems , intp srcstrides , int swap)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 5, + "token_count": 120, + "parameters": [ + "dst", + "src", + "itemsize", + "numitems", + "srcstrides", + "swap" + ], + "start_line": 534, + "end_line": 554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "index2ptr", + "long_name": "index2ptr( PyArrayObject * mp , intp i)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 7, + "token_count": 98, + "parameters": [ + "mp", + "i" + ], + "start_line": 562, + "end_line": 577, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Size", + "long_name": "PyArray_Size( PyObject * op)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 33, + "parameters": [ + "op" + ], + "start_line": 583, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyInto", + "long_name": "PyArray_CopyInto( PyArrayObject * dest , PyArrayObject * src)", + "filename": "arrayobject.c", + "nloc": 71, + "complexity": 16, + "token_count": 435, + "parameters": [ + "dest", + "src" + ], + "start_line": 607, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 81, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyObject", + "long_name": "PyArray_CopyObject( PyArrayObject * dest , PyObject * src_object)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 2, + "token_count": 79, + "parameters": [ + "dest", + "src_object" + ], + "start_line": 691, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromDimsAndDataAndDescr", + "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 7, + "token_count": 137, + "parameters": [ + "nd", + "d", + "descr", + "data" + ], + "start_line": 718, + "end_line": 744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromDims", + "long_name": "PyArray_FromDims( int nd , int * d , int type)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 3, + "token_count": 69, + "parameters": [ + "nd", + "d", + "type" + ], + "start_line": 750, + "end_line": 764, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "PyArray_NewCopy", + "long_name": "PyArray_NewCopy( PyArrayObject * m1 , int fortran)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 4, + "token_count": 110, + "parameters": [ + "m1", + "fortran" + ], + "start_line": 772, + "end_line": 792, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Scalar", + "long_name": "PyArray_Scalar( * data , PyArray_Descr * descr , PyObject * base)", + "filename": "arrayobject.c", + "nloc": 75, + "complexity": 10, + "token_count": 436, + "parameters": [ + "data", + "descr", + "base" + ], + "start_line": 801, + "end_line": 879, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToScalar", + "long_name": "PyArray_ToScalar( * data , PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "data", + "arr" + ], + "start_line": 895, + "end_line": 898, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Return", + "long_name": "PyArray_Return( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 4, + "token_count": 76, + "parameters": [ + "mp" + ], + "start_line": 908, + "end_line": 928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_RegisterDataType", + "long_name": "PyArray_RegisterDataType( PyTypeObject * type)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 9, + "token_count": 229, + "parameters": [ + "type" + ], + "start_line": 942, + "end_line": 982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "PyArray_RegisterDescrForType", + "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 6, + "token_count": 214, + "parameters": [ + "typenum", + "descr" + ], + "start_line": 997, + "end_line": 1038, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToFile", + "long_name": "PyArray_ToFile( PyArrayObject * self , FILE * fp , char * sep , char * format)", + "filename": "arrayobject.c", + "nloc": 89, + "complexity": 18, + "token_count": 595, + "parameters": [ + "self", + "fp", + "sep", + "format" + ], + "start_line": 1045, + "end_line": 1136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 92, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToList", + "long_name": "PyArray_ToList( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 25, + "complexity": 5, + "token_count": 158, + "parameters": [ + "self" + ], + "start_line": 1142, + "end_line": 1171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToString", + "long_name": "PyArray_ToString( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 5, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 1174, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "array_dealloc", + "long_name": "array_dealloc( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self" + ], + "start_line": 1219, + "end_line": 1256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "array_length", + "long_name": "array_length( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 1263, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_big_item", + "long_name": "array_big_item( PyArrayObject * self , intp i)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 4, + "token_count": 151, + "parameters": [ + "self", + "i" + ], + "start_line": 1274, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_item_nice", + "long_name": "array_item_nice( PyArrayObject * self , int i)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "i" + ], + "start_line": 1302, + "end_line": 1305, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_ass_big_item", + "long_name": "array_ass_big_item( PyArrayObject * self , intp i , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 9, + "token_count": 200, + "parameters": [ + "self", + "i", + "v" + ], + "start_line": 1309, + "end_line": 1344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "array_ass_item", + "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self", + "i", + "v" + ], + "start_line": 1350, + "end_line": 1353, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "slice_coerce_index", + "long_name": "slice_coerce_index( PyObject * o , intp * v)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 40, + "parameters": [ + "o", + "v" + ], + "start_line": 1359, + "end_line": 1367, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "slice_GetIndices", + "long_name": "slice_GetIndices( PySliceObject * r , intp length , intp * start , intp * stop , intp * step , intp * slicelength)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 24, + "token_count": 376, + "parameters": [ + "r", + "length", + "start", + "stop", + "step", + "slicelength" + ], + "start_line": 1373, + "end_line": 1423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "parse_subindex", + "long_name": "parse_subindex( PyObject * op , intp * step_size , intp * n_steps , intp max)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 11, + "token_count": 223, + "parameters": [ + "op", + "step_size", + "n_steps", + "max" + ], + "start_line": 1430, + "end_line": 1475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "parse_index", + "long_name": "parse_index( PyArrayObject * self , PyObject * op , intp * dimensions , intp * strides , intp * offset_ptr)", + "filename": "arrayobject.c", + "nloc": 88, + "complexity": 20, + "token_count": 539, + "parameters": [ + "self", + "op", + "dimensions", + "strides", + "offset_ptr" + ], + "start_line": 1479, + "end_line": 1573, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 95, + "top_nesting_level": 0 + }, + { + "name": "_swap_axes", + "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 4, + "token_count": 176, + "parameters": [ + "mit", + "ret" + ], + "start_line": 1576, + "end_line": 1613, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetMap", + "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 40, + "complexity": 8, + "token_count": 258, + "parameters": [ + "mit" + ], + "start_line": 1625, + "end_line": 1678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetMap", + "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 53, + "complexity": 12, + "token_count": 380, + "parameters": [ + "mit", + "op" + ], + "start_line": 1681, + "end_line": 1741, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "array_subscript", + "long_name": "array_subscript( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 90, + "complexity": 23, + "token_count": 576, + "parameters": [ + "self", + "op" + ], + "start_line": 1764, + "end_line": 1868, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "array_ass_sub", + "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 87, + "complexity": 23, + "token_count": 528, + "parameters": [ + "self", + "index", + "op" + ], + "start_line": 1883, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 99, + "top_nesting_level": 0 + }, + { + "name": "array_subscript_nice", + "long_name": "array_subscript_nice( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "op" + ], + "start_line": 1989, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_getsegcount", + "long_name": "array_getsegcount( PyArrayObject * self , int * lenp)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 4, + "token_count": 48, + "parameters": [ + "self", + "lenp" + ], + "start_line": 2011, + "end_line": 2023, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_getreadbuf", + "long_name": "array_getreadbuf( PyArrayObject * self , int segment , ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2026, + "end_line": 2041, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_getwritebuf", + "long_name": "array_getwritebuf( PyArrayObject * self , int segment , ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 54, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2045, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "array_getcharbuf", + "long_name": "array_getcharbuf( PyArrayObject * self , int segment , const char ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 3, + "token_count": 65, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2057, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetNumericOps", + "long_name": "PyArray_SetNumericOps( PyObject * dict)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 1, + "token_count": 162, + "parameters": [ + "dict" + ], + "start_line": 2139, + "end_line": 2172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetNumericOps", + "long_name": "PyArray_GetNumericOps()", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 2, + "token_count": 183, + "parameters": [], + "start_line": 2182, + "end_line": 2221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericReduceFunction", + "long_name": "PyArray_GenericReduceFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 5, + "token_count": 141, + "parameters": [ + "m1", + "op", + "axis", + "rtype" + ], + "start_line": 2224, + "end_line": 2247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericAccumulateFunction", + "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 5, + "token_count": 141, + "parameters": [ + "m1", + "op", + "axis", + "rtype" + ], + "start_line": 2251, + "end_line": 2274, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericBinaryFunction", + "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 44, + "parameters": [ + "m1", + "m2", + "op" + ], + "start_line": 2278, + "end_line": 2285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericUnaryFunction", + "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 38, + "parameters": [ + "m1", + "op" + ], + "start_line": 2288, + "end_line": 2295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericInplaceBinaryFunction", + "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 46, + "parameters": [ + "m1", + "m2", + "op" + ], + "start_line": 2298, + "end_line": 2306, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_add", + "long_name": "array_add( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2309, + "end_line": 2312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_subtract", + "long_name": "array_subtract( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2315, + "end_line": 2318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_multiply", + "long_name": "array_multiply( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2321, + "end_line": 2324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_divide", + "long_name": "array_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2327, + "end_line": 2330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_remainder", + "long_name": "array_remainder( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2333, + "end_line": 2336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_power", + "long_name": "array_power( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2339, + "end_line": 2342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_negative", + "long_name": "array_negative( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2345, + "end_line": 2348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_absolute", + "long_name": "array_absolute( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2351, + "end_line": 2354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_invert", + "long_name": "array_invert( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2357, + "end_line": 2360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_left_shift", + "long_name": "array_left_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2363, + "end_line": 2366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_right_shift", + "long_name": "array_right_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2369, + "end_line": 2372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_and", + "long_name": "array_bitwise_and( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2375, + "end_line": 2378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_or", + "long_name": "array_bitwise_or( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2381, + "end_line": 2384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_xor", + "long_name": "array_bitwise_xor( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2387, + "end_line": 2390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_add", + "long_name": "array_inplace_add( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2393, + "end_line": 2396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_subtract", + "long_name": "array_inplace_subtract( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2399, + "end_line": 2402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_multiply", + "long_name": "array_inplace_multiply( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2405, + "end_line": 2408, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_divide", + "long_name": "array_inplace_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2411, + "end_line": 2414, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_remainder", + "long_name": "array_inplace_remainder( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2417, + "end_line": 2420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_power", + "long_name": "array_inplace_power( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2423, + "end_line": 2426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_left_shift", + "long_name": "array_inplace_left_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2429, + "end_line": 2432, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_right_shift", + "long_name": "array_inplace_right_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2435, + "end_line": 2438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_and", + "long_name": "array_inplace_bitwise_and( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2441, + "end_line": 2444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_or", + "long_name": "array_inplace_bitwise_or( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2447, + "end_line": 2450, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_xor", + "long_name": "array_inplace_bitwise_xor( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2453, + "end_line": 2456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_floor_divide", + "long_name": "array_floor_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2459, + "end_line": 2462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_true_divide", + "long_name": "array_true_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2465, + "end_line": 2468, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_floor_divide", + "long_name": "array_inplace_floor_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2471, + "end_line": 2475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_true_divide", + "long_name": "array_inplace_true_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2478, + "end_line": 2482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_any_nonzero", + "long_name": "array_any_nonzero( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 4, + "token_count": 95, + "parameters": [ + "mp" + ], + "start_line": 2486, + "end_line": 2504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "_array_nonzero", + "long_name": "_array_nonzero( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 3, + "token_count": 72, + "parameters": [ + "mp" + ], + "start_line": 2507, + "end_line": 2524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_divmod", + "long_name": "array_divmod( PyArrayObject * op1 , PyObject * op2)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 89, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2529, + "end_line": 2544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_int", + "long_name": "array_int( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 5, + "token_count": 145, + "parameters": [ + "v" + ], + "start_line": 2548, + "end_line": 2574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "array_float", + "long_name": "array_float( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 5, + "token_count": 145, + "parameters": [ + "v" + ], + "start_line": 2577, + "end_line": 2602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_long", + "long_name": "array_long( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2605, + "end_line": 2627, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "array_oct", + "long_name": "array_oct( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2630, + "end_line": 2652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "array_hex", + "long_name": "array_hex( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2655, + "end_line": 2677, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "_array_copy_nice", + "long_name": "_array_copy_nice( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 2680, + "end_line": 2684, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_slice", + "long_name": "array_slice( PyArrayObject * self , int ilow , int ihigh)", + "filename": "arrayobject.c", + "nloc": 36, + "complexity": 11, + "token_count": 259, + "parameters": [ + "self", + "ilow", + "ihigh" + ], + "start_line": 2745, + "end_line": 2785, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "array_ass_slice", + "long_name": "array_ass_slice( PyArrayObject * self , int ilow , int ihigh , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 4, + "token_count": 108, + "parameters": [ + "self", + "ilow", + "ihigh", + "v" + ], + "start_line": 2789, + "end_line": 2810, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "array_contains", + "long_name": "array_contains( PyArrayObject * self , PyObject * el)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "el" + ], + "start_line": 2813, + "end_line": 2825, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dump_data", + "long_name": "dump_data( char ** string , int * n , int * max_n , char * data , int nd , intp * dimensions , intp * strides , PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 7, + "token_count": 310, + "parameters": [ + "string", + "n", + "max_n", + "data", + "nd", + "dimensions", + "strides", + "self" + ], + "start_line": 2846, + "end_line": 2893, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "array_repr_builtin", + "long_name": "array_repr_builtin( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 30, + "complexity": 4, + "token_count": 224, + "parameters": [ + "self" + ], + "start_line": 2896, + "end_line": 2932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetStringFunction", + "long_name": "PyArray_SetStringFunction( PyObject * op , int repr)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 48, + "parameters": [ + "op", + "repr" + ], + "start_line": 2941, + "end_line": 2958, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_repr", + "long_name": "array_repr( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self" + ], + "start_line": 2961, + "end_line": 2973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_str", + "long_name": "array_str( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self" + ], + "start_line": 2976, + "end_line": 2988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_richcompare", + "long_name": "array_richcompare( PyArrayObject * self , PyObject * other , int cmp_op)", + "filename": "arrayobject.c", + "nloc": 61, + "complexity": 13, + "token_count": 273, + "parameters": [ + "self", + "other", + "cmp_op" + ], + "start_line": 2991, + "end_line": 3068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 78, + "top_nesting_level": 0 + }, + { + "name": "_check_axis", + "long_name": "_check_axis( PyArrayObject * arr , int * axis , int flags)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 8, + "token_count": 164, + "parameters": [ + "arr", + "axis", + "flags" + ], + "start_line": 3071, + "end_line": 3100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntTupleFromIntp", + "long_name": "PyArray_IntTupleFromIntp( int len , intp * vals)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 5, + "token_count": 109, + "parameters": [ + "len", + "vals" + ], + "start_line": 3106, + "end_line": 3126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntpFromSequence", + "long_name": "PyArray_IntpFromSequence( PyObject * seq , intp * vals , int maxvals)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 7, + "token_count": 161, + "parameters": [ + "seq", + "vals", + "maxvals" + ], + "start_line": 3134, + "end_line": 3157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "_IsContiguous", + "long_name": "_IsContiguous( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 6, + "token_count": 111, + "parameters": [ + "ap" + ], + "start_line": 3163, + "end_line": 3179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_IsFortranContiguous", + "long_name": "_IsFortranContiguous( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 6, + "token_count": 109, + "parameters": [ + "ap" + ], + "start_line": 3183, + "end_line": 3199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_IsAligned", + "long_name": "_IsAligned( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 5, + "token_count": 119, + "parameters": [ + "ap" + ], + "start_line": 3202, + "end_line": 3219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "_IsWriteable", + "long_name": "_IsWriteable( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 7, + "token_count": 107, + "parameters": [ + "ap" + ], + "start_line": 3222, + "end_line": 3255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "PyArray_UpdateFlags", + "long_name": "PyArray_UpdateFlags( PyArrayObject * ret , int flagmask)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 11, + "token_count": 157, + "parameters": [ + "ret", + "flagmask" + ], + "start_line": 3262, + "end_line": 3289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CheckStrides", + "long_name": "PyArray_CheckStrides( int elsize , int nd , intp numbytes , intp * dims , intp * newstrides)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 4, + "token_count": 84, + "parameters": [ + "elsize", + "nd", + "numbytes", + "dims", + "newstrides" + ], + "start_line": 3298, + "end_line": 3313, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "_array_fill_strides", + "long_name": "_array_fill_strides( intp * strides , intp * dims , int nd , intp itemsize , int inflag , int * objflags)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 9, + "token_count": 171, + "parameters": [ + "strides", + "dims", + "nd", + "itemsize", + "inflag", + "objflags" + ], + "start_line": 3333, + "end_line": 3357, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "PyArray_New", + "long_name": "PyArray_New( PyTypeObject * subtype , int nd , intp * dims , int type_num , intp * strides , * data , int itemsize , int flags , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 22, + "complexity": 4, + "token_count": 128, + "parameters": [ + "subtype", + "nd", + "dims", + "type_num", + "strides", + "data", + "itemsize", + "flags", + "obj" + ], + "start_line": 3363, + "end_line": 3385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "_update_descr_and_dimensions", + "long_name": "_update_descr_and_dimensions( PyArray_Descr ** des , intp * newdims , intp * newstrides , int oldnd)", + "filename": "arrayobject.c", + "nloc": 37, + "complexity": 6, + "token_count": 229, + "parameters": [ + "des", + "newdims", + "newstrides", + "oldnd" + ], + "start_line": 3389, + "end_line": 3431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "PyArray_NewFromDescr", + "long_name": "PyArray_NewFromDescr( PyTypeObject * subtype , PyArray_Descr * descr , int nd , intp * dims , intp * strides , * data , int flags , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 127, + "complexity": 25, + "token_count": 744, + "parameters": [ + "subtype", + "descr", + "nd", + "dims", + "strides", + "data", + "flags", + "obj" + ], + "start_line": 3439, + "end_line": 3599, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 161, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Resize", + "long_name": "PyArray_Resize( PyArrayObject * self , PyArray_Dims * newshape)", + "filename": "arrayobject.c", + "nloc": 87, + "complexity": 15, + "token_count": 500, + "parameters": [ + "self", + "newshape" + ], + "start_line": 3608, + "end_line": 3713, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 106, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FillObjectArray", + "long_name": "PyArray_FillObjectArray( PyArrayObject * arr , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 4, + "token_count": 98, + "parameters": [ + "arr", + "obj" + ], + "start_line": 3719, + "end_line": 3736, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FillWithScalar", + "long_name": "PyArray_FillWithScalar( PyArrayObject * arr , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 6, + "token_count": 229, + "parameters": [ + "arr", + "obj" + ], + "start_line": 3740, + "end_line": 3782, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "array_new", + "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 101, + "complexity": 18, + "token_count": 570, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 3785, + "end_line": 3899, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 115, + "top_nesting_level": 0 + }, + { + "name": "array_iter", + "long_name": "array_iter( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 38, + "parameters": [ + "arr" + ], + "start_line": 3903, + "end_line": 3911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_ndim_get", + "long_name": "array_ndim_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 3917, + "end_line": 3920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_flags_get", + "long_name": "array_flags_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 3923, + "end_line": 3927, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_shape_get", + "long_name": "array_shape_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 3930, + "end_line": 3933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_shape_set", + "long_name": "array_shape_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 183, + "parameters": [ + "self", + "val" + ], + "start_line": 3937, + "end_line": 3966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "array_strides_get", + "long_name": "array_strides_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 3970, + "end_line": 3973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_strides_set", + "long_name": "array_strides_set( PyArrayObject * self , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 36, + "complexity": 7, + "token_count": 231, + "parameters": [ + "self", + "obj" + ], + "start_line": 3976, + "end_line": 4014, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "array_protocol_strides_get", + "long_name": "array_protocol_strides_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 4018, + "end_line": 4025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "array_priority_get", + "long_name": "array_priority_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 4028, + "end_line": 4036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_dataptr_get", + "long_name": "array_dataptr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 4040, + "end_line": 4046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_data_get", + "long_name": "array_data_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 82, + "parameters": [ + "self" + ], + "start_line": 4049, + "end_line": 4063, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "array_data_set", + "long_name": "array_data_set( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 44, + "complexity": 9, + "token_count": 229, + "parameters": [ + "self", + "op" + ], + "start_line": 4066, + "end_line": 4110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "array_itemsize_get", + "long_name": "array_itemsize_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 4114, + "end_line": 4117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_size_get", + "long_name": "array_size_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 4, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 4120, + "end_line": 4131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_nbytes_get", + "long_name": "array_nbytes_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 4, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 4134, + "end_line": 4145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_typechar_get", + "long_name": "array_typechar_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 4149, + "end_line": 4156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "array_typestr_get", + "long_name": "array_typestr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 4161, + "end_line": 4164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_descr_get", + "long_name": "array_descr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 4167, + "end_line": 4171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_descr_set", + "long_name": "array_descr_set( PyArrayObject * self , PyObject * arg)", + "filename": "arrayobject.c", + "nloc": 63, + "complexity": 15, + "token_count": 443, + "parameters": [ + "self", + "arg" + ], + "start_line": 4185, + "end_line": 4270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "array_protocol_descr_get", + "long_name": "array_protocol_descr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 4, + "token_count": 117, + "parameters": [ + "self" + ], + "start_line": 4273, + "end_line": 4291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "array_struct_get", + "long_name": "array_struct_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 2, + "token_count": 130, + "parameters": [ + "self" + ], + "start_line": 4294, + "end_line": 4312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "array_type_get", + "long_name": "array_type_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 4315, + "end_line": 4319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_base_get", + "long_name": "array_base_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 4324, + "end_line": 4334, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "array_real_get", + "long_name": "array_real_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 25, + "complexity": 3, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 4338, + "end_line": 4363, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_real_set", + "long_name": "array_real_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 4, + "token_count": 189, + "parameters": [ + "self", + "val" + ], + "start_line": 4367, + "end_line": 4400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "array_imag_get", + "long_name": "array_imag_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 33, + "complexity": 3, + "token_count": 178, + "parameters": [ + "self" + ], + "start_line": 4403, + "end_line": 4436, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "array_imag_set", + "long_name": "array_imag_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 37, + "complexity": 4, + "token_count": 205, + "parameters": [ + "self", + "val" + ], + "start_line": 4439, + "end_line": 4476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "array_flat_get", + "long_name": "array_flat_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 4479, + "end_line": 4482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_flat_set", + "long_name": "array_flat_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 48, + "complexity": 9, + "token_count": 346, + "parameters": [ + "self", + "val" + ], + "start_line": 4485, + "end_line": 4535, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "array_alloc", + "long_name": "array_alloc( PyTypeObject * type , int nitems)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 1, + "token_count": 39, + "parameters": [ + "type", + "nitems" + ], + "start_line": 4637, + "end_line": 4644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "discover_depth", + "long_name": "discover_depth( PyObject * s , int max , int stop_at_string , int stop_at_tuple)", + "filename": "arrayobject.c", + "nloc": 31, + "complexity": 19, + "token_count": 243, + "parameters": [ + "s", + "max", + "stop_at_string", + "stop_at_tuple" + ], + "start_line": 4746, + "end_line": 4779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "discover_itemsize", + "long_name": "discover_itemsize( PyObject * s , int nd , int * itemsize)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 9, + "token_count": 161, + "parameters": [ + "s", + "nd", + "itemsize" + ], + "start_line": 4782, + "end_line": 4804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "discover_dimensions", + "long_name": "discover_dimensions( PyObject * s , int nd , intp * d , int check_it)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 10, + "token_count": 188, + "parameters": [ + "s", + "nd", + "d", + "check_it" + ], + "start_line": 4811, + "end_line": 4837, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "_array_small_type", + "long_name": "_array_small_type( PyArray_Descr * chktype , PyArray_Descr * mintype)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 8, + "token_count": 169, + "parameters": [ + "chktype", + "mintype" + ], + "start_line": 4843, + "end_line": 4875, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "_array_find_type", + "long_name": "_array_find_type( PyObject * op , PyArray_Descr * minitype , int max)", + "filename": "arrayobject.c", + "nloc": 120, + "complexity": 31, + "token_count": 691, + "parameters": [ + "op", + "minitype", + "max" + ], + "start_line": 4887, + "end_line": 5023, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 137, + "top_nesting_level": 0 + }, + { + "name": "Assign_Array", + "long_name": "Assign_Array( PyArrayObject * self , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 6, + "token_count": 121, + "parameters": [ + "self", + "v" + ], + "start_line": 5026, + "end_line": 5049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "Array_FromScalar", + "long_name": "Array_FromScalar( PyObject * op , PyArray_Descr * typecode)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 6, + "token_count": 146, + "parameters": [ + "op", + "typecode" + ], + "start_line": 5054, + "end_line": 5082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "Array_FromSequence", + "long_name": "Array_FromSequence( PyObject * s , PyArray_Descr * typecode , int fortran , int min_depth , int max_depth)", + "filename": "arrayobject.c", + "nloc": 57, + "complexity": 21, + "token_count": 367, + "parameters": [ + "s", + "typecode", + "fortran", + "min_depth", + "max_depth" + ], + "start_line": 5087, + "end_line": 5151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ValidType", + "long_name": "PyArray_ValidType( int type)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 41, + "parameters": [ + "type" + ], + "start_line": 5158, + "end_line": 5167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_bufferedcast", + "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)", + "filename": "arrayobject.c", + "nloc": 79, + "complexity": 18, + "token_count": 525, + "parameters": [ + "out", + "in" + ], + "start_line": 5173, + "end_line": 5266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CastToType", + "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Descr * at , int fortran)", + "filename": "arrayobject.c", + "nloc": 40, + "complexity": 16, + "token_count": 280, + "parameters": [ + "mp", + "at", + "fortran" + ], + "start_line": 5276, + "end_line": 5322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CastTo", + "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 11, + "token_count": 241, + "parameters": [ + "out", + "mp" + ], + "start_line": 5332, + "end_line": 5385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "array_fromarray", + "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Descr * newtype , int flags)", + "filename": "arrayobject.c", + "nloc": 114, + "complexity": 32, + "token_count": 673, + "parameters": [ + "arr", + "newtype", + "flags" + ], + "start_line": 5389, + "end_line": 5518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 130, + "top_nesting_level": 0 + }, + { + "name": "_array_typedescr_fromstr", + "long_name": "_array_typedescr_fromstr( char * str)", + "filename": "arrayobject.c", + "nloc": 98, + "complexity": 36, + "token_count": 505, + "parameters": [ + "str" + ], + "start_line": 5522, + "end_line": 5630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 109, + "top_nesting_level": 0 + }, + { + "name": "array_fromstructinterface", + "long_name": "array_fromstructinterface( PyObject * input , PyArray_Descr * intype , int flags)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 6, + "token_count": 274, + "parameters": [ + "input", + "intype", + "flags" + ], + "start_line": 5634, + "end_line": 5678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "array_frominterface", + "long_name": "array_frominterface( PyObject * input , PyArray_Descr * intype , int flags)", + "filename": "arrayobject.c", + "nloc": 134, + "complexity": 28, + "token_count": 839, + "parameters": [ + "input", + "intype", + "flags" + ], + "start_line": 5682, + "end_line": 5825, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 144, + "top_nesting_level": 0 + }, + { + "name": "array_fromattr", + "long_name": "array_fromattr( PyObject * op , PyArray_Descr * typecode , int flags)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 5, + "token_count": 178, + "parameters": [ + "op", + "typecode", + "flags" + ], + "start_line": 5829, + "end_line": 5859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "array_fromobject", + "long_name": "array_fromobject( PyObject * op , PyArray_Descr * newtype , int min_depth , int max_depth , int flags)", + "filename": "arrayobject.c", + "nloc": 56, + "complexity": 17, + "token_count": 330, + "parameters": [ + "op", + "newtype", + "min_depth", + "max_depth", + "flags" + ], + "start_line": 5863, + "end_line": 5939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrFromObject", + "long_name": "PyArray_DescrFromObject( PyObject * op , PyArray_Descr * mintype)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 22, + "parameters": [ + "op", + "mintype" + ], + "start_line": 5944, + "end_line": 5947, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ObjectType", + "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 2, + "token_count": 69, + "parameters": [ + "op", + "minimum_type" + ], + "start_line": 5954, + "end_line": 5967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromAny", + "long_name": "PyArray_FromAny( PyObject * op , PyArray_Descr * descr , int min_depth , int max_depth , int requires)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 8, + "token_count": 117, + "parameters": [ + "op", + "descr", + "min_depth", + "max_depth", + "requires" + ], + "start_line": 6013, + "end_line": 6032, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "PyArray_EnsureArray", + "long_name": "PyArray_EnsureArray( PyObject * op)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 5, + "token_count": 81, + "parameters": [ + "op" + ], + "start_line": 6045, + "end_line": 6061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CanCastSafely", + "long_name": "PyArray_CanCastSafely( int fromtype , int totype)", + "filename": "arrayobject.c", + "nloc": 86, + "complexity": 39, + "token_count": 444, + "parameters": [ + "fromtype", + "totype" + ], + "start_line": 6069, + "end_line": 6157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 89, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CanCastTo", + "long_name": "PyArray_CanCastTo( PyArray_Descr * from , PyArray_Descr * to)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 7, + "token_count": 134, + "parameters": [ + "from", + "to" + ], + "start_line": 6162, + "end_line": 6190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IterNew", + "long_name": "PyArray_IterNew( PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 6, + "token_count": 269, + "parameters": [ + "obj" + ], + "start_line": 6203, + "end_line": 6241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IterAllButAxis", + "long_name": "PyArray_IterAllButAxis( PyObject * obj , int axis)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 3, + "token_count": 88, + "parameters": [ + "obj", + "axis" + ], + "start_line": 6249, + "end_line": 6266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "arrayiter_next", + "long_name": "arrayiter_next( PyArrayIterObject * it)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "it" + ], + "start_line": 6271, + "end_line": 6281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arrayiter_dealloc", + "long_name": "arrayiter_dealloc( PyArrayIterObject * it)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 20, + "parameters": [ + "it" + ], + "start_line": 6284, + "end_line": 6288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "iter_length", + "long_name": "iter_length( PyArrayIterObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 6291, + "end_line": 6294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript_Bool", + "long_name": "iter_subscript_Bool( PyArrayIterObject * self , PyArrayObject * ind)", + "filename": "arrayobject.c", + "nloc": 44, + "complexity": 7, + "token_count": 281, + "parameters": [ + "self", + "ind" + ], + "start_line": 6298, + "end_line": 6348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript_int", + "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)", + "filename": "arrayobject.c", + "nloc": 52, + "complexity": 8, + "token_count": 352, + "parameters": [ + "self", + "ind" + ], + "start_line": 6351, + "end_line": 6405, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript", + "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)", + "filename": "arrayobject.c", + "nloc": 113, + "complexity": 23, + "token_count": 664, + "parameters": [ + "self", + "ind" + ], + "start_line": 6409, + "end_line": 6542, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 134, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_sub_Bool", + "long_name": "iter_ass_sub_Bool( PyArrayIterObject * self , PyArrayObject * ind , PyArrayIterObject * val , int swap)", + "filename": "arrayobject.c", + "nloc": 31, + "complexity": 5, + "token_count": 180, + "parameters": [ + "self", + "ind", + "val", + "swap" + ], + "start_line": 6546, + "end_line": 6578, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_sub_int", + "long_name": "iter_ass_sub_int( PyArrayIterObject * self , PyArrayObject * ind , PyArrayIterObject * val , int swap)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 8, + "token_count": 282, + "parameters": [ + "self", + "ind", + "val", + "swap" + ], + "start_line": 6581, + "end_line": 6623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_subscript", + "long_name": "iter_ass_subscript( PyArrayIterObject * self , PyObject * ind , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 115, + "complexity": 27, + "token_count": 692, + "parameters": [ + "self", + "ind", + "val" + ], + "start_line": 6626, + "end_line": 6760, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 135, + "top_nesting_level": 0 + }, + { + "name": "iter_array", + "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 33, + "complexity": 5, + "token_count": 214, + "parameters": [ + "it", + "op" + ], + "start_line": 6773, + "end_line": 6818, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "iter_copy", + "long_name": "iter_copy( PyArrayIterObject * it , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "it", + "args" + ], + "start_line": 6823, + "end_line": 6827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fancy_indexing_check", + "long_name": "fancy_indexing_check( PyObject * args)", + "filename": "arrayobject.c", + "nloc": 56, + "complexity": 22, + "token_count": 295, + "parameters": [ + "args" + ], + "start_line": 6899, + "end_line": 6961, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "_convert_obj", + "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 5, + "token_count": 104, + "parameters": [ + "obj", + "iter" + ], + "start_line": 6969, + "end_line": 6985, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Broadcast", + "long_name": "PyArray_Broadcast( PyArrayMultiIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 58, + "complexity": 13, + "token_count": 464, + "parameters": [ + "mit" + ], + "start_line": 6992, + "end_line": 7061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterReset", + "long_name": "PyArray_MapIterReset( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 35, + "complexity": 4, + "token_count": 263, + "parameters": [ + "mit" + ], + "start_line": 7065, + "end_line": 7102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterNext", + "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 6, + "token_count": 298, + "parameters": [ + "mit" + ], + "start_line": 7108, + "end_line": 7152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterBind", + "long_name": "PyArray_MapIterBind( PyArrayMapIterObject * mit , PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 99, + "complexity": 22, + "token_count": 670, + "parameters": [ + "mit", + "arr" + ], + "start_line": 7170, + "end_line": 7300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 131, + "top_nesting_level": 0 + }, + { + "name": "_nonzero_indices", + "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)", + "filename": "arrayobject.c", + "nloc": 60, + "complexity": 15, + "token_count": 460, + "parameters": [ + "myBool", + "iters" + ], + "start_line": 7306, + "end_line": 7379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterNew", + "long_name": "PyArray_MapIterNew( PyObject * indexobj , int oned)", + "filename": "arrayobject.c", + "nloc": 112, + "complexity": 25, + "token_count": 758, + "parameters": [ + "indexobj", + "oned" + ], + "start_line": 7382, + "end_line": 7517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 136, + "top_nesting_level": 0 + }, + { + "name": "arraymapiter_dealloc", + "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 62, + "parameters": [ + "mit" + ], + "start_line": 7521, + "end_line": 7530, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiIterNew", + "long_name": "PyArray_MultiIterNew( int n , ...)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 10, + "token_count": 231, + "parameters": [ + "n" + ], + "start_line": 7601, + "end_line": 7650, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_new", + "long_name": "arraymultiter_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 11, + "token_count": 265, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 7653, + "end_line": 7698, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_next", + "long_name": "arraymultiter_next( PyArrayMultiIterObject * multi)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 4, + "token_count": 111, + "parameters": [ + "multi" + ], + "start_line": 7701, + "end_line": 7720, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_dealloc", + "long_name": "arraymultiter_dealloc( PyArrayMultiIterObject * multi)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 41, + "parameters": [ + "multi" + ], + "start_line": 7723, + "end_line": 7730, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_size_get", + "long_name": "arraymultiter_size_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 7733, + "end_line": 7743, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_index_get", + "long_name": "arraymultiter_index_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 7746, + "end_line": 7756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_shape_get", + "long_name": "arraymultiter_shape_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 7759, + "end_line": 7762, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_iters_get", + "long_name": "arraymultiter_iters_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 3, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 7765, + "end_line": 7777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_reset", + "long_name": "arraymultiter_reset( PyArrayMultiIterObject * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self", + "args" + ], + "start_line": 7807, + "end_line": 7814, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNewFromType", + "long_name": "PyArray_DescrNewFromType( int type_num)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 1, + "token_count": 37, + "parameters": [ + "type_num" + ], + "start_line": 7873, + "end_line": 7882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNew", + "long_name": "PyArray_DescrNew( PyArray_Descr * base)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 4, + "token_count": 151, + "parameters": [ + "base" + ], + "start_line": 7900, + "end_line": 7922, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_dealloc", + "long_name": "arraydescr_dealloc( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 2, + "token_count": 64, + "parameters": [ + "self" + ], + "start_line": 7928, + "end_line": 7938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_subdescr_get", + "long_name": "arraydescr_subdescr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 7956, + "end_line": 7964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_protocol_typestr_get", + "long_name": "arraydescr_protocol_typestr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 3, + "token_count": 60, + "parameters": [ + "self" + ], + "start_line": 7967, + "end_line": 7979, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_protocol_descr_get", + "long_name": "arraydescr_protocol_descr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 5, + "token_count": 119, + "parameters": [ + "self" + ], + "start_line": 7982, + "end_line": 8001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_isbuiltin_get", + "long_name": "arraydescr_isbuiltin_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 8008, + "end_line": 8015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_isnative_get", + "long_name": "arraydescr_isnative_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 8018, + "end_line": 8025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_fields_get", + "long_name": "arraydescr_fields_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 8028, + "end_line": 8035, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_new", + "long_name": "arraydescr_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 47, + "complexity": 13, + "token_count": 251, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 8071, + "end_line": 8122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_reduce", + "long_name": "arraydescr_reduce( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 50, + "complexity": 12, + "token_count": 377, + "parameters": [ + "self", + "args" + ], + "start_line": 8128, + "end_line": 8185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 58, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_setstate", + "long_name": "arraydescr_setstate( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 35, + "complexity": 8, + "token_count": 260, + "parameters": [ + "self", + "args" + ], + "start_line": 8193, + "end_line": 8235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNewByteorder", + "long_name": "PyArray_DescrNewByteorder( PyArray_Descr * self , char newendian)", + "filename": "arrayobject.c", + "nloc": 63, + "complexity": 16, + "token_count": 386, + "parameters": [ + "self", + "newendian" + ], + "start_line": 8255, + "end_line": 8321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_newbyteorder", + "long_name": "arraydescr_newbyteorder( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "self", + "args" + ], + "start_line": 8332, + "end_line": 8340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_str", + "long_name": "arraydescr_str( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 6, + "token_count": 281, + "parameters": [ + "self" + ], + "start_line": 8355, + "end_line": 8397, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_repr", + "long_name": "arraydescr_repr( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 8400, + "end_line": 8409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_compare", + "long_name": "arraydescr_compare( PyArray_Descr * self , PyObject * other)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "other" + ], + "start_line": 8412, + "end_line": 8422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "PyArray_PyIntAsIntp", + "long_name": "PyArray_PyIntAsIntp( PyObject * o)", + "filename": "arrayobject.c", + "nloc": 61, + "complexity": 19, + "token_count": 391, + "parameters": [ + "o" + ], + "start_line": 31, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 0 + }, + { + "name": "PyArray_PyIntAsInt", + "long_name": "PyArray_PyIntAsInt( PyObject * o)", + "filename": "arrayobject.c", + "nloc": 59, + "complexity": 19, + "token_count": 394, + "parameters": [ + "o" + ], + "start_line": 103, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetPriority", + "long_name": "PyArray_GetPriority( PyObject * obj , double default_)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 5, + "token_count": 86, + "parameters": [ + "obj", + "default_" + ], + "start_line": 173, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Zero", + "long_name": "PyArray_Zero( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 148, + "parameters": [ + "arr" + ], + "start_line": 212, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_One", + "long_name": "PyArray_One( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 148, + "parameters": [ + "arr" + ], + "start_line": 246, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "do_sliced_copy", + "long_name": "do_sliced_copy( char * dest , intp * dest_strides , intp * dest_dimensions , int dest_nd , char * src , intp * src_strides , intp * src_dimensions , int src_nd , int elsize , int copies)", + "filename": "arrayobject.c", + "nloc": 48, + "complexity": 13, + "token_count": 313, + "parameters": [ + "dest", + "dest_strides", + "dest_dimensions", + "dest_nd", + "src", + "src_strides", + "src_dimensions", + "src_nd", + "elsize", + "copies" + ], + "start_line": 281, + "end_line": 331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "optimize_slices", + "long_name": "optimize_slices( intp ** dest_strides , intp ** dest_dimensions , int * dest_nd , intp ** src_strides , intp ** src_dimensions , int * src_nd , int * elsize , int * copies)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 8, + "token_count": 214, + "parameters": [ + "dest_strides", + "dest_dimensions", + "dest_nd", + "src_strides", + "src_dimensions", + "src_nd", + "elsize", + "copies" + ], + "start_line": 354, + "end_line": 385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "contiguous_data", + "long_name": "contiguous_data( PyArrayObject * src)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 4, + "token_count": 215, + "parameters": [ + "src" + ], + "start_line": 388, + "end_line": 422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + }, + { + "name": "PyArray_INCREF", + "long_name": "PyArray_INCREF( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 6, + "token_count": 125, + "parameters": [ + "mp" + ], + "start_line": 438, + "end_line": 460, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "PyArray_XDECREF", + "long_name": "PyArray_XDECREF( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 6, + "token_count": 125, + "parameters": [ + "mp" + ], + "start_line": 466, + "end_line": 487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "byte_swap_vector", + "long_name": "byte_swap_vector( * p , int n , int size)", + "filename": "arrayobject.c", + "nloc": 38, + "complexity": 10, + "token_count": 340, + "parameters": [ + "p", + "n", + "size" + ], + "start_line": 491, + "end_line": 529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "copy_and_swap", + "long_name": "copy_and_swap( * dst , * src , int itemsize , intp numitems , intp srcstrides , int swap)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 5, + "token_count": 120, + "parameters": [ + "dst", + "src", + "itemsize", + "numitems", + "srcstrides", + "swap" + ], + "start_line": 534, + "end_line": 554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "index2ptr", + "long_name": "index2ptr( PyArrayObject * mp , intp i)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 7, + "token_count": 98, + "parameters": [ + "mp", + "i" + ], + "start_line": 562, + "end_line": 577, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Size", + "long_name": "PyArray_Size( PyObject * op)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 33, + "parameters": [ + "op" + ], + "start_line": 583, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyInto", + "long_name": "PyArray_CopyInto( PyArrayObject * dest , PyArrayObject * src)", + "filename": "arrayobject.c", + "nloc": 71, + "complexity": 16, + "token_count": 435, + "parameters": [ + "dest", + "src" + ], + "start_line": 607, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 81, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyObject", + "long_name": "PyArray_CopyObject( PyArrayObject * dest , PyObject * src_object)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 2, + "token_count": 79, + "parameters": [ + "dest", + "src_object" + ], + "start_line": 691, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromDimsAndDataAndDescr", + "long_name": "PyArray_FromDimsAndDataAndDescr( int nd , int * d , PyArray_Descr * descr , char * data)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 7, + "token_count": 137, + "parameters": [ + "nd", + "d", + "descr", + "data" + ], + "start_line": 718, + "end_line": 744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromDims", + "long_name": "PyArray_FromDims( int nd , int * d , int type)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 3, + "token_count": 69, + "parameters": [ + "nd", + "d", + "type" + ], + "start_line": 750, + "end_line": 764, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "PyArray_NewCopy", + "long_name": "PyArray_NewCopy( PyArrayObject * m1 , int fortran)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 4, + "token_count": 110, + "parameters": [ + "m1", + "fortran" + ], + "start_line": 772, + "end_line": 792, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Scalar", + "long_name": "PyArray_Scalar( * data , PyArray_Descr * descr , PyObject * base)", + "filename": "arrayobject.c", + "nloc": 75, + "complexity": 10, + "token_count": 436, + "parameters": [ + "data", + "descr", + "base" + ], + "start_line": 801, + "end_line": 879, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToScalar", + "long_name": "PyArray_ToScalar( * data , PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "data", + "arr" + ], + "start_line": 895, + "end_line": 898, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Return", + "long_name": "PyArray_Return( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 4, + "token_count": 76, + "parameters": [ + "mp" + ], + "start_line": 908, + "end_line": 928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_RegisterDataType", + "long_name": "PyArray_RegisterDataType( PyTypeObject * type)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 9, + "token_count": 229, + "parameters": [ + "type" + ], + "start_line": 942, + "end_line": 982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "PyArray_RegisterDescrForType", + "long_name": "PyArray_RegisterDescrForType( int typenum , PyArray_Descr * descr)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 6, + "token_count": 214, + "parameters": [ + "typenum", + "descr" + ], + "start_line": 997, + "end_line": 1038, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToFile", + "long_name": "PyArray_ToFile( PyArrayObject * self , FILE * fp , char * sep , char * format)", + "filename": "arrayobject.c", + "nloc": 89, + "complexity": 18, + "token_count": 595, + "parameters": [ + "self", + "fp", + "sep", + "format" + ], + "start_line": 1045, + "end_line": 1136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 92, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToList", + "long_name": "PyArray_ToList( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 25, + "complexity": 5, + "token_count": 158, + "parameters": [ + "self" + ], + "start_line": 1142, + "end_line": 1171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ToString", + "long_name": "PyArray_ToString( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 5, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 1174, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "array_dealloc", + "long_name": "array_dealloc( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self" + ], + "start_line": 1219, + "end_line": 1256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "array_length", + "long_name": "array_length( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 1263, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_big_item", + "long_name": "array_big_item( PyArrayObject * self , intp i)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 4, + "token_count": 151, + "parameters": [ + "self", + "i" + ], + "start_line": 1274, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_item_nice", + "long_name": "array_item_nice( PyArrayObject * self , int i)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "i" + ], + "start_line": 1302, + "end_line": 1305, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_ass_big_item", + "long_name": "array_ass_big_item( PyArrayObject * self , intp i , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 9, + "token_count": 200, + "parameters": [ + "self", + "i", + "v" + ], + "start_line": 1309, + "end_line": 1344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "array_ass_item", + "long_name": "array_ass_item( PyArrayObject * self , int i , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self", + "i", + "v" + ], + "start_line": 1350, + "end_line": 1353, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "slice_coerce_index", + "long_name": "slice_coerce_index( PyObject * o , intp * v)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 40, + "parameters": [ + "o", + "v" + ], + "start_line": 1359, + "end_line": 1367, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "slice_GetIndices", + "long_name": "slice_GetIndices( PySliceObject * r , intp length , intp * start , intp * stop , intp * step , intp * slicelength)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 24, + "token_count": 376, + "parameters": [ + "r", + "length", + "start", + "stop", + "step", + "slicelength" + ], + "start_line": 1373, + "end_line": 1423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "parse_subindex", + "long_name": "parse_subindex( PyObject * op , intp * step_size , intp * n_steps , intp max)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 11, + "token_count": 223, + "parameters": [ + "op", + "step_size", + "n_steps", + "max" + ], + "start_line": 1430, + "end_line": 1475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "parse_index", + "long_name": "parse_index( PyArrayObject * self , PyObject * op , intp * dimensions , intp * strides , intp * offset_ptr)", + "filename": "arrayobject.c", + "nloc": 88, + "complexity": 20, + "token_count": 539, + "parameters": [ + "self", + "op", + "dimensions", + "strides", + "offset_ptr" + ], + "start_line": 1479, + "end_line": 1573, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 95, + "top_nesting_level": 0 + }, + { + "name": "_swap_axes", + "long_name": "_swap_axes( PyArrayMapIterObject * mit , PyArrayObject ** ret)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 4, + "token_count": 176, + "parameters": [ + "mit", + "ret" + ], + "start_line": 1576, + "end_line": 1613, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetMap", + "long_name": "PyArray_GetMap( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 40, + "complexity": 8, + "token_count": 258, + "parameters": [ + "mit" + ], + "start_line": 1625, + "end_line": 1678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetMap", + "long_name": "PyArray_SetMap( PyArrayMapIterObject * mit , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 53, + "complexity": 12, + "token_count": 380, + "parameters": [ + "mit", + "op" + ], + "start_line": 1681, + "end_line": 1741, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "array_subscript", + "long_name": "array_subscript( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 90, + "complexity": 23, + "token_count": 576, + "parameters": [ + "self", + "op" + ], + "start_line": 1764, + "end_line": 1868, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "array_ass_sub", + "long_name": "array_ass_sub( PyArrayObject * self , PyObject * index , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 87, + "complexity": 23, + "token_count": 528, + "parameters": [ + "self", + "index", + "op" + ], + "start_line": 1883, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 99, + "top_nesting_level": 0 + }, + { + "name": "array_subscript_nice", + "long_name": "array_subscript_nice( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "op" + ], + "start_line": 1989, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_getsegcount", + "long_name": "array_getsegcount( PyArrayObject * self , int * lenp)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 4, + "token_count": 48, + "parameters": [ + "self", + "lenp" + ], + "start_line": 2011, + "end_line": 2023, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_getreadbuf", + "long_name": "array_getreadbuf( PyArrayObject * self , int segment , ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2026, + "end_line": 2041, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_getwritebuf", + "long_name": "array_getwritebuf( PyArrayObject * self , int segment , ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 54, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2045, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "array_getcharbuf", + "long_name": "array_getcharbuf( PyArrayObject * self , int segment , const char ** ptrptr)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 3, + "token_count": 65, + "parameters": [ + "self", + "segment", + "ptrptr" + ], + "start_line": 2057, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetNumericOps", + "long_name": "PyArray_SetNumericOps( PyObject * dict)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 1, + "token_count": 162, + "parameters": [ + "dict" + ], + "start_line": 2139, + "end_line": 2172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetNumericOps", + "long_name": "PyArray_GetNumericOps()", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 2, + "token_count": 183, + "parameters": [], + "start_line": 2182, + "end_line": 2221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericReduceFunction", + "long_name": "PyArray_GenericReduceFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 5, + "token_count": 141, + "parameters": [ + "m1", + "op", + "axis", + "rtype" + ], + "start_line": 2224, + "end_line": 2247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericAccumulateFunction", + "long_name": "PyArray_GenericAccumulateFunction( PyArrayObject * m1 , PyObject * op , int axis , int rtype)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 5, + "token_count": 141, + "parameters": [ + "m1", + "op", + "axis", + "rtype" + ], + "start_line": 2251, + "end_line": 2274, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericBinaryFunction", + "long_name": "PyArray_GenericBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 44, + "parameters": [ + "m1", + "m2", + "op" + ], + "start_line": 2278, + "end_line": 2285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericUnaryFunction", + "long_name": "PyArray_GenericUnaryFunction( PyArrayObject * m1 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 38, + "parameters": [ + "m1", + "op" + ], + "start_line": 2288, + "end_line": 2295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GenericInplaceBinaryFunction", + "long_name": "PyArray_GenericInplaceBinaryFunction( PyArrayObject * m1 , PyObject * m2 , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 46, + "parameters": [ + "m1", + "m2", + "op" + ], + "start_line": 2298, + "end_line": 2306, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_add", + "long_name": "array_add( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2309, + "end_line": 2312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_subtract", + "long_name": "array_subtract( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2315, + "end_line": 2318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_multiply", + "long_name": "array_multiply( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2321, + "end_line": 2324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_divide", + "long_name": "array_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2327, + "end_line": 2330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_remainder", + "long_name": "array_remainder( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2333, + "end_line": 2336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_power", + "long_name": "array_power( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2339, + "end_line": 2342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_negative", + "long_name": "array_negative( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2345, + "end_line": 2348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_absolute", + "long_name": "array_absolute( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2351, + "end_line": 2354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_invert", + "long_name": "array_invert( PyArrayObject * m1)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "m1" + ], + "start_line": 2357, + "end_line": 2360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_left_shift", + "long_name": "array_left_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2363, + "end_line": 2366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_right_shift", + "long_name": "array_right_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2369, + "end_line": 2372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_and", + "long_name": "array_bitwise_and( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2375, + "end_line": 2378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_or", + "long_name": "array_bitwise_or( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2381, + "end_line": 2384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_bitwise_xor", + "long_name": "array_bitwise_xor( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2387, + "end_line": 2390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_add", + "long_name": "array_inplace_add( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2393, + "end_line": 2396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_subtract", + "long_name": "array_inplace_subtract( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2399, + "end_line": 2402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_multiply", + "long_name": "array_inplace_multiply( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2405, + "end_line": 2408, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_divide", + "long_name": "array_inplace_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2411, + "end_line": 2414, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_remainder", + "long_name": "array_inplace_remainder( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2417, + "end_line": 2420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_power", + "long_name": "array_inplace_power( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2423, + "end_line": 2426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_left_shift", + "long_name": "array_inplace_left_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2429, + "end_line": 2432, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_right_shift", + "long_name": "array_inplace_right_shift( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2435, + "end_line": 2438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_and", + "long_name": "array_inplace_bitwise_and( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2441, + "end_line": 2444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_or", + "long_name": "array_inplace_bitwise_or( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2447, + "end_line": 2450, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_bitwise_xor", + "long_name": "array_inplace_bitwise_xor( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2453, + "end_line": 2456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_floor_divide", + "long_name": "array_floor_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2459, + "end_line": 2462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_true_divide", + "long_name": "array_true_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2465, + "end_line": 2468, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_floor_divide", + "long_name": "array_inplace_floor_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2471, + "end_line": 2475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_inplace_true_divide", + "long_name": "array_inplace_true_divide( PyArrayObject * m1 , PyObject * m2)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "m1", + "m2" + ], + "start_line": 2478, + "end_line": 2482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_any_nonzero", + "long_name": "array_any_nonzero( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 4, + "token_count": 95, + "parameters": [ + "mp" + ], + "start_line": 2486, + "end_line": 2504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "_array_nonzero", + "long_name": "_array_nonzero( PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 3, + "token_count": 72, + "parameters": [ + "mp" + ], + "start_line": 2507, + "end_line": 2524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_divmod", + "long_name": "array_divmod( PyArrayObject * op1 , PyObject * op2)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 89, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2529, + "end_line": 2544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_int", + "long_name": "array_int( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 5, + "token_count": 145, + "parameters": [ + "v" + ], + "start_line": 2548, + "end_line": 2574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "array_float", + "long_name": "array_float( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 5, + "token_count": 145, + "parameters": [ + "v" + ], + "start_line": 2577, + "end_line": 2602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_long", + "long_name": "array_long( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2605, + "end_line": 2627, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "array_oct", + "long_name": "array_oct( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2630, + "end_line": 2652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "array_hex", + "long_name": "array_hex( PyArrayObject * v)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 4, + "token_count": 126, + "parameters": [ + "v" + ], + "start_line": 2655, + "end_line": 2677, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "_array_copy_nice", + "long_name": "_array_copy_nice( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 2680, + "end_line": 2684, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_slice", + "long_name": "array_slice( PyArrayObject * self , int ilow , int ihigh)", + "filename": "arrayobject.c", + "nloc": 36, + "complexity": 11, + "token_count": 259, + "parameters": [ + "self", + "ilow", + "ihigh" + ], + "start_line": 2745, + "end_line": 2785, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "array_ass_slice", + "long_name": "array_ass_slice( PyArrayObject * self , int ilow , int ihigh , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 4, + "token_count": 108, + "parameters": [ + "self", + "ilow", + "ihigh", + "v" + ], + "start_line": 2789, + "end_line": 2810, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "array_contains", + "long_name": "array_contains( PyArrayObject * self , PyObject * el)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "el" + ], + "start_line": 2813, + "end_line": 2825, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dump_data", + "long_name": "dump_data( char ** string , int * n , int * max_n , char * data , int nd , intp * dimensions , intp * strides , PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 7, + "token_count": 310, + "parameters": [ + "string", + "n", + "max_n", + "data", + "nd", + "dimensions", + "strides", + "self" + ], + "start_line": 2846, + "end_line": 2893, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "array_repr_builtin", + "long_name": "array_repr_builtin( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 30, + "complexity": 4, + "token_count": 224, + "parameters": [ + "self" + ], + "start_line": 2896, + "end_line": 2932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SetStringFunction", + "long_name": "PyArray_SetStringFunction( PyObject * op , int repr)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 48, + "parameters": [ + "op", + "repr" + ], + "start_line": 2941, + "end_line": 2958, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_repr", + "long_name": "array_repr( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self" + ], + "start_line": 2961, + "end_line": 2973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_str", + "long_name": "array_str( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 12, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self" + ], + "start_line": 2976, + "end_line": 2988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_richcompare", + "long_name": "array_richcompare( PyArrayObject * self , PyObject * other , int cmp_op)", + "filename": "arrayobject.c", + "nloc": 61, + "complexity": 13, + "token_count": 273, + "parameters": [ + "self", + "other", + "cmp_op" + ], + "start_line": 2991, + "end_line": 3068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 78, + "top_nesting_level": 0 + }, + { + "name": "_check_axis", + "long_name": "_check_axis( PyArrayObject * arr , int * axis , int flags)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 8, + "token_count": 164, + "parameters": [ + "arr", + "axis", + "flags" + ], + "start_line": 3071, + "end_line": 3100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntTupleFromIntp", + "long_name": "PyArray_IntTupleFromIntp( int len , intp * vals)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 5, + "token_count": 109, + "parameters": [ + "len", + "vals" + ], + "start_line": 3106, + "end_line": 3126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntpFromSequence", + "long_name": "PyArray_IntpFromSequence( PyObject * seq , intp * vals , int maxvals)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 7, + "token_count": 161, + "parameters": [ + "seq", + "vals", + "maxvals" + ], + "start_line": 3134, + "end_line": 3157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "_IsContiguous", + "long_name": "_IsContiguous( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 6, + "token_count": 111, + "parameters": [ + "ap" + ], + "start_line": 3163, + "end_line": 3179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_IsFortranContiguous", + "long_name": "_IsFortranContiguous( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 6, + "token_count": 109, + "parameters": [ + "ap" + ], + "start_line": 3183, + "end_line": 3199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_IsAligned", + "long_name": "_IsAligned( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 5, + "token_count": 119, + "parameters": [ + "ap" + ], + "start_line": 3202, + "end_line": 3219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "_IsWriteable", + "long_name": "_IsWriteable( PyArrayObject * ap)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 7, + "token_count": 107, + "parameters": [ + "ap" + ], + "start_line": 3222, + "end_line": 3255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "PyArray_UpdateFlags", + "long_name": "PyArray_UpdateFlags( PyArrayObject * ret , int flagmask)", + "filename": "arrayobject.c", + "nloc": 26, + "complexity": 11, + "token_count": 157, + "parameters": [ + "ret", + "flagmask" + ], + "start_line": 3262, + "end_line": 3289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CheckStrides", + "long_name": "PyArray_CheckStrides( int elsize , int nd , intp numbytes , intp * dims , intp * newstrides)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 4, + "token_count": 84, + "parameters": [ + "elsize", + "nd", + "numbytes", + "dims", + "newstrides" + ], + "start_line": 3298, + "end_line": 3313, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "_array_fill_strides", + "long_name": "_array_fill_strides( intp * strides , intp * dims , int nd , intp itemsize , int inflag , int * objflags)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 9, + "token_count": 171, + "parameters": [ + "strides", + "dims", + "nd", + "itemsize", + "inflag", + "objflags" + ], + "start_line": 3333, + "end_line": 3357, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "PyArray_New", + "long_name": "PyArray_New( PyTypeObject * subtype , int nd , intp * dims , int type_num , intp * strides , * data , int itemsize , int flags , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 22, + "complexity": 4, + "token_count": 128, + "parameters": [ + "subtype", + "nd", + "dims", + "type_num", + "strides", + "data", + "itemsize", + "flags", + "obj" + ], + "start_line": 3363, + "end_line": 3385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "_update_descr_and_dimensions", + "long_name": "_update_descr_and_dimensions( PyArray_Descr ** des , intp * newdims , intp * newstrides , int oldnd)", + "filename": "arrayobject.c", + "nloc": 37, + "complexity": 6, + "token_count": 229, + "parameters": [ + "des", + "newdims", + "newstrides", + "oldnd" + ], + "start_line": 3389, + "end_line": 3431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "PyArray_NewFromDescr", + "long_name": "PyArray_NewFromDescr( PyTypeObject * subtype , PyArray_Descr * descr , int nd , intp * dims , intp * strides , * data , int flags , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 127, + "complexity": 25, + "token_count": 744, + "parameters": [ + "subtype", + "descr", + "nd", + "dims", + "strides", + "data", + "flags", + "obj" + ], + "start_line": 3439, + "end_line": 3599, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 161, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Resize", + "long_name": "PyArray_Resize( PyArrayObject * self , PyArray_Dims * newshape)", + "filename": "arrayobject.c", + "nloc": 87, + "complexity": 15, + "token_count": 500, + "parameters": [ + "self", + "newshape" + ], + "start_line": 3608, + "end_line": 3713, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 106, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FillObjectArray", + "long_name": "PyArray_FillObjectArray( PyArrayObject * arr , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 18, + "complexity": 4, + "token_count": 98, + "parameters": [ + "arr", + "obj" + ], + "start_line": 3719, + "end_line": 3736, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FillWithScalar", + "long_name": "PyArray_FillWithScalar( PyArrayObject * arr , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 6, + "token_count": 229, + "parameters": [ + "arr", + "obj" + ], + "start_line": 3740, + "end_line": 3782, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "array_new", + "long_name": "array_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 101, + "complexity": 18, + "token_count": 570, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 3785, + "end_line": 3899, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 115, + "top_nesting_level": 0 + }, + { + "name": "array_iter", + "long_name": "array_iter( PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 38, + "parameters": [ + "arr" + ], + "start_line": 3903, + "end_line": 3911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_ndim_get", + "long_name": "array_ndim_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 3917, + "end_line": 3920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_flags_get", + "long_name": "array_flags_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 3923, + "end_line": 3927, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_shape_get", + "long_name": "array_shape_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 3930, + "end_line": 3933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_shape_set", + "long_name": "array_shape_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 27, + "complexity": 4, + "token_count": 183, + "parameters": [ + "self", + "val" + ], + "start_line": 3937, + "end_line": 3966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "array_strides_get", + "long_name": "array_strides_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 3970, + "end_line": 3973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_strides_set", + "long_name": "array_strides_set( PyArrayObject * self , PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 36, + "complexity": 7, + "token_count": 231, + "parameters": [ + "self", + "obj" + ], + "start_line": 3976, + "end_line": 4014, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "array_protocol_strides_get", + "long_name": "array_protocol_strides_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 4018, + "end_line": 4025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "array_priority_get", + "long_name": "array_priority_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 4028, + "end_line": 4036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_dataptr_get", + "long_name": "array_dataptr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 4040, + "end_line": 4046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_data_get", + "long_name": "array_data_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 15, + "complexity": 3, + "token_count": 82, + "parameters": [ + "self" + ], + "start_line": 4049, + "end_line": 4063, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "array_data_set", + "long_name": "array_data_set( PyArrayObject * self , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 44, + "complexity": 9, + "token_count": 229, + "parameters": [ + "self", + "op" + ], + "start_line": 4066, + "end_line": 4110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "array_itemsize_get", + "long_name": "array_itemsize_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 4114, + "end_line": 4117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_size_get", + "long_name": "array_size_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 4, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 4120, + "end_line": 4131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_nbytes_get", + "long_name": "array_nbytes_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 4, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 4134, + "end_line": 4145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_typechar_get", + "long_name": "array_typechar_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 4149, + "end_line": 4156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "array_typestr_get", + "long_name": "array_typestr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 4161, + "end_line": 4164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_descr_get", + "long_name": "array_descr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 4167, + "end_line": 4171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_descr_set", + "long_name": "array_descr_set( PyArrayObject * self , PyObject * arg)", + "filename": "arrayobject.c", + "nloc": 63, + "complexity": 15, + "token_count": 443, + "parameters": [ + "self", + "arg" + ], + "start_line": 4185, + "end_line": 4270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "array_protocol_descr_get", + "long_name": "array_protocol_descr_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 4, + "token_count": 117, + "parameters": [ + "self" + ], + "start_line": 4273, + "end_line": 4291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "array_struct_get", + "long_name": "array_struct_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 2, + "token_count": 130, + "parameters": [ + "self" + ], + "start_line": 4294, + "end_line": 4312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "array_type_get", + "long_name": "array_type_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 4315, + "end_line": 4319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "array_base_get", + "long_name": "array_base_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 4324, + "end_line": 4334, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "array_real_get", + "long_name": "array_real_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 25, + "complexity": 3, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 4338, + "end_line": 4363, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "array_real_set", + "long_name": "array_real_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 32, + "complexity": 4, + "token_count": 189, + "parameters": [ + "self", + "val" + ], + "start_line": 4367, + "end_line": 4400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "array_imag_get", + "long_name": "array_imag_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 33, + "complexity": 3, + "token_count": 178, + "parameters": [ + "self" + ], + "start_line": 4403, + "end_line": 4436, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "array_imag_set", + "long_name": "array_imag_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 37, + "complexity": 4, + "token_count": 205, + "parameters": [ + "self", + "val" + ], + "start_line": 4439, + "end_line": 4476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "array_flat_get", + "long_name": "array_flat_get( PyArrayObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 4479, + "end_line": 4482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "array_flat_set", + "long_name": "array_flat_set( PyArrayObject * self , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 48, + "complexity": 9, + "token_count": 346, + "parameters": [ + "self", + "val" + ], + "start_line": 4485, + "end_line": 4535, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "array_alloc", + "long_name": "array_alloc( PyTypeObject * type , int nitems)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 1, + "token_count": 39, + "parameters": [ + "type", + "nitems" + ], + "start_line": 4637, + "end_line": 4644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "discover_depth", + "long_name": "discover_depth( PyObject * s , int max , int stop_at_string , int stop_at_tuple)", + "filename": "arrayobject.c", + "nloc": 31, + "complexity": 19, + "token_count": 243, + "parameters": [ + "s", + "max", + "stop_at_string", + "stop_at_tuple" + ], + "start_line": 4746, + "end_line": 4779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "discover_itemsize", + "long_name": "discover_itemsize( PyObject * s , int nd , int * itemsize)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 9, + "token_count": 161, + "parameters": [ + "s", + "nd", + "itemsize" + ], + "start_line": 4782, + "end_line": 4804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "discover_dimensions", + "long_name": "discover_dimensions( PyObject * s , int nd , intp * d , int check_it)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 10, + "token_count": 188, + "parameters": [ + "s", + "nd", + "d", + "check_it" + ], + "start_line": 4811, + "end_line": 4837, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "_array_small_type", + "long_name": "_array_small_type( PyArray_Descr * chktype , PyArray_Descr * mintype)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 8, + "token_count": 169, + "parameters": [ + "chktype", + "mintype" + ], + "start_line": 4843, + "end_line": 4875, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "_array_find_type", + "long_name": "_array_find_type( PyObject * op , PyArray_Descr * minitype , int max)", + "filename": "arrayobject.c", + "nloc": 120, + "complexity": 31, + "token_count": 691, + "parameters": [ + "op", + "minitype", + "max" + ], + "start_line": 4887, + "end_line": 5023, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 137, + "top_nesting_level": 0 + }, + { + "name": "Assign_Array", + "long_name": "Assign_Array( PyArrayObject * self , PyObject * v)", + "filename": "arrayobject.c", + "nloc": 21, + "complexity": 6, + "token_count": 121, + "parameters": [ + "self", + "v" + ], + "start_line": 5026, + "end_line": 5049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "Array_FromScalar", + "long_name": "Array_FromScalar( PyObject * op , PyArray_Descr * typecode)", + "filename": "arrayobject.c", + "nloc": 23, + "complexity": 6, + "token_count": 146, + "parameters": [ + "op", + "typecode" + ], + "start_line": 5054, + "end_line": 5082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "Array_FromSequence", + "long_name": "Array_FromSequence( PyObject * s , PyArray_Descr * typecode , int fortran , int min_depth , int max_depth)", + "filename": "arrayobject.c", + "nloc": 57, + "complexity": 21, + "token_count": 367, + "parameters": [ + "s", + "typecode", + "fortran", + "min_depth", + "max_depth" + ], + "start_line": 5087, + "end_line": 5151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ValidType", + "long_name": "PyArray_ValidType( int type)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 41, + "parameters": [ + "type" + ], + "start_line": 5158, + "end_line": 5167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_bufferedcast", + "long_name": "_bufferedcast( PyArrayObject * out , PyArrayObject * in)", + "filename": "arrayobject.c", + "nloc": 79, + "complexity": 18, + "token_count": 525, + "parameters": [ + "out", + "in" + ], + "start_line": 5173, + "end_line": 5266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CastToType", + "long_name": "PyArray_CastToType( PyArrayObject * mp , PyArray_Descr * at , int fortran)", + "filename": "arrayobject.c", + "nloc": 40, + "complexity": 16, + "token_count": 280, + "parameters": [ + "mp", + "at", + "fortran" + ], + "start_line": 5276, + "end_line": 5322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CastTo", + "long_name": "PyArray_CastTo( PyArrayObject * out , PyArrayObject * mp)", + "filename": "arrayobject.c", + "nloc": 45, + "complexity": 11, + "token_count": 241, + "parameters": [ + "out", + "mp" + ], + "start_line": 5332, + "end_line": 5385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "array_fromarray", + "long_name": "array_fromarray( PyArrayObject * arr , PyArray_Descr * newtype , int flags)", + "filename": "arrayobject.c", + "nloc": 114, + "complexity": 32, + "token_count": 673, + "parameters": [ + "arr", + "newtype", + "flags" + ], + "start_line": 5389, + "end_line": 5518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 130, + "top_nesting_level": 0 + }, + { + "name": "_array_typedescr_fromstr", + "long_name": "_array_typedescr_fromstr( char * str)", + "filename": "arrayobject.c", + "nloc": 98, + "complexity": 36, + "token_count": 505, + "parameters": [ + "str" + ], + "start_line": 5522, + "end_line": 5630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 109, + "top_nesting_level": 0 + }, + { + "name": "array_fromstructinterface", + "long_name": "array_fromstructinterface( PyObject * input , PyArray_Descr * intype , int flags)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 6, + "token_count": 274, + "parameters": [ + "input", + "intype", + "flags" + ], + "start_line": 5634, + "end_line": 5678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "array_frominterface", + "long_name": "array_frominterface( PyObject * input , PyArray_Descr * intype , int flags)", + "filename": "arrayobject.c", + "nloc": 134, + "complexity": 28, + "token_count": 839, + "parameters": [ + "input", + "intype", + "flags" + ], + "start_line": 5682, + "end_line": 5825, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 144, + "top_nesting_level": 0 + }, + { + "name": "array_fromattr", + "long_name": "array_fromattr( PyObject * op , PyArray_Descr * typecode , int flags)", + "filename": "arrayobject.c", + "nloc": 29, + "complexity": 5, + "token_count": 178, + "parameters": [ + "op", + "typecode", + "flags" + ], + "start_line": 5829, + "end_line": 5859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "array_fromobject", + "long_name": "array_fromobject( PyObject * op , PyArray_Descr * newtype , int min_depth , int max_depth , int flags)", + "filename": "arrayobject.c", + "nloc": 56, + "complexity": 17, + "token_count": 330, + "parameters": [ + "op", + "newtype", + "min_depth", + "max_depth", + "flags" + ], + "start_line": 5863, + "end_line": 5939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrFromObject", + "long_name": "PyArray_DescrFromObject( PyObject * op , PyArray_Descr * mintype)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 22, + "parameters": [ + "op", + "mintype" + ], + "start_line": 5944, + "end_line": 5947, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ObjectType", + "long_name": "PyArray_ObjectType( PyObject * op , int minimum_type)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 2, + "token_count": 69, + "parameters": [ + "op", + "minimum_type" + ], + "start_line": 5954, + "end_line": 5967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromAny", + "long_name": "PyArray_FromAny( PyObject * op , PyArray_Descr * descr , int min_depth , int max_depth , int requires)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 8, + "token_count": 117, + "parameters": [ + "op", + "descr", + "min_depth", + "max_depth", + "requires" + ], + "start_line": 6013, + "end_line": 6032, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "PyArray_EnsureArray", + "long_name": "PyArray_EnsureArray( PyObject * op)", + "filename": "arrayobject.c", + "nloc": 14, + "complexity": 5, + "token_count": 81, + "parameters": [ + "op" + ], + "start_line": 6045, + "end_line": 6061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CanCastSafely", + "long_name": "PyArray_CanCastSafely( int fromtype , int totype)", + "filename": "arrayobject.c", + "nloc": 86, + "complexity": 39, + "token_count": 444, + "parameters": [ + "fromtype", + "totype" + ], + "start_line": 6069, + "end_line": 6157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 89, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CanCastTo", + "long_name": "PyArray_CanCastTo( PyArray_Descr * from , PyArray_Descr * to)", + "filename": "arrayobject.c", + "nloc": 24, + "complexity": 7, + "token_count": 134, + "parameters": [ + "from", + "to" + ], + "start_line": 6162, + "end_line": 6190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IterNew", + "long_name": "PyArray_IterNew( PyObject * obj)", + "filename": "arrayobject.c", + "nloc": 34, + "complexity": 6, + "token_count": 269, + "parameters": [ + "obj" + ], + "start_line": 6203, + "end_line": 6241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IterAllButAxis", + "long_name": "PyArray_IterAllButAxis( PyObject * obj , int axis)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 3, + "token_count": 88, + "parameters": [ + "obj", + "axis" + ], + "start_line": 6249, + "end_line": 6266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "arrayiter_next", + "long_name": "arrayiter_next( PyArrayIterObject * it)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "it" + ], + "start_line": 6271, + "end_line": 6281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arrayiter_dealloc", + "long_name": "arrayiter_dealloc( PyArrayIterObject * it)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 1, + "token_count": 20, + "parameters": [ + "it" + ], + "start_line": 6284, + "end_line": 6288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "iter_length", + "long_name": "iter_length( PyArrayIterObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 6291, + "end_line": 6294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript_Bool", + "long_name": "iter_subscript_Bool( PyArrayIterObject * self , PyArrayObject * ind)", + "filename": "arrayobject.c", + "nloc": 44, + "complexity": 7, + "token_count": 281, + "parameters": [ + "self", + "ind" + ], + "start_line": 6298, + "end_line": 6348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript_int", + "long_name": "iter_subscript_int( PyArrayIterObject * self , PyArrayObject * ind)", + "filename": "arrayobject.c", + "nloc": 52, + "complexity": 8, + "token_count": 352, + "parameters": [ + "self", + "ind" + ], + "start_line": 6351, + "end_line": 6405, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "iter_subscript", + "long_name": "iter_subscript( PyArrayIterObject * self , PyObject * ind)", + "filename": "arrayobject.c", + "nloc": 113, + "complexity": 23, + "token_count": 664, + "parameters": [ + "self", + "ind" + ], + "start_line": 6409, + "end_line": 6542, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 134, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_sub_Bool", + "long_name": "iter_ass_sub_Bool( PyArrayIterObject * self , PyArrayObject * ind , PyArrayIterObject * val , int swap)", + "filename": "arrayobject.c", + "nloc": 31, + "complexity": 5, + "token_count": 180, + "parameters": [ + "self", + "ind", + "val", + "swap" + ], + "start_line": 6546, + "end_line": 6578, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_sub_int", + "long_name": "iter_ass_sub_int( PyArrayIterObject * self , PyArrayObject * ind , PyArrayIterObject * val , int swap)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 8, + "token_count": 282, + "parameters": [ + "self", + "ind", + "val", + "swap" + ], + "start_line": 6581, + "end_line": 6623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "iter_ass_subscript", + "long_name": "iter_ass_subscript( PyArrayIterObject * self , PyObject * ind , PyObject * val)", + "filename": "arrayobject.c", + "nloc": 115, + "complexity": 27, + "token_count": 692, + "parameters": [ + "self", + "ind", + "val" + ], + "start_line": 6626, + "end_line": 6760, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 135, + "top_nesting_level": 0 + }, + { + "name": "iter_array", + "long_name": "iter_array( PyArrayIterObject * it , PyObject * op)", + "filename": "arrayobject.c", + "nloc": 33, + "complexity": 5, + "token_count": 214, + "parameters": [ + "it", + "op" + ], + "start_line": 6773, + "end_line": 6818, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "iter_copy", + "long_name": "iter_copy( PyArrayIterObject * it , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "it", + "args" + ], + "start_line": 6823, + "end_line": 6827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fancy_indexing_check", + "long_name": "fancy_indexing_check( PyObject * args)", + "filename": "arrayobject.c", + "nloc": 56, + "complexity": 22, + "token_count": 295, + "parameters": [ + "args" + ], + "start_line": 6899, + "end_line": 6961, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "_convert_obj", + "long_name": "_convert_obj( PyObject * obj , PyArrayIterObject ** iter)", + "filename": "arrayobject.c", + "nloc": 16, + "complexity": 5, + "token_count": 104, + "parameters": [ + "obj", + "iter" + ], + "start_line": 6969, + "end_line": 6985, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Broadcast", + "long_name": "PyArray_Broadcast( PyArrayMultiIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 58, + "complexity": 13, + "token_count": 464, + "parameters": [ + "mit" + ], + "start_line": 6992, + "end_line": 7061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterReset", + "long_name": "PyArray_MapIterReset( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 35, + "complexity": 4, + "token_count": 263, + "parameters": [ + "mit" + ], + "start_line": 7065, + "end_line": 7102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterNext", + "long_name": "PyArray_MapIterNext( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 41, + "complexity": 6, + "token_count": 298, + "parameters": [ + "mit" + ], + "start_line": 7108, + "end_line": 7152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterBind", + "long_name": "PyArray_MapIterBind( PyArrayMapIterObject * mit , PyArrayObject * arr)", + "filename": "arrayobject.c", + "nloc": 99, + "complexity": 22, + "token_count": 670, + "parameters": [ + "mit", + "arr" + ], + "start_line": 7170, + "end_line": 7300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 131, + "top_nesting_level": 0 + }, + { + "name": "_nonzero_indices", + "long_name": "_nonzero_indices( PyObject * myBool , PyArrayIterObject ** iters)", + "filename": "arrayobject.c", + "nloc": 60, + "complexity": 15, + "token_count": 460, + "parameters": [ + "myBool", + "iters" + ], + "start_line": 7306, + "end_line": 7379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MapIterNew", + "long_name": "PyArray_MapIterNew( PyObject * indexobj , int oned)", + "filename": "arrayobject.c", + "nloc": 112, + "complexity": 25, + "token_count": 758, + "parameters": [ + "indexobj", + "oned" + ], + "start_line": 7382, + "end_line": 7517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 136, + "top_nesting_level": 0 + }, + { + "name": "arraymapiter_dealloc", + "long_name": "arraymapiter_dealloc( PyArrayMapIterObject * mit)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 2, + "token_count": 62, + "parameters": [ + "mit" + ], + "start_line": 7521, + "end_line": 7530, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiIterNew", + "long_name": "PyArray_MultiIterNew( int n , ...)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 10, + "token_count": 231, + "parameters": [ + "n" + ], + "start_line": 7601, + "end_line": 7650, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_new", + "long_name": "arraymultiter_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 39, + "complexity": 11, + "token_count": 265, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 7653, + "end_line": 7698, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_next", + "long_name": "arraymultiter_next( PyArrayMultiIterObject * multi)", + "filename": "arrayobject.c", + "nloc": 19, + "complexity": 4, + "token_count": 111, + "parameters": [ + "multi" + ], + "start_line": 7701, + "end_line": 7720, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_dealloc", + "long_name": "arraymultiter_dealloc( PyArrayMultiIterObject * multi)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 41, + "parameters": [ + "multi" + ], + "start_line": 7723, + "end_line": 7730, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_size_get", + "long_name": "arraymultiter_size_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 7733, + "end_line": 7743, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_index_get", + "long_name": "arraymultiter_index_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 7746, + "end_line": 7756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_shape_get", + "long_name": "arraymultiter_shape_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 7759, + "end_line": 7762, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_iters_get", + "long_name": "arraymultiter_iters_get( PyArrayMultiIterObject * self)", + "filename": "arrayobject.c", + "nloc": 13, + "complexity": 3, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 7765, + "end_line": 7777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "arraymultiter_reset", + "long_name": "arraymultiter_reset( PyArrayMultiIterObject * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self", + "args" + ], + "start_line": 7807, + "end_line": 7814, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNewFromType", + "long_name": "PyArray_DescrNewFromType( int type_num)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 1, + "token_count": 37, + "parameters": [ + "type_num" + ], + "start_line": 7873, + "end_line": 7882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNew", + "long_name": "PyArray_DescrNew( PyArray_Descr * base)", + "filename": "arrayobject.c", + "nloc": 20, + "complexity": 4, + "token_count": 151, + "parameters": [ + "base" + ], + "start_line": 7900, + "end_line": 7922, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_dealloc", + "long_name": "arraydescr_dealloc( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 2, + "token_count": 64, + "parameters": [ + "self" + ], + "start_line": 7928, + "end_line": 7938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_subdescr_get", + "long_name": "arraydescr_subdescr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 9, + "complexity": 2, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 7956, + "end_line": 7964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_protocol_typestr_get", + "long_name": "arraydescr_protocol_typestr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 3, + "token_count": 60, + "parameters": [ + "self" + ], + "start_line": 7967, + "end_line": 7979, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_protocol_descr_get", + "long_name": "arraydescr_protocol_descr_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 17, + "complexity": 5, + "token_count": 119, + "parameters": [ + "self" + ], + "start_line": 7982, + "end_line": 8001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_isbuiltin_get", + "long_name": "arraydescr_isbuiltin_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 8008, + "end_line": 8015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_isnative_get", + "long_name": "arraydescr_isnative_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 8018, + "end_line": 8025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_fields_get", + "long_name": "arraydescr_fields_get( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 8, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 8028, + "end_line": 8035, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_new", + "long_name": "arraydescr_new( PyTypeObject * subtype , PyObject * args , PyObject * kwds)", + "filename": "arrayobject.c", + "nloc": 47, + "complexity": 13, + "token_count": 251, + "parameters": [ + "subtype", + "args", + "kwds" + ], + "start_line": 8071, + "end_line": 8122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_reduce", + "long_name": "arraydescr_reduce( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 50, + "complexity": 12, + "token_count": 377, + "parameters": [ + "self", + "args" + ], + "start_line": 8128, + "end_line": 8185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 58, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_setstate", + "long_name": "arraydescr_setstate( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 35, + "complexity": 8, + "token_count": 260, + "parameters": [ + "self", + "args" + ], + "start_line": 8193, + "end_line": 8235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrNewByteorder", + "long_name": "PyArray_DescrNewByteorder( PyArray_Descr * self , char newendian)", + "filename": "arrayobject.c", + "nloc": 63, + "complexity": 16, + "token_count": 386, + "parameters": [ + "self", + "newendian" + ], + "start_line": 8255, + "end_line": 8321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_newbyteorder", + "long_name": "arraydescr_newbyteorder( PyArray_Descr * self , PyObject * args)", + "filename": "arrayobject.c", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "self", + "args" + ], + "start_line": 8332, + "end_line": 8340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_str", + "long_name": "arraydescr_str( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 42, + "complexity": 6, + "token_count": 281, + "parameters": [ + "self" + ], + "start_line": 8355, + "end_line": 8397, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_repr", + "long_name": "arraydescr_repr( PyArray_Descr * self)", + "filename": "arrayobject.c", + "nloc": 10, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 8400, + "end_line": 8409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "arraydescr_compare", + "long_name": "arraydescr_compare( PyArray_Descr * self , PyObject * other)", + "filename": "arrayobject.c", + "nloc": 11, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "other" + ], + "start_line": 8412, + "end_line": 8422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "array_fromobject", + "long_name": "array_fromobject( PyObject * op , PyArray_Descr * newtype , int min_depth , int max_depth , int flags)", + "filename": "arrayobject.c", + "nloc": 56, + "complexity": 17, + "token_count": 330, + "parameters": [ + "op", + "newtype", + "min_depth", + "max_depth", + "flags" + ], + "start_line": 5863, + "end_line": 5939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + } + ], + "nloc": 6711, + "complexity": 1419, + "token_count": 39396, + "diff_parsed": { + "added": [ + " /* This is the main code to make a NumPy array from a Python" + ], + "deleted": [ + " /* This is the main code to make a SciPy array from a Python" + ] + } + }, + { + "old_path": "numpy/core/src/multiarraymodule.c", + "new_path": "numpy/core/src/multiarraymodule.c", + "filename": "multiarraymodule.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -3734,7 +3734,7 @@ PyArray_DescrConverter2(PyObject *obj, PyArray_Descr **at)\n /* This function takes a Python object representing a type and converts it \n to a the correct PyArray_Descr * structure to describe the type.\n \n- Many objects can be used to represent a data-type which in SciPy is\n+ Many objects can be used to represent a data-type which in NumPy is\n quite a flexible concept. \n \n This is the central code that converts Python objects to \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "/*\n Python Multiarray Module -- A useful collection of functions for creating and\n using ndarrays\n\n Original file \n Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu\n\n Modified for numpy_core in 2005 \n\n Travis E. Oliphant\n Assistant Professor at\n Brigham Young University\n \n*/\n\n/* $Id: multiarraymodule.c,v 1.36 2005/09/14 00:14:00 teoliphant Exp $ */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n/*#include \n#include \n*/\n\n#define _MULTIARRAYMODULE\n#include \"numpy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL; /* Must be explicitly loaded */\nstatic PyObject *_numpy_internal=NULL; /* A Python module for callbacks */\n\n\nstatic PyArray_Descr *\n_arraydescr_fromobj(PyObject *obj)\n{\n\tPyObject *dtypedescr;\n\tPyArray_Descr *new;\n\tint ret;\n\t\n\tdtypedescr = PyObject_GetAttrString(obj, \"dtypedescr\");\n\tPyErr_Clear();\n\tif (dtypedescr) {\n\t\tret = PyArray_DescrConverter(dtypedescr, &new);\n\t\tPy_DECREF(dtypedescr);\n\t\tif (ret) return new;\n\t\tPyErr_Clear();\n\t}\n\treturn NULL;\n}\n\n\n/* Including this file is the only way I know how to declare functions\n static in each file, and store the pointers from functions in both\n arrayobject.c and multiarraymodule.c for the C-API \n\n Declarying an external pointer-containing variable in arrayobject.c\n and trying to copy it to PyArray_API, did not work.\n\n Think about two modules with a common api that import each other...\n\n This file would just be the module calls. \n*/\n\n#include \"arrayobject.c\"\n\n\n/* An Error object -- rarely used? */\nstatic PyObject *MultiArrayError;\n\n/*MULTIARRAY_API\n Multiply a List of ints\n*/\nstatic int\nPyArray_MultiplyIntList(register int *l1, register int n) \n{\n\tregister int s=1;\n while (n--) s *= (*l1++);\n return s;\n}\n\n/*MULTIARRAY_API\n Multiply a List\n*/\nstatic intp \nPyArray_MultiplyList(register intp *l1, register int n) \n{\n\tregister intp s=1;\n while (n--) s *= (*l1++);\n return s;\n}\n\n/*MULTIARRAY_API\n Produce a pointer into array\n*/\nstatic char *\nPyArray_GetPtr(PyArrayObject *obj, register intp* ind)\n{\n\tregister int n = obj->nd;\n\tregister intp *strides = obj->strides;\n\tregister char *dptr = obj->data;\n\t\n\twhile (n--) dptr += (*strides++) * (*ind++);\n\treturn dptr;\n}\n\n/*MULTIARRAY_API\n Get axis from an object (possibly None) -- a converter function,\n*/\nstatic int \nPyArray_AxisConverter(PyObject *obj, int *axis)\n{\n\tif (obj == Py_None) {\n\t\t*axis = MAX_DIMS;\n\t}\n\telse {\n\t\t*axis = (int) PyInt_AsLong(obj);\n\t\tif (PyErr_Occurred()) {\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n\treturn PY_SUCCEED;\n}\n\n/*MULTIARRAY_API\n Compare Lists\n*/\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n int i;\n for(i=0;idescr);\n\tnew = PyArray_NewFromDescr(self->ob_type,\n\t\t\t\t self->descr,\n\t\t\t\t self->nd, self->dimensions,\n\t\t\t\t self->strides,\n\t\t\t\t self->data,\n\t\t\t\t self->flags, (PyObject *)self);\n\t\n\tif (new==NULL) return NULL;\n\tPy_INCREF(self);\n PyArray_BASE(new) = (PyObject *)self;\n\t\n\tif (type != NULL) {\n\t\tif (PyObject_SetAttrString(new, \"dtypedescr\", \n\t\t\t\t\t (PyObject *)type) < 0) {\n\t\t\tPy_DECREF(new);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t\tPy_DECREF(type);\n\t}\n\treturn new;\t\n}\n\n/*MULTIARRAY_API\n Ravel\n*/\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(a);\n\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) {\n\t\tif (a->nd == 1) {\n\t\t\tPy_INCREF(a);\n\t\t\treturn (PyObject *)a;\n\t\t}\n\t\treturn PyArray_Newshape(a, &newdim);\n\t}\n\telse\n\t return PyArray_Flatten(a, fortran);\n}\n\n/*MULTIARRAY_API\n Flatten\n*/\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(a);\n\n\tsize = PyArray_SIZE(a);\n\tPy_INCREF(a->descr);\n\tret = PyArray_NewFromDescr(a->ob_type,\n\t\t\t\t a->descr,\n\t\t\t\t 1, &size,\n\t\t\t\t NULL,\n\t\t\t\t NULL,\n\t\t\t\t 0, (PyObject *)a);\n\t\n\tif (ret== NULL) return NULL;\n\tif (fortran) {\n\t\tnew = PyArray_Transpose(a, NULL);\n\t\tif (new == NULL) {\n\t\t\tPy_DECREF(ret);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\telse {\n\t\tPy_INCREF(a);\n\t\tnew = (PyObject *)a;\n\t}\n\tif (PyArray_CopyInto((PyArrayObject *)ret, (PyArrayObject *)new) < 0) {\n\t\tPy_DECREF(ret);\n\t\tPy_DECREF(new);\n\t\treturn NULL;\n\t}\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\n/* For back-ward compatability *\n\n/ * Not recommended */\n\n/*MULTIARRAY_API\n Reshape an array\n*/\nstatic PyObject *\nPyArray_Reshape(PyArrayObject *self, PyObject *shape) \n{\n PyObject *ret;\n PyArray_Dims newdims;\n\n if (!PyArray_IntpConverter(shape, &newdims)) return NULL;\n ret = PyArray_Newshape(self, &newdims);\n PyDimMem_FREE(newdims.ptr);\n return ret;\n}\n\nstatic int\n_check_ones(PyArrayObject *self, int newnd, intp* newdims, intp *strides)\n{\n\tint nd;\n\tintp *dims;\n\tBool done=FALSE;\n\tint j, k;\n\n\tnd = self->nd;\n\tdims = self->dimensions;\n\n\tfor (k=0, j=0; !done && (jstrides[j];\n\t\t\tj++; k++;\n\t\t}\n\t\telse if ((kptr;\n PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n Bool same;\n\tintp *strides = NULL;\n\tintp newstrides[MAX_DIMS];\n\n /* Quick check to make sure anything needs to be done */\n if (n == self->nd) {\n same = TRUE;\n i=0;\n while(same && i= 0) {\n\t\t\tif ((s_known == 0) || (s_original % s_known != 0)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tdimensions[i_unknown] = s_original/s_known;\n\t\t} else {\n\t\t\tif (s_original != s_known) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}\n \n\tPy_INCREF(self->descr);\n\tret = (PyAO *)PyArray_NewFromDescr(self->ob_type,\n\t\t\t\t\t self->descr,\n\t\t\t\t\t n, dimensions,\n\t\t\t\t\t strides,\n\t\t\t\t\t self->data,\n\t\t\t\t\t self->flags, (PyObject *)self);\n\t\n\tif (ret== NULL) return NULL;\n\t\n Py_INCREF(self);\n ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n return (PyObject *)ret;\n}\n\n/* return a new view of the array object with all of its unit-length \n dimensions squeezed out if needed, otherwise\n return the same array.\n */\n\n/*MULTIARRAY_API*/\nstatic PyObject *\nPyArray_Squeeze(PyArrayObject *self)\n{\n\tint nd = self->nd;\n\tint newnd = nd;\n\tintp dimensions[MAX_DIMS];\n\tintp strides[MAX_DIMS];\n\tint i,j;\n\tPyObject *ret;\n\n\tif (nd == 0) {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *)self;\n\t}\n\tfor (j=0, i=0; idimensions[i] == 1) {\n\t\t\tnewnd -= 1;\n\t\t}\n\t\telse {\n\t\t\tdimensions[j] = self->dimensions[i];\n\t\t\tstrides[j++] = self->strides[i];\n\t\t}\n\t}\n\t\n\tPy_INCREF(self->descr);\n\tret = PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t self->descr,\n\t\t\t\t newnd, dimensions, \n\t\t\t\t strides, self->data, \n\t\t\t\t self->flags,\n\t\t\t\t (PyObject *)self);\n\tif (ret == NULL) return NULL;\n\tPyArray_FLAGS(ret) &= ~OWN_DATA;\n\tPyArray_BASE(ret) = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\n\n/*MULTIARRAY_API\n Mean\n*/\nstatic PyObject *\nPyArray_Mean(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *obj1=NULL, *obj2=NULL;\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tobj1 = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t rtype);\n\tobj2 = PyFloat_FromDouble((double) PyArray_DIM(new,axis));\n Py_DECREF(new);\n\tif (obj1 == NULL || obj2 == NULL) {\n\t\tPy_XDECREF(obj1);\n\t\tPy_XDECREF(obj2);\n\t\treturn NULL;\n\t}\n\n\tret = PyNumber_Divide(obj1, obj2);\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\treturn ret;\n}\n\n/* Set variance to 1 to by-pass square-root calculation and return variance */\n/*MULTIARRAY_API\n Std\n*/\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype, int variance)\n{\n\tPyObject *obj1=NULL, *obj2=NULL, *new=NULL;\n\tPyObject *ret=NULL, *newshape=NULL;\n\tint i, n;\n\tintp val;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\t\n\t/* Compute and reshape mean */\n\tobj1 = PyArray_EnsureArray(PyArray_Mean((PyAO *)new, axis, rtype));\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;} \n\tn = PyArray_NDIM(new);\n\tnewshape = PyTuple_New(n);\n\tif (newshape == NULL) {Py_DECREF(obj1); Py_DECREF(new); return NULL;}\n\tfor (i=0; ind != 1) {\n Py_DECREF(cond);\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"condition must be 1-d array\");\n return NULL;\n }\n\n res = PyArray_Nonzero(cond);\n Py_DECREF(cond);\n\tret = PyArray_Take(self, res, axis);\n\tPy_DECREF(res);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Nonzero\n*/\nstatic PyObject *\nPyArray_Nonzero(PyArrayObject *self)\n{\n int n=self->nd, j;\n\tintp count=0, i, size;\n\tPyArrayIterObject *it=NULL;\n\tPyObject *ret=NULL, *item;\n\tintp *dptr[MAX_DIMS];\n\n\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\tif (it==NULL) return NULL;\n\n\tsize = it->size;\n\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) count++;\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\n\tPyArray_ITER_RESET(it);\n\tif (n==1) {\n\t\tret = PyArray_New(self->ob_type, 1, &count, PyArray_INTP, \n\t\t\t\t NULL, NULL, 0, 0, (PyObject *)self);\n\t\tif (ret == NULL) goto fail;\n\t\tdptr[0] = (intp *)PyArray_DATA(ret);\n\t\t\n\t\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) \n\t\t\t\t*(dptr[0])++ = i;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\t\t\n\t}\n\telse {\n\t\tret = PyTuple_New(n);\n\t\tfor (j=0; job_type, 1, &count, \n\t\t\t\t\t PyArray_INTP, NULL, NULL, 0, 0,\n\t\t\t\t\t (PyObject *)self);\n\t\t\tif (item == NULL) goto fail;\n\t\t\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tdptr[j] = (intp *)PyArray_DATA(item);\n\t\t}\n\t\t\n\t\t/* reset contiguous so that coordinates gets updated */\n\t\tit->contiguous = 0;\n\t\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; jcoordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\tPy_DECREF(it);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n \n}\n\n/*MULTIARRAY_API\n Clip\n*/\nstatic PyObject *\nPyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max)\n{\n\tPyObject *selector=NULL, *newtup=NULL, *ret=NULL;\n\tPyObject *res1=NULL, *res2=NULL, *res3=NULL;\n\tPyObject *two;\n\n\ttwo = PyInt_FromLong((long)2);\n\tres1 = PyArray_GenericBinaryFunction(self, max, n_ops.greater);\n\tres2 = PyArray_GenericBinaryFunction(self, min, n_ops.less);\n\tif ((res1 == NULL) || (res2 == NULL)) {\n\t\tPy_DECREF(two);\n\t\tPy_XDECREF(res1);\n\t\tPy_XDECREF(res2);\n\t}\n\tres3 = PyNumber_Multiply(two, res1);\n\tPy_DECREF(two); \n\tPy_DECREF(res1); \n\tif (res3 == NULL) return NULL;\n\n\tselector = PyArray_EnsureArray(PyNumber_Add(res2, res3));\n\tPy_DECREF(res2);\n\tPy_DECREF(res3);\n\tif (selector == NULL) return NULL;\n\n\tnewtup = Py_BuildValue(\"(OOO)\", (PyObject *)self, min, max);\n\tif (newtup == NULL) {Py_DECREF(selector); return NULL;}\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Conjugate\n*/\nstatic PyObject *\nPyArray_Conjugate(PyArrayObject *self)\n{\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tPyObject *new;\n\t\tintp size, i;\n\t\t/* Make a copy */\n\t\tnew = PyArray_NewCopy(self, -1);\n\t\tif (new==NULL) return NULL;\n\t\tsize = PyArray_SIZE(new);\n\t\tif (self->descr->type_num == PyArray_CFLOAT) {\n\t\t\tcfloat *dptr = (cfloat *) PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\n\t\t}\n\t\telse if (self->descr->type_num == PyArray_CDOUBLE) {\n\t\t\tcdouble *dptr = (cdouble *)PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\n\t\t}\n\t\telse if (self->descr->type_num == PyArray_CLONGDOUBLE) {\n\t\t\tclongdouble *dptr = (clongdouble *)PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn new;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *) self;\n\t}\n}\n\n/*MULTIARRAY_API\n Trace\n*/\nstatic PyObject *\nPyArray_Trace(PyArrayObject *self, int offset, int axis1, int axis2, \nint rtype)\n{\n\tPyObject *diag=NULL, *ret=NULL;\n\n\tdiag = PyArray_Diagonal(self, offset, axis1, axis2);\n\tif (diag == NULL) return NULL;\n\tret = PyArray_GenericReduceFunction((PyAO *)diag, n_ops.add, -1, rtype);\n\tPy_DECREF(diag);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Diagonal\n*/\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyArray_Dims newaxes;\n\tintp dims[MAX_DIMS];\n\tint i, pos;\t\n\n\tnewaxes.ptr = dims;\n\tif (n < 2) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"array.ndim must be >= 2\");\n\t\treturn NULL;\n\t}\n\tif (axis1 < 0) axis1 += n;\n\tif (axis2 < 0) axis2 += n;\n\tif ((axis1 == axis2) || (axis1 < 0) || (axis1 >= n) ||\t\\\n\t (axis2 < 0) || (axis2 >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \"axis1(=%d) and axis2(=%d) \"\\\n\t\t\t \"must be different and within range (nd=%d)\",\n\t\t\t axis1, axis2, n);\n\t\treturn NULL;\n\t}\n \n\tnewaxes.len = n;\n\t/* insert at the end */\n\tnewaxes.ptr[n-2] = axis1;\n\tnewaxes.ptr[n-1] = axis2;\n\tpos = 0;\n\tfor (i=0; idimensions[0];\n\t\tn2 = self->dimensions[1];\n\t\tstep = n2+1;\n\t\tif (offset < 0) {\n\t\t\tstart = -n2 * offset;\n\t\t\tstop = MIN(n2, n1+offset)*(n2+1) - n2*offset;\n\t\t}\n\t\telse {\n\t\t\tstart = offset;\n\t\t\tstop = MIN(n1, n2-offset)*(n2+1) + offset;\n\t\t}\n\t\t\n\t\t/* count = ceil((stop-start)/step) */\n\t\tcount = ((stop-start) / step) + (((stop-start) % step) != 0);\n\t\t\t\n\t\tindices = PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t PyArray_INTP, NULL, NULL, 0, 0, NULL);\n\t\tif (indices == NULL) {\n\t\t\tPy_DECREF(self); return NULL;\n\t\t}\n\t\tdptr = (intp *)PyArray_DATA(indices);\n\t\tfor (n1=start; n1descr;\n\n\t\tmydiagonal = PyList_New(0);\n\t\tif (mydiagonal == NULL) {Py_DECREF(self); return NULL;}\n\t\tn1 = self->dimensions[0];\n\t\tfor (i=0; i 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"C arrays of only 1-3 dimensions available\");\n\t\tPy_XDECREF(typedescr);\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, typedescr, nd, nd,\n\t\t\t\t\t\t CARRAY_FLAGS)) == NULL)\n\t\treturn -1;\n\tswitch(nd) {\n\tcase 1:\n\t\t*((char **)ptr) = ap->data;\n\t\tbreak;\n\tcase 2:\n\t\tn = ap->dimensions[0];\n\t\tptr2 = (char **)_pya_malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; idata + i*ap->strides[0];\n\t\t}\n\t\t*((char ***)ptr) = ptr2;\n\t\tbreak;\t\t\n\tcase 3:\n\t\tn = ap->dimensions[0];\n\t\tm = ap->dimensions[1];\n\t\tptr3 = (char ***)_pya_malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; idata + i*ap->strides[0] + \\\n\t\t\t\t\tj*ap->strides[1];\n\t\t\t}\n\t\t}\n\t\t*((char ****)ptr) = ptr3;\n\t}\n\tmemcpy(dims, ap->dimensions, nd*sizeof(intp));\n\t*op = (PyObject *)ap;\n\treturn 0;\n\n fail:\n\tPyErr_SetString(PyExc_MemoryError, \"no memory\");\n\treturn -1;\n}\n\n/* Deprecated --- Use PyArray_AsCArray instead */\n\n/*MULTIARRAY_API\n Convert to a 1D C-array\n*/\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(typecode);\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, descr) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n/*MULTIARRAY_API\n Convert to a 2D C-array\n*/\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(typecode);\t\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, descr) == -1)\n\t\treturn -1;\n\n\t*d1 = (int ) newdims[0];\n\t*d2 = (int ) newdims[1];\n return 0;\n}\n\n/* End Deprecated */\n\n/*MULTIARRAY_API\n Free pointers created if As2D is called\n*/\nstatic int \nPyArray_Free(PyObject *op, void *ptr) \n{\n PyArrayObject *ap = (PyArrayObject *)op;\n\t\n if ((ap->nd < 1) || (ap->nd > 3)) \n\t\treturn -1;\n if (ap->nd >= 2) {\n\t\t_pya_free(ptr);\n }\n Py_DECREF(ap);\n return 0;\n}\n\n\nstatic PyObject *\n_swap_and_concat(PyObject *op, int axis, int n)\n{\n\tPyObject *newtup=NULL;\n\tPyObject *otmp, *arr;\n\tint i;\n\n\tnewtup = PyTuple_New(n);\n\tif (newtup==NULL) return NULL;\n\tfor (i=0; i= MAX_DIMS) {\n\t\t\totmp = PyArray_Ravel(mps[i],0);\n\t\t\tPy_DECREF(mps[i]);\n\t\t\tmps[i] = (PyArrayObject *)otmp;\n\t\t}\n\t\tprior2 = PyArray_GetPriority((PyObject *)(mps[i]), 0.0);\n\t\tif (prior2 > prior1) {\n\t\t\tprior1 = prior2;\n\t\t\tsubtype = mps[i]->ob_type;\n\t\t\tret = mps[i];\n\t\t}\n\t}\n\t\n\tnew_dim = 0;\n\tfor(i=0; ind;\n\t\telse {\n\t\t\tif (nd != mps[i]->nd) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"arrays must have same \"\\\n\t\t\t\t\t\t\"number of dimensions\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tif (!PyArray_CompareLists(mps[0]->dimensions+1, \n\t\t\t\t\t\t mps[i]->dimensions+1, \n\t\t\t\t\t\t nd-1)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"array dimensions must \"\\\n\t\t\t\t\t\t\"agree except for d_0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t}\n\t\tif (nd == 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"0-d arrays can't be concatenated\");\n\t\t\tgoto fail;\n\t\t}\n\t\tnew_dim += mps[i]->dimensions[0];\n\t}\n\t\n\ttmp = mps[0]->dimensions[0];\n\tmps[0]->dimensions[0] = new_dim;\n\tPy_INCREF(mps[0]->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(subtype, \n\t\t\t\t\t\t mps[0]->descr, nd,\n\t\t\t\t\t\t mps[0]->dimensions, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)ret);\n\tmps[0]->dimensions[0] = tmp;\n\t\n\tif (ret == NULL) goto fail;\n\t\n\tdata = ret->data;\n\tfor(i=0; idata, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; ind;\n\tif (n <= 1) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\n\tif (a1 < 0) a1 += n;\n\tif (a2 < 0) a2 += n;\n\tif ((a1 < 0) || (a1 >= n)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"bad axis1 argument to swapaxes\");\n\t\treturn NULL;\n\t}\n\tif ((a2 < 0) || (a2 >= n)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"bad axis2 argument to swapaxes\");\n\t\treturn NULL;\n\t}\n\tnew_axes.ptr = dims;\n\tnew_axes.len = n;\n\n\tfor (i=0; ind;\n\t\tfor(i=0; ilen;\n\t\taxes = permute->ptr;\n\t\tif (n > ap->nd) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"too many axes for this array\");\n\t\t\treturn NULL;\n\t\t}\n\t\tfor(i=0; ind+axis;\n\t\t\tif (axis < 0 || axis >= ap->nd) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"invalid axis for this array\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tpermutation[i] = axis;\n\t\t}\n\t}\n\t\n\t/* this allocates memory for dimensions and strides (but fills them\n\t incorrectly), sets up descr, and points data at ap->data. */\n\tPy_INCREF(ap->descr);\n\tret = (PyArrayObject *)\\\n\t\tPyArray_NewFromDescr(ap->ob_type, \n\t\t\t\t ap->descr, \n\t\t\t\t n, permutation, \n\t\t\t\t NULL, ap->data, ap->flags,\n\t\t\t\t (PyObject *)ap);\n\tif (ret == NULL) return NULL;\n\t\n\t/* point at true owner of memory: */\n\tret->base = (PyObject *)ap;\n\tPy_INCREF(ap);\n\t\n\tfor(i=0; idimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\t\n\n\treturn (PyObject *)ret;\t\n}\n\n/*MULTIARRAY_API\n Repeat the array.\n*/\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis)\n{\n\tintp *counts;\n\tintp n, n_outer, i, j, k, chunk, total;\n\tintp tmp;\n\tint nd;\n\tPyArrayObject *repeats=NULL;\n\tPyObject *ap=NULL;\n\tPyArrayObject *ret=NULL;\n\tchar *new_data, *old_data;\n\n\trepeats = (PyAO *)PyArray_ContiguousFromAny(op, PyArray_INTP, 0, 1);\n\tif (repeats == NULL) return NULL;\n\tnd = repeats->nd;\n\tcounts = (intp *)repeats->data;\n\n\tif ((ap=_check_axis(aop, &axis, CARRAY_FLAGS))==NULL) {\n\t\tPy_DECREF(repeats);\n\t\treturn NULL;\n\t}\n\n\taop = (PyAO *)ap;\n\n\tif (nd == 1)\n\t\tn = repeats->dimensions[0];\n\telse /* nd == 0 */\n\t\tn = aop->dimensions[axis];\n\n\tif (aop->dimensions[axis] != n) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"a.shape[axis] != len(repeats)\");\n\t\tgoto fail;\n\t}\n\n\t\n\tif (nd == 0) \n\t\ttotal = counts[0]*n;\n\telse {\n\t\t\n\t\ttotal = 0;\n\t\tfor(j=0; jdimensions[axis] = total;\n\tPy_INCREF(aop->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(aop->ob_type, \n\t\t\t\t\t\t aop->descr,\n\t\t\t\t\t\t aop->nd,\n\t\t\t\t\t\t aop->dimensions,\n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)aop);\n\taop->dimensions[axis] = n;\n\t\n\tif (ret == NULL) goto fail;\n\t\n\tnew_data = ret->data;\n\told_data = aop->data;\n\t\n\tchunk = aop->descr->elsize;\n\tfor(i=axis+1; ind; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; idimensions[i];\n\n\tfor(i=0; ind < mps[i]->nd) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"too many dimensions\");\n\t\t\tgoto fail;\n\t\t}\n\t\tif (!PyArray_CompareLists(ap->dimensions+(ap->nd-mps[i]->nd),\n\t\t\t\t mps[i]->dimensions, mps[i]->nd)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"array dimensions must agree\");\n\t\t\tgoto fail;\n\t\t}\n\t\tsizes[i] = PyArray_NBYTES(mps[i]);\n\t}\n\t\n\tPy_INCREF(mps[0]->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(ap->ob_type, \n\t\t\t\t\t\t mps[0]->descr,\n\t\t\t\t\t\t ap->nd,\n\t\t\t\t\t\t ap->dimensions, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->descr->elsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i= n) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid entry in choice array\");\n\t\t\tgoto fail;\n\t\t}\n\t\toffset = i*elsize;\n\t\tif (offset >= sizes[mi]) {offset = offset % sizes[mi]; }\n\t\tmemmove(ret_data, mps[mi]->data+offset, elsize);\n\t\tret_data += elsize; self_data++;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; idescr->f->sort[which];\n\tsize = it->size;\n\tN = op->dimensions[axis];\n\telsize = op->descr->elsize;\n\tastride = op->strides[axis];\n\n\tneedcopy = !(op->flags & ALIGNED) || (astride != (intp) elsize);\n\n\tif (needcopy) {\n\t\tchar *buffer;\n\t\tbuffer = PyDataMem_NEW(N*elsize);\n\t\twhile (size--) {\n\t\t\t_strided_copy(buffer, (intp) elsize, it->dataptr, \n\t\t\t\t astride, N, elsize);\n\t\t\tif (sort(buffer, N, op) < 0) {\n\t\t\t\tPyDataMem_FREE(buffer); goto fail;\n\t\t\t}\n\t\t\t_strided_copy(it->dataptr, astride, buffer, \n\t\t\t\t (intp) elsize, N, elsize);\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t\tPyDataMem_FREE(buffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tif (sort(it->dataptr, N, op) < 0) goto fail;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\t\n\t\n\tEND_THREADS\n\t\n\tPy_DECREF(it);\n\treturn 0;\n\n fail:\n\tEND_THREADS\n\n\tPy_DECREF(it);\n\treturn 0;\n}\n\nstatic PyObject*\n_new_argsort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\n\tPyArrayIterObject *it=NULL;\n\tPyArrayIterObject *rit=NULL;\n\tPyObject *ret;\n\tint needcopy=0, i;\n\tintp N, size;\n\tint elsize;\n\tintp astride, rstride, *iptr;\n\tPyArray_ArgSortFunc *argsort;\n\tBEGIN_THREADS_DEF \n\n\tret = PyArray_New(op->ob_type, op->nd,\n\t\t\t op->dimensions, PyArray_INTP,\n\t\t\t NULL, NULL, 0, 0, (PyObject *)op);\n\tif (ret == NULL) return NULL;\n\n\tit = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, axis);\n\trit = (PyArrayIterObject *)PyArray_IterAllButAxis(ret, axis);\n\tif (rit == NULL || it == NULL) goto fail;\n\n\tBEGIN_THREADS\n\n\targsort = op->descr->f->argsort[which];\n\tsize = it->size;\n\tN = op->dimensions[axis];\n\telsize = op->descr->elsize;\n\tastride = op->strides[axis];\n\trstride = PyArray_STRIDE(ret,axis);\n\n\tneedcopy = !(op->flags & ALIGNED) || (astride != (intp) elsize) || \\\n\t\t(rstride != sizeof(intp));\n\t\n\tif (needcopy) {\n\t\tchar *valbuffer, *indbuffer;\n\t\tvalbuffer = PyDataMem_NEW(N*(elsize+sizeof(intp)));\n\t\tindbuffer = valbuffer + (N*elsize);\n\t\twhile (size--) {\n\t\t\t_strided_copy(valbuffer, (intp) elsize, it->dataptr,\n\t\t\t\t astride, N, elsize);\n\t\t\tiptr = (intp *)indbuffer;\n\t\t\tfor (i=0; idataptr, rstride, indbuffer, \n\t\t\t\t sizeof(intp), N, sizeof(intp));\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t\tPyDataMem_FREE(valbuffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)rit->dataptr;\n\t\t\tfor (i=0; idataptr, (intp *)rit->dataptr, \n\t\t\t\t N, op) < 0) goto fail;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t}\n\t\n\tEND_THREADS\n\n\tPy_DECREF(it);\n\tPy_DECREF(rit);\n\treturn ret;\n\n fail:\n\n\tEND_THREADS\n\n\tPy_DECREF(ret);\n\tPy_XDECREF(it);\n\tPy_XDECREF(rit);\n\treturn NULL;\n}\n\n\n/* Be sure to save this global_compare when necessary */\n\nstatic PyArrayObject *global_obj;\n\nstatic int \nqsortCompare (const void *a, const void *b) \n{\n\treturn global_obj->descr->f->compare(a,b,global_obj);\n}\n\n/* Consumes reference to ap (op gets it)\n op contains a version of the array with axes swapped if\n local variable axis is not the last dimension.\n orign must be defined locally. \n*/\n\n#define SWAPAXES(op, ap) {\t\t\t\t\t\t\\\n\t\torign = (ap)->nd-1;\t\t\t\t\t\\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\t(op) = (PyAO *)PyArray_SwapAxes((ap), axis, orign); \\\n\t\t\tPy_DECREF((ap));\t\t\t\t\\\n\t\t\tif ((op) == NULL) return NULL;\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse (op) = (ap);\t\t\t\t\t\\\n\t}\n\n/* Consumes reference to ap (op gets it)\n origin must be previously defined locally. \n SWAPAXES must have been called previously. \n op contains the swapped version of the array. \n*/\n#define SWAPBACK(op, ap) {\t \\\n\t\tif (axis != orign) { \\\n\t\t\t(op) = (PyAO *)PyArray_SwapAxes((ap), axis, orign); \\\n\t\t\tPy_DECREF((ap));\t\t\t\t\\\n\t\t\tif ((op) == NULL) return NULL;\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse (op) = (ap);\t\t\t\t\t\\\n\t}\n\n/* These swap axes in-place if necessary */\n#define SWAPINTP(a,b) {intp c; c=(a); (a) = (b); (b) = c;}\n#define SWAPAXES2(ap) {\t\t\t\t\t\t\\\n\t\torign = (ap)->nd-1;\t\t\t\t\t\\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\tSWAPINTP(ap->dimensions[axis], ap->dimensions[orign]); \\\n\t\t\tSWAPINTP(ap->strides[axis], ap->strides[orign]); \\\n\t\t\tPyArray_UpdateFlags(ap, CONTIGUOUS | FORTRAN); \\\n\t\t}\t\t\t\t\t\t \\\n\t}\n\n#define SWAPBACK2(ap) {\t\t \\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\tSWAPINTP(ap->dimensions[axis], ap->dimensions[orign]); \\\n\t\t\tSWAPINTP(ap->strides[axis], ap->strides[orign]); \\\n\t\t\tPyArray_UpdateFlags(ap, CONTIGUOUS | FORTRAN);\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\n\n/*MULTIARRAY_API\n Sort an array in-place\n*/\nstatic int\nPyArray_Sort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tn = op->nd;\n\tif ((n==0) || (PyArray_SIZE(op)==1)) return 0;\n\n\tif (axis < 0) axis += n;\n\tif ((axis < 0) || (axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\treturn -1;\n\t}\n\tif (!PyArray_ISWRITEABLE(op)) {\n\t\tPyErr_SetString(PyExc_RuntimeError, \n\t\t\t\t\"attempted sort on unwriteable array.\");\n\t\treturn -1;\n\t}\n\n\t/* Determine if we should use type-specific algorithm or not */\n\tif (op->descr->f->sort[which] != NULL) {\n\t\treturn _new_sort(op, axis, which);\n\t}\n\n\tif ((which != PyArray_QUICKSORT) || \\\n\t op->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"desired sort not supported for this type\");\n\t\treturn -1;\n\t}\n\n\tSWAPAXES2(op);\n\n ap = (PyArrayObject *)PyArray_FromAny((PyObject *)op, \n\t\t\t\t\t NULL, 1, 0, \n\t\t\t\t\t DEFAULT_FLAGS | UPDATEIFCOPY);\t\n\tif (ap == NULL) goto fail;\n\t\n\telsize = ap->descr->elsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\n\t/* Store global -- allows re-entry -- restore before leaving*/\n\tstore_arr = global_obj; \n\tglobal_obj = ap;\n\t\n\tfor (ip=ap->data, i=0; idescr->elsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->f->compare(global_data + (isize * *ipa),\n global_data + (isize * *ipb), \n\t\t\t\t\t global_obj);\n}\n\n/*MULTIARRAY_API\n ArgSort an array\n*/\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\tPyArrayObject *ap=NULL, *ret=NULL, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tn = op->nd;\n\tif ((n==0) || (PyArray_SIZE(op)==1)) {\n\t\tret = (PyArrayObject *)PyArray_New(op->ob_type, op->nd,\n\t\t\t\t\t\t op->dimensions, \n\t\t\t\t\t\t PyArray_INTP,\n\t\t\t\t\t\t NULL, NULL, 0, 0, \n\t\t\t\t\t\t (PyObject *)op);\n\t\tif (ret == NULL) return NULL;\n\t\t*((intp *)ret->data) = 0;\n\t\treturn (PyObject *)ret;\n\t}\n\tif (axis < 0) axis += n;\n\tif ((axis < 0) || (axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\treturn NULL;\n\t}\n\n\t/* Determine if we should use new algorithm or not */\n\tif (op->descr->f->argsort[which] != NULL) {\n\t\treturn _new_argsort(op, axis, which);\n\t}\n\n\tif ((which != PyArray_QUICKSORT) || op->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"requested sort not available for type\");\n\t\tgoto fail;\n\t}\n\n\tSWAPAXES(ap, op);\n\n\top = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ap, \n\t\t\t\t\t\t\t PyArray_NOTYPE,\n\t\t\t\t\t\t\t 1, 0);\n\n\tif (op == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(op->ob_type, op->nd,\n\t\t\t\t\t op->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, (PyObject *)op);\n\tif (ret == NULL) goto fail;\n\t\n\t\n\tip = (intp *)ret->data;\n\targsort_elsize = op->descr->elsize;\n\tm = op->dimensions[op->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(op)/m;\n\tstore_ptr = global_data;\n\tglobal_data = op->data;\n\tstore = global_obj;\n\tglobal_obj = op;\n\tfor (i=0; i 0 in lexsort\");\n\t\treturn NULL;\n\t}\n\tmps = (PyArrayObject **) _pya_malloc(n*sizeof(PyArrayObject));\n\tif (mps==NULL) return PyErr_NoMemory();\n\tits = (PyArrayIterObject **) _pya_malloc(n*sizeof(PyArrayIterObject));\n\tif (its == NULL) {_pya_free(mps); return PyErr_NoMemory();}\n\tfor (i=0; i0) {\n\t\t\tif ((mps[i]->nd != mps[0]->nd) ||\t\\\n\t\t\t (!PyArray_CompareLists(mps[i]->dimensions,\n\t\t\t\t\t\t mps[0]->dimensions,\n\t\t\t\t\t\t mps[0]->nd))) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"all keys need to be the same shape\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t}\n\t\tif (!mps[i]->descr->f->argsort[PyArray_MERGESORT]) {\n\t\t\tPyErr_Format(PyExc_TypeError, \n\t\t\t\t \"merge sort not available for item %d\", i);\n\t\t\tgoto fail;\n\t\t}\n\t\tits[i] = (PyArrayIterObject *)PyArray_IterAllButAxis\t\\\n\t\t\t((PyObject *)mps[i], axis);\n\t\tif (its[i]==NULL) goto fail;\n\t}\n\n\t/* Now we can check the axis */\n\tnd = mps[0]->nd;\n\tif ((nd==0) || (PyArray_SIZE(mps[0])==1)) {\n\t\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, mps[0]->nd,\n\t\t\t\t\t\t mps[0]->dimensions, \n\t\t\t\t\t\t PyArray_INTP,\n\t\t\t\t\t\t NULL, NULL, 0, 0, NULL);\n\t\tif (ret == NULL) return NULL;\n\t\t*((intp *)(ret->data)) = 0;\n\t\treturn (PyObject *)ret;\n\t}\n\tif (axis < 0) axis += nd;\n\tif ((axis < 0) || (axis >= nd)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\tgoto fail;\n\t}\n\n\t/* Now do the sorting */\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, mps[0]->nd,\n\t\t\t\t\t mps[0]->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, NULL);\n\tif (ret == NULL) goto fail;\n\n\trit = (PyArrayIterObject *)\\\n\t\tPyArray_IterAllButAxis((PyObject *)ret, axis);\n\tif (rit == NULL) goto fail;\n\n\tsize = rit->size;\n\tN = mps[0]->dimensions[axis];\n\trstride = PyArray_STRIDE(ret,axis);\n\n maxelsize = mps[0]->descr->elsize;\n\tneedcopy = (rstride != sizeof(intp));\n\tfor (j=0; jflags & ALIGNED) || \\\n\t\t\t(mps[j]->strides[axis] != (intp)mps[j]->descr->elsize);\n if (mps[j]->descr->elsize > maxelsize) \n maxelsize = mps[j]->descr->elsize;\n\t}\n\n\tif (needcopy) {\n\t\tchar *valbuffer, *indbuffer;\n\t\tvalbuffer = PyDataMem_NEW(N*(maxelsize+sizeof(intp)));\n\t\tindbuffer = valbuffer + (N*maxelsize);\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)indbuffer;\n\t\t\tfor (i=0; idescr->elsize;\n\t\t\t\tastride = mps[j]->strides[axis];\t\n\t\t\t\targsort = mps[j]->descr->f->argsort[PyArray_MERGESORT];\n\t\t\t\t_strided_copy(valbuffer, (intp) elsize, its[j]->dataptr,\n\t\t\t\t\t astride, N, elsize);\n\t\t\t\tif (argsort(valbuffer, (intp *)indbuffer, N, mps[j]) < 0) {\n\t\t\t\t\tPyDataMem_FREE(valbuffer); goto fail;\n\t\t\t\t}\n\t\t\t\tPyArray_ITER_NEXT(its[j]);\n\t\t\t}\n\t\t\t_strided_copy(rit->dataptr, rstride, indbuffer,\n\t\t\t\t sizeof(intp), N, sizeof(intp));\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t\tPyDataMem_FREE(valbuffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)rit->dataptr;\n\t\t\tfor (i=0; idescr->f->argsort[PyArray_MERGESORT];\n\t\t\t\tif (argsort(its[j]->dataptr, (intp *)rit->dataptr,\n\t\t\t\t\t N, mps[j]) < 0) goto fail;\n\t\t\t\tPyArray_ITER_NEXT(its[j]);\n\t\t\t}\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t}\n\n\tfor (i=0; idescr->f->compare;\n\tintp min_i, max_i, i, j;\n\tint location, elsize = ap1->descr->elsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_SIZE(ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j 0) {\n\t\t\t\t\tif (compare(ip, vp+elsize*(--i), ap2) \\\n\t\t\t\t\t != 0) {\n\t\t\t\t\t\ti = i+1; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmin_i = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (location < 0) {\n\t\t\t\tmax_i = i;\n\t\t\t} else {\n\t\t\t\tmin_i = i+1;\n\t\t\t}\n\t\t}\n\t\t*rp = min_i;\n\t}\n}\n\n/*MULTIARRAY_API\n Numeric.searchsorted(a,v)\n*/\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL;\n\tint typenum = 0;\n\n\t/* \n PyObject *args;\n args = Py_BuildValue(\"O\",op2);\n\tPy_DELEGATE_ARGS(((PyObject *)op1), searchsorted, args);\n Py_XDECREF(args);\n\t*/\n\n\ttypenum = PyArray_ObjectType((PyObject *)op1, 0);\n\ttypenum = PyArray_ObjectType(op2, typenum);\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1, \n\t\t\t\t\t\t\t typenum, \n\t\t\t\t\t\t\t 1, 1);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap2 == NULL) goto fail;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap2->ob_type, ap2->nd, \n\t\t\t\t\t ap2->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, (PyObject *)ap2);\n\tif (ret == NULL) goto fail;\n\n\tif (ap2->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tgoto fail;\n\t}\n\t\n\tlocal_where(ap1, ap2, ret); \n\t\n\tPy_DECREF(ap1);\n\tPy_DECREF(ap2);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ap1);\n\tPy_XDECREF(ap2);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\n\n/* Could perhaps be redone to not make contiguous arrays \n */\n\n/*MULTIARRAY_API\n Numeric.innerproduct(a,v)\n*/\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret=NULL;\n\tintp i, j, l, i1, i2, n1, n2;\n\tint typenum;\n\tintp is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tintp dimensions[MAX_DIMS], nd;\n\tPyArray_DotFunc *dot;\n\tPyTypeObject *subtype;\n double prior1, prior2;\n\t\n\ttypenum = PyArray_ObjectType(op1, 0); \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\t\t\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny(op1, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap2 == NULL) goto fail;\n\t\n\tif (ap1->nd == 0 || ap2->nd == 0) {\n\t\tret = (ap1->nd == 0 ? ap1 : ap2);\n\t\tret = (PyArrayObject *)ret->ob_type->tp_as_number->\\\n\t\t\tnb_multiply((PyObject *)ap1, (PyObject *)ap2);\n\t\tPy_DECREF(ap1);\n\t\tPy_DECREF(ap2);\n\t\treturn (PyObject *)ret;\n\t}\n\t\n\tl = ap1->dimensions[ap1->nd-1];\n\t\n\tif (ap2->dimensions[ap2->nd-1] != l) {\n\t\tPyErr_SetString(PyExc_ValueError, \"matrices are not aligned\");\n\t\tgoto fail;\n\t}\n\t\n\tif (l == 0) n1 = n2 = 0;\n\telse {\n\t\tn1 = PyArray_SIZE(ap1)/l;\n\t\tn2 = PyArray_SIZE(ap2)/l;\n\t}\n\n\tnd = ap1->nd+ap2->nd-2;\n\tj = 0;\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap2->dimensions[i];\n\t}\n\n\n\t/* Need to choose an output array that can hold a sum \n\t -- use priority to determine which subtype.\n\t */\n prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0);\n prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0);\n subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type);\n \n\tret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, \n\t\t\t\t\t typenum, NULL, NULL, 0, 0, \n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\n\tdot = (ret->descr->f->dotfunc);\n\t\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"dot not available for this type\");\n\t\tgoto fail;\n\t}\n\n\t\n\tis1 = ap1->strides[ap1->nd-1]; \n\tis2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->descr->elsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1data;\n\t\tfor(i2=0; i2nd == 0 || ap2->nd == 0) {\n\t\tret = (ap1->nd == 0 ? ap1 : ap2);\n\t\tret = (PyArrayObject *)ret->ob_type->tp_as_number->\\\n\t\t\tnb_multiply((PyObject *)ap1, (PyObject *)ap2);\n\t\tPy_DECREF(ap1);\n\t\tPy_DECREF(ap2);\n\t\treturn (PyObject *)ret;\n\t}\n\t\n\tl = ap1->dimensions[ap1->nd-1];\n\tif (ap2->nd > 1) {\n\t\tmatchDim = ap2->nd - 2;\n\t\totherDim = ap2->nd - 1;\n\t}\n\telse {\n\t\tmatchDim = 0;\n\t\totherDim = 0;\n\t}\n\n\tif (ap2->dimensions[matchDim] != l) {\n\t\tPyErr_SetString(PyExc_ValueError, \"objects are not aligned\");\n\t\tgoto fail;\n\t}\n\t\n\tif (l == 0) n1 = n2 = 0;\n\telse {\n\t\tn1 = PyArray_SIZE(ap1)/l;\n\t\tn2 = PyArray_SIZE(ap2)/l;\n\t}\n\n\tnd = ap1->nd+ap2->nd-2;\n\tj = 0;\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; ind-2; i++) {\n\t\tdimensions[j++] = ap2->dimensions[i];\n\t}\n\tif(ap2->nd > 1) {\n\t\tdimensions[j++] = ap2->dimensions[ap2->nd-1];\n\t}\n\t/*\n\tfprintf(stderr, \"nd=%d dimensions=\", nd);\n\t for(i=0; i prior1 ? ap2->ob_type : ap1->ob_type);\n\n\tret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, \n\t\t\t\t\t typenum, NULL, NULL, 0, 0, \n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\n\tdot = ret->descr->f->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"dot not available for this type\");\n\t\tgoto fail;\n\t}\n\t\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[matchDim];\n\tif(ap1->nd > 1)\n\t\tis1r = ap1->strides[ap1->nd-2];\n\telse\n\t\tis1r = ap1->strides[ap1->nd-1];\n\tis2r = ap2->strides[otherDim];\n\n\top = ret->data; os = ret->descr->elsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1data;\n\t\tfor(i2=0; i2ob_type, \n\t\t\t\t PyArray_DESCR(arr),\n\t\t\t\t 2, dims, \n\t\t\t\t NULL, NULL, 0, arr);\n\n\tif (ret == NULL) {\n\t\tPy_DECREF(arr);\n\t\treturn NULL;\n\t}\n\t/* do 2-d loop */\n\toptr = PyArray_DATA(ret);\n\tstr2 = elsize*dims[0];\n\tfor (i=0; idimensions[0];\n\tn2 = ap2->dimensions[0];\n\n\tif (n1 < n2) { \n\t\tret = ap1; ap1 = ap2; ap2 = ret; \n\t\tret = NULL; i = n1;n1=n2;n2=i;\n\t}\n\tlength = n1;\n\tn = n2;\n\tswitch(mode) {\n\tcase 0:\t\n\t\tlength = length-n+1;\n\t\tn_left = n_right = 0;\n\t\tbreak;\n\tcase 1:\n\t\tn_left = (intp)(n/2);\n\t\tn_right = n-n_left-1;\n\t\tbreak;\n\tcase 2:\n\t\tn_right = n-1;\n\t\tn_left = n-1;\n\t\tlength = length+n-1;\n\t\tbreak;\n\tdefault:\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"mode must be 0, 1, or 2\");\n\t\tgoto fail;\n\t}\n\n\t/* Need to choose an output array that can hold a sum \n\t -- use priority to determine which subtype.\n\t */\n prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0);\n prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0);\n subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type);\n\t\n\tret = (PyArrayObject *)PyArray_New(subtype, 1,\n\t\t\t\t\t &length, typenum, \n\t\t\t\t\t NULL, NULL, 0, 0,\n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\t\n\tdot = ret->descr->f->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this data type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[0]; is2 = ap2->strides[0];\n\top = ret->data; os = ret->descr->elsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; idescr->type_num);\n\tPy_DECREF(arr);\n\treturn ret;\t \n}\n\n/*MULTIARRAY_API\n Min\n*/\nstatic PyObject *\nPyArray_Min(PyArrayObject *ap, int axis)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tif ((arr=(PyArrayObject *)_check_axis(ap, &axis, 0))==NULL)\n\t\treturn NULL;\n\tret = PyArray_GenericReduceFunction(arr, n_ops.minimum, axis,\n\t\t\t\t\t arr->descr->type_num);\n\tPy_DECREF(arr);\n\treturn ret;\t \n}\n\n/*MULTIARRAY_API\n Ptp\n*/\nstatic PyObject *\nPyArray_Ptp(PyArrayObject *ap, int axis)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\tPyObject *obj1=NULL, *obj2=NULL;\n\n\tif ((arr=(PyArrayObject *)_check_axis(ap, &axis, 0))==NULL)\n\t\treturn NULL;\n\tobj1 = PyArray_Max(arr, axis);\n\tif (obj1 == NULL) goto fail;\n\tobj2 = PyArray_Min(arr, axis);\n\tif (obj2 == NULL) goto fail;\n\tPy_DECREF(arr);\n\tret = PyNumber_Subtract(obj1, obj2);\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(obj1);\n\tPy_XDECREF(obj2);\n\treturn NULL;\n}\n\n\n/*MULTIARRAY_API\n ArgMax\n*/\nstatic PyObject *\nPyArray_ArgMax(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *rp=NULL;\n\tPyArray_ArgFunc* arg_func;\n\tchar *ip;\n\tintp *rptr;\n\tintp i, n, orign, m;\n\tint elsize;\n\t\n\tif ((ap=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny((PyObject *)op, \n\t\t\t\t\t PyArray_NOTYPE, 1, 0);\n\n\tPy_DECREF(op);\n\tif (ap == NULL) return NULL;\n\t\n\targ_func = ap->descr->f->argmax;\n\tif (arg_func == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \"data type not ordered\");\n\t\tgoto fail;\n\t}\n\n\trp = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd-1,\n\t\t\t\t\t ap->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, \n (PyObject *)ap);\n\tif (rp == NULL) goto fail;\n\n\n\telsize = ap->descr->elsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) {\n\t\tPyErr_SetString(MultiArrayError, \n\t\t\t\t\"attempt to get argmax/argmin \"\\\n\t\t\t\t\"of an empty sequence??\");\n\t\tgoto fail;\n\t}\n\tn = PyArray_SIZE(ap)/m;\n\trptr = (intp *)rp->data;\n\tfor (ip = ap->data, i=0; ind + indices->nd - 1;\n for (i=0; i< nd; i++) {\n if (i < axis) {\n shape[i] = self->dimensions[i];\n n *= shape[i];\n } else {\n if (i < axis+indices->nd) {\n shape[i] = indices->dimensions[i-axis];\n m *= shape[i];\n } else {\n shape[i] = self->dimensions[i-indices->nd+1];\n chunk *= shape[i];\n }\n }\n }\n\tPy_INCREF(self->descr);\n ret = (PyArrayObject *)PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t\t\t self->descr,\n\t\t\t\t\t\t nd, shape, \n\t\t\t\t\t\t NULL, NULL, 0, \n\t\t\t\t\t\t (PyObject *)self);\n\t\n if (ret == NULL) goto fail;\n\t\n max_item = self->dimensions[axis];\n chunk = chunk * ret->descr->elsize;\n src = self->data;\n dest = ret->data;\n\t\n for(i=0; idata))[j];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\t\"index out of range for \"\\\n\t\t\t\t\t\t\"array\");\n goto fail;\n }\n memmove(dest, src+tmp*chunk, chunk);\n dest += chunk;\n }\n src += chunk*max_item;\n }\n\t\n PyArray_INCREF(ret);\n\n Py_XDECREF(indices);\n Py_XDECREF(self);\n\n return (PyObject *)ret;\n\t\n\t\n fail:\n Py_XDECREF(ret);\n Py_XDECREF(indices);\n Py_XDECREF(self);\n return NULL;\n}\n\n/*MULTIARRAY_API\n Put values into an array\n*/\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject* values0, PyObject *indices0) \n{\n PyArrayObject *indices, *values;\n int i, chunk, ni, max_item, nv, tmp, thistype; \n char *src, *dest;\n\n indices = NULL;\n values = NULL;\n\n if (!PyArray_Check(self)) {\n PyErr_SetString(PyExc_TypeError, \"put: first argument must be an array\");\n return NULL;\n }\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \"put: first argument must be contiguous\");\n return NULL;\n }\n max_item = PyArray_SIZE(self);\n dest = self->data;\n chunk = self->descr->elsize;\n\n indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n if (indices == NULL) goto fail;\n ni = PyArray_SIZE(indices);\n\n\tthistype = self->descr->type_num;\n values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, thistype, 0, 0);\n if (values == NULL) goto fail;\n nv = PyArray_SIZE(values);\n if (nv > 0) { /* nv == 0 for a null array */\n if (thistype == PyArray_OBJECT) { \n for(i=0; idata + chunk * (i % nv);\n tmp = ((intp *)(indices->data))[i];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \"index out of range for array\");\n goto fail;\n }\n Py_INCREF(*((PyObject **)src));\n Py_XDECREF(*((PyObject **)(dest+tmp*chunk)));\n memmove(dest + tmp * chunk, src, chunk);\n }\n }\n else {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((intp *)(indices->data))[i];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \"index out of range for array\");\n goto fail;\n }\n memmove(dest + tmp * chunk, src, chunk);\n }\n }\n\n }\n\n Py_XDECREF(values);\n Py_XDECREF(indices);\n Py_INCREF(Py_None);\n return Py_None;\n\t\n fail:\n Py_XDECREF(indices);\n Py_XDECREF(values);\n return NULL;\n}\n\n/*MULTIARRAY_API\n Put values into an array according to a mask.\n*/\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0) \n{\n PyArrayObject *mask, *values;\n int i, chunk, ni, max_item, nv, tmp, thistype;\n char *src, *dest;\n\n mask = NULL;\n values = NULL;\n\n if (!PyArray_Check(self)) {\n PyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"putmask: first argument must \"\\\n\t\t\t\t\"be an array\");\n return NULL;\n }\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"putmask: first argument must be contiguous\");\n return NULL;\n }\n\n max_item = PyArray_SIZE(self);\n dest = self->data;\n chunk = self->descr->elsize;\n\n mask = (PyArrayObject *)\\\n\t\tPyArray_FROM_OTF(mask0, PyArray_BOOL, CARRAY_FLAGS | FORCECAST);\n\tif (mask == NULL) goto fail;\n ni = PyArray_SIZE(mask);\n if (ni != max_item) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"putmask: mask and data must be \"\\\n\t\t\t\t\"the same size\");\n goto fail;\n }\n\n\tthistype = self->descr->type_num;\n values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, thistype, 0, 0);\n\tif (values == NULL) goto fail;\n nv = PyArray_SIZE(values);\t /* zero if null array */\n if (nv > 0) {\n if (thistype == PyArray_OBJECT) {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((Bool *)(mask->data))[i];\n if (tmp) {\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\n Py_XDECREF(*((PyObject **)(dest+i*chunk)));\n memmove(dest + i * chunk, src, chunk);\n }\n\t\t\t}\n }\n else {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((Bool *)(mask->data))[i];\n if (tmp) memmove(dest + i * chunk, src, chunk);\n\t\t\t}\n\t\t}\n }\n\n Py_XDECREF(values);\n Py_XDECREF(mask);\n Py_INCREF(Py_None);\n return Py_None;\n\t\n fail:\n Py_XDECREF(mask);\n Py_XDECREF(values);\n return NULL;\n}\n\n\n/* This conversion function can be used with the \"O&\" argument for\n PyArg_ParseTuple. It will immediately return an object of array type\n or will convert to a CARRAY any other object. \n\n If you use PyArray_Converter, you must DECREF the array when finished\n as you get a new reference to it.\n*/\n \n/*MULTIARRAY_API\n Useful to pass as converter function for O& processing in\n PyArgs_ParseTuple.\n*/\nstatic int \nPyArray_Converter(PyObject *object, PyObject **address) \n{\n if (PyArray_Check(object)) {\n *address = object;\n\t\tPy_INCREF(object);\n return PY_SUCCEED;\n }\n else {\n\t\t*address = PyArray_FromAny(object, NULL, 0, 0, CARRAY_FLAGS);\n\t\tif (*address == NULL) return PY_FAIL;\n\t\treturn PY_SUCCEED;\n }\n}\n\n/*MULTIARRAY_API\n Convert an object to true / false\n*/\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{ \n if (PyObject_IsTrue(object))\n *val=TRUE;\n else *val=FALSE;\n if (PyErr_Occurred())\n return PY_FAIL;\n return PY_SUCCEED;\n}\n\n\n/*MULTIARRAY_API\n Typestr converter\n*/\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (gentype == PyArray_GENBOOLLTR) {\n\t\tif (itemsize == 1)\n\t\t\tnewtype = PyArray_BOOL;\n\t\telse \n\t\t\tnewtype = PyArray_NOTYPE;\n\t}\n\telse if (gentype == PyArray_SIGNEDLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 1:\n\t\t\tnewtype = PyArray_INT8;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tnewtype = PyArray_INT16;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tnewtype = PyArray_INT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_INT64;\n\t\t\tbreak;\n#ifdef PyArray_INT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_INT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\n\t}\n\n\telse if (gentype == PyArray_UNSIGNEDLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 1:\n\t\t\tnewtype = PyArray_UINT8;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tnewtype = PyArray_UINT16;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tnewtype = PyArray_UINT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_UINT64;\n\t\t\tbreak;\n#ifdef PyArray_INT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_UINT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t\tbreak;\n\t\t}\n\t}\n\telse if (gentype == PyArray_FLOATINGLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 4:\n\t\t\tnewtype = PyArray_FLOAT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_FLOAT64;\n\t\t\tbreak;\n#ifdef PyArray_FLOAT80\n case 10:\n\t\t\tnewtype = PyArray_FLOAT80;\n\t\t\tbreak;\n#endif\n#ifdef PyArray_FLOAT96\n\t\tcase 12:\n\t\t\tnewtype = PyArray_FLOAT96;\n\t\t\tbreak;\n#endif\t\t \n#ifdef PyArray_FLOAT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_FLOAT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\t\t\n\t}\n\t\n\telse if (gentype == PyArray_COMPLEXLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 8:\n\t\t\tnewtype = PyArray_COMPLEX64;\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\tnewtype = PyArray_COMPLEX128;\n\t\t\tbreak;\n#ifdef PyArray_FLOAT80\n case 20:\n\t\t\tnewtype = PyArray_COMPLEX160;\n\t\t\tbreak;\n#endif\n#ifdef PyArray_FLOAT96\n\t\tcase 24:\n\t\t\tnewtype = PyArray_COMPLEX192;\t\t\t\n\t\t\tbreak;\n#endif\t\t \n#ifdef PyArray_FLOAT128\n\t\tcase 32:\n\t\t\tnewtype = PyArray_COMPLEX256;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\t\t\n\t}\n\n\treturn newtype;\n}\n\n\n/* this function takes a Python object which exposes the (single-segment)\n buffer interface and returns a pointer to the data segment\n \n You should increment the reference count by one of buf->base\n if you will hang on to a reference\n\n You only get a borrowed reference to the object. Do not free the\n memory...\n*/\n\n\n/*MULTIARRAY_API\n Get buffer chunk from object\n*/\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n int buflen;\n\n buf->ptr = NULL;\n buf->flags = BEHAVED_FLAGS;\n buf->base = NULL;\n\n\tif (obj == Py_None)\n\t\treturn PY_SUCCEED;\n\n if (PyObject_AsWriteBuffer(obj, &(buf->ptr), &buflen) < 0) {\n PyErr_Clear();\n buf->flags &= ~WRITEABLE;\n if (PyObject_AsReadBuffer(obj, (const void **)&(buf->ptr), \n &buflen) < 0)\n return PY_FAIL;\n }\n buf->len = (intp) buflen;\n \n /* Point to the base of the buffer object if present */\n if (PyBuffer_Check(obj)) buf->base = ((PyArray_Chunk *)obj)->base;\n if (buf->base == NULL) buf->base = obj;\n \n return PY_SUCCEED; \n}\n\n\n\n/* This function takes a Python sequence object and allocates and\n fills in an intp array with the converted values.\n\n **Remember to free the pointer seq.ptr when done using\n PyDimMem_FREE(seq.ptr)**\n*/\n\n/*MULTIARRAY_API\n Get intp chunk from sequence\n*/\nstatic int\nPyArray_IntpConverter(PyObject *obj, PyArray_Dims *seq)\n{\n int len;\n int nd;\n\n seq->ptr = NULL;\n if (obj == Py_None) return PY_SUCCEED;\n len = PySequence_Size(obj);\n if (len == -1) { /* Check to see if it is a number */\n if (PyNumber_Check(obj)) len = 1;\n }\n if (len < 0) {\n PyErr_SetString(PyExc_TypeError, \n \"expected sequence object with len >= 0\");\n return PY_FAIL;\n }\n if (len > MAX_DIMS) {\n PyErr_Format(PyExc_ValueError, \"sequence too large; \" \\\n \"must be smaller than %d\", MAX_DIMS);\n return PY_FAIL;\n }\n\tif (len > 0) {\n\t\tseq->ptr = PyDimMem_NEW(len);\n\t\tif (seq->ptr == NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n seq->len = len;\n nd = PyArray_IntpFromSequence(obj, (intp *)seq->ptr, len);\n if (nd == -1 || nd != len) {\n\t\tPyDimMem_FREE(seq->ptr);\n\t\tseq->ptr=NULL;\n\t\treturn PY_FAIL;\n\t}\n return PY_SUCCEED;\n}\n\n\n/* A tuple type would be either (generic typeobject, typesize) \n or (fixed-length data-type, shape) \n\n or (inheriting data-type, new-data-type)\n The new data-type must have the same itemsize as the inheriting data-type\n unless the latter is 0 \n \n Thus (int32, {'real':(int16,0),'imag',(int16,2)})\n\n is one way to specify a descriptor that will give \n a['real'] and a['imag'] to an int32 array.\n*/\n\n/* leave type reference alone */\nstatic PyArray_Descr *\n_use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag) \n{\n\tPyArray_Descr *new;\n\tPyArray_Descr *conv;\n\t\n\t*errflag = 0;\n\tif (!PyArray_DescrConverter(newobj, &conv)) {\n\t\treturn NULL;\n\t}\n\t*errflag = 1;\n\tif (type == &OBJECT_Descr) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"cannot base a new descriptor on an\"\\\n\t\t\t\t\" OBJECT descriptor.\");\n\t\treturn NULL;\n\t}\n\tnew = PyArray_DescrNew(type);\n\tif (new == NULL) return NULL;\n\n\tif (new->elsize && new->elsize != conv->elsize) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"mismatch in size of old\"\\\n\t\t\t\t\"and new data-descriptor\");\n\t\treturn NULL;\n\t}\n\tnew->elsize = conv->elsize;\n\tif (conv->fields != Py_None) {\n\t\tnew->fields = conv->fields;\n\t\tPy_XINCREF(new->fields);\n\t}\n\tPy_DECREF(conv);\n\t*errflag = 0;\n\treturn new;\n}\n\nstatic PyArray_Descr *\n_convert_from_tuple(PyObject *obj) \n{\n\tPyArray_Descr *type, *res;\n\tPyObject *val;\n\tint errflag;\n\t\n\tif (PyTuple_GET_SIZE(obj) != 2) return NULL;\n\n\tif (!PyArray_DescrConverter(PyTuple_GET_ITEM(obj,0), &type)) \n\t\treturn NULL;\n\tval = PyTuple_GET_ITEM(obj,1);\n\t/* try to interpret next item as a type */\n\tres = _use_inherit(type, val, &errflag);\n\tif (res || errflag) {\n\t\tPy_DECREF(type);\n\t\tif (res) return res;\n\t\telse return NULL;\n\t}\n\tPyErr_Clear();\n\t/* We get here if res was NULL but errflag wasn't set\n\t --- i.e. the conversion to a data-descr failed in _use_inherit\n\t*/\n\n\tif (type->elsize == 0) { /* interpret next item as a typesize */\n\t\tint itemsize;\n\t\titemsize = PyArray_PyIntAsInt(PyTuple_GET_ITEM(obj,1));\n\t\tif (error_converting(itemsize)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid itemsize in generic type \"\\\n\t\t\t\t\t\"tuple\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPyArray_DESCR_REPLACE(type);\n\t\ttype->elsize = itemsize;\n\t}\n\telse {\n\t\t/* interpret next item as shape (if it's a tuple)\n\t\t and reset the type to PyArray_VOID with \n\t\t anew fields attribute. \n\t */\n\t\tPyArray_Dims shape={NULL,-1};\n\t\tPyArray_Descr *newdescr;\n\t\tif (!(PyArray_IntpConverter(val, &shape)) || \n\t\t (shape.len > MAX_DIMS)) {\n\t\t\tPyDimMem_FREE(shape.ptr);\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid shape in fixed-type tuple.\");\n\t\t\tgoto fail;\n\t\t}\n\t\tnewdescr = PyArray_DescrNewFromType(PyArray_VOID);\n\t\tif (newdescr == NULL) {PyDimMem_FREE(shape.ptr); goto fail;}\n\t\tnewdescr->elsize = type->elsize;\n\t\tnewdescr->elsize *= PyArray_MultiplyList(shape.ptr, \n\t\t\t\t\t\t\t shape.len);\n\t\tPyDimMem_FREE(shape.ptr);\n\t\tnewdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tnewdescr->subarray->base = type;\n\t\tPy_INCREF(val);\n\t\tnewdescr->subarray->shape = val;\n\t\tPy_XDECREF(newdescr->fields);\n\t\tnewdescr->fields = NULL;\n\t\ttype = newdescr;\n\t}\n\treturn type;\n\n fail:\n\tPy_XDECREF(type);\n\treturn NULL;\n}\n\n/* obj is a list. Each item is a tuple with\n\n(field-name, data-type (either a list or a string), and an optional \n shape parameter).\n*/\nstatic PyArray_Descr *\n_convert_from_array_descr(PyObject *obj)\n{\n\tint n, i, totalsize;\n\tint ret;\n\tPyObject *fields, *item, *newobj;\n\tPyObject *name, *key, *tup;\n\tPyObject *nameslist;\n\tPyArray_Descr *new;\n\tPyArray_Descr *conv;\n\t\n\tn = PyList_GET_SIZE(obj);\t\n\tnameslist = PyList_New(n);\n\tif (!nameslist) return NULL;\n\ttotalsize = 0;\n\tfields = PyDict_New();\n\tfor (i=0; ielsize;\n\t\tPyDict_SetItem(fields, name, tup);\n\t\tPy_DECREF(tup);\n\t}\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, nameslist);\n\tPy_DECREF(key);\n\tPy_DECREF(nameslist);\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tnew->fields = fields;\n\tnew->elsize = totalsize;\n\treturn new;\n \n fail:\n\tPy_DECREF(fields);\n\tPy_DECREF(nameslist);\n\treturn NULL;\n\n}\n\n/* a list specifying a data-type can just be\n a list of formats. The names for the fields\n will default to f1, f2, f3, and so forth.\n\n or it can be an array_descr format string -- in which case\n align must be 0. \n*/\n\nstatic PyArray_Descr *\n_convert_from_list(PyObject *obj, int align, int try_descr)\n{\n\tint n, i;\n\tint totalsize;\n\tPyObject *fields;\n\tPyArray_Descr *conv=NULL;\n\tPyArray_Descr *new;\n\tPyObject *key, *tup;\n\tPyObject *nameslist=NULL;\n \tint ret;\n\tint maxalign=0;\n\t\n\tn = PyList_GET_SIZE(obj);\n\ttotalsize = 0;\n\tif (n==0) return NULL;\n\tnameslist = PyList_New(n);\n\tif (!nameslist) return NULL;\n\tfields = PyDict_New();\n\tfor (i=0; ielsize;\n\t\tif (align) {\n\t\t\tint _align;\n\t\t\t_align = conv->alignment;\n\t\t\tif (_align > 1) totalsize =\t\t\t\\\n\t\t\t\t((totalsize + _align - 1)/_align)*_align;\n\t\t\tmaxalign = MAX(maxalign, _align);\n\t\t}\n\t}\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, nameslist);\n\tPy_DECREF(key);\n\tPy_DECREF(nameslist);\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tnew->fields = fields;\n\tif (maxalign > 1) {\n\t\ttotalsize = ((totalsize+maxalign-1)/maxalign)*maxalign;\n\t}\n\tif (align) new->alignment = maxalign;\n\tnew->elsize = totalsize;\n\treturn new;\n\n fail:\n\tPy_DECREF(nameslist);\n\tPy_DECREF(fields);\n\tif (!try_descr) return NULL;\n\tif (align) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"failed to convert from list of formats \"\\\n\t\t\t\t\"and align cannot be 1 for conversion from \"\\\n\t\t\t\t\"array_descr structure\");\n\t\treturn NULL;\n\t}\n\tPyErr_Clear();\n\treturn _convert_from_array_descr(obj);\n}\n\n\n/* comma-separated string */\n/* this is the format developed by the numarray records module */\n/* and implemented by the format parser in that module */\n/* this is an alternative implementation found in the _internal.py \n file patterned after that one -- the approach is to try to convert \n to a list (with tuples if any repeat information is present) \n and then call the _convert_from_list)\n*/\n\nstatic PyArray_Descr *\n_convert_from_commastring(PyObject *obj, int align)\n{\n\tPyObject *listobj;\n\tPyArray_Descr *res;\n\n\tif (!PyString_Check(obj)) return NULL;\n listobj = PyObject_CallMethod(_numpy_internal, \"_commastring\",\n\t\t\t\t \"O\", obj);\n\tif (!listobj) return NULL;\n\tres = _convert_from_list(listobj, align, 0);\n\tPy_DECREF(listobj);\n\tif (!res && !PyErr_Occurred()) {\n\t\tPyErr_SetString(PyExc_ValueError, \"invalid data-type\");\n\t\treturn NULL;\n\t}\n\treturn res;\n}\n\n\n\n/* a dictionary specifying a data-type\n must have at least two and up to four\n keys These must all be sequences of the same length.\n\n \"names\" --- field names \n \"formats\" --- the data-type descriptors for the field.\n \n Optional:\n\n \"offsets\" --- integers indicating the offset into the \n record of the start of the field.\n\t\t if not given, then \"consecutive offsets\" \n\t\t will be assumed and placed in the dictionary.\n \n \"titles\" --- Allows the use of an additional key\n for the fields dictionary.\n \nAttribute-lookup-based field names merely has to query the fields \ndictionary of the data-descriptor. Any result present can be used\nto return the correct field.\n\nSo, the notion of what is a name and what is a title is really quite\narbitrary. \n\nWhat does distinguish a title, however, is that if it is not None, \nit will be placed at the end of the tuple inserted into the \nfields dictionary.\n\nIf the dictionary does not have \"names\" and \"formats\" entries,\nthen it will be checked for conformity and used directly. \n*/\n\nstatic PyArray_Descr *\n_use_fields_dict(PyObject *obj, int align)\n{\n return (PyArray_Descr *)PyObject_CallMethod(_numpy_internal, \n\t\t\t\t\t\t \"_usefields\", \n\t\t\t\t\t\t \"Oi\", obj, align);\n}\n\nstatic PyArray_Descr *\n_convert_from_dict(PyObject *obj, int align)\n{\n\tPyArray_Descr *new;\n\tPyObject *fields=NULL;\n\tPyObject *names, *offsets, *descrs, *titles, *key;\n\tint n, i;\n\tint totalsize;\n\tint maxalign=0;\n\t\n\tfields = PyDict_New();\n\tif (fields == NULL) return (PyArray_Descr *)PyErr_NoMemory();\n\t\n\tnames = PyDict_GetItemString(obj, \"names\");\n\tdescrs = PyDict_GetItemString(obj, \"formats\");\n\n\tif (!names || !descrs) {\n\t\tPy_DECREF(fields);\n\t\treturn _use_fields_dict(obj, align);\n\t}\n\tn = PyObject_Length(names);\n\toffsets = PyDict_GetItemString(obj, \"offsets\");\n\ttitles = PyDict_GetItemString(obj, \"titles\");\n\tif ((n > PyObject_Length(descrs)) ||\t\t\t\\\n\t (offsets && (n > PyObject_Length(offsets))) ||\t\\\n\t (titles && (n > PyObject_Length(titles)))) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"all items in the dictionary must have\" \\\n\t\t\t\t\" the same length.\");\n\t\tgoto fail;\n\t}\n\n\ttotalsize = 0;\n\tfor(i=0; i totalsize) totalsize = offset;\n\t\t}\n\t\telse \n\t\t\tPyTuple_SET_ITEM(tup, 1, PyInt_FromLong(totalsize));\n\t\tif (len == 3) PyTuple_SET_ITEM(tup, 2, item);\n\t\tname = PyObject_GetItem(names, index);\n\t\tPy_DECREF(index);\n\n\t\t/* Insert into dictionary */\n\t\tPyDict_SetItem(fields, name, tup);\n\t\tPy_DECREF(name);\n\t\tif (len == 3) PyDict_SetItem(fields, item, tup);\n\t\tPy_DECREF(tup);\n\t\tif ((ret == PY_FAIL) || (newdescr->elsize == 0)) goto fail;\n\t\ttotalsize += newdescr->elsize;\n\t\tif (align) {\n\t\t\tint _align = newdescr->alignment;\n\t\t\tif (_align > 1) totalsize =\t\t\t\\\n\t\t\t\t((totalsize + _align - 1)/_align)*_align;\n\t\t\tmaxalign = MAX(maxalign,_align);\n\t\t}\n\t}\n\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tif (new == NULL) goto fail;\n\tif (maxalign > 1)\n\t\ttotalsize = ((totalsize + maxalign - 1)/maxalign)*maxalign;\n\tif (align) new->alignment = maxalign;\n\tnew->elsize = totalsize;\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, names);\n\tPy_DECREF(key);\n\tnew->fields = fields;\n\treturn new;\n\n fail:\n\tPy_XDECREF(fields);\n\treturn NULL;\n}\n\n/* \n any object with \n the .fields attribute and/or .itemsize attribute \n (if the .fields attribute does not give\n the total size -- i.e. a partial record naming).\n If itemsize is given it must be >= size computed from fields\n \n The .fields attribute must return a convertible dictionary if \n present. Result inherits from PyArray_VOID.\n*/\n\n\n/*MULTIARRAY_API\n Get typenum from an object -- None goes to NULL\n*/\nstatic int\nPyArray_DescrConverter2(PyObject *obj, PyArray_Descr **at)\n{\n\tif (obj == Py_None) {\n\t\t*at = NULL;\n\t\treturn PY_SUCCEED;\n\t}\n\telse return PyArray_DescrConverter(obj, at);\n}\n\n/* This function takes a Python object representing a type and converts it \n to a the correct PyArray_Descr * structure to describe the type.\n \n Many objects can be used to represent a data-type which in NumPy is\n quite a flexible concept. \n\n This is the central code that converts Python objects to \n Type-descriptor objects that are used throughout numpy.\n */\n\n/* new reference in *at */\n/*MULTIARRAY_API\n Get typenum from an object -- None goes to &LONG_descr\n*/\nstatic int\nPyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)\n{\n char *type;\n int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item;\n\tint elsize = 0;\n\tchar endian = '=';\n\n\t*at=NULL;\n\t\n\t/* default */\n if (obj == Py_None) {\n\t\t*at = PyArray_DescrFromType(PyArray_LONG);\n\t\treturn PY_SUCCEED;\n\t}\n\t\n\tif (PyArray_DescrCheck(obj)) {\n\t\t*at = (PyArray_Descr *)obj;\n\t\tPy_INCREF(*at);\n\t\treturn PY_SUCCEED;\n\t}\n\t\n if (PyType_Check(obj)) {\n\t\tif (PyType_IsSubtype((PyTypeObject *)obj, \n\t\t\t\t &PyGenericArrType_Type)) {\n\t\t\t*at = PyArray_DescrFromTypeObject(obj);\n\t\t\tif (*at) return PY_SUCCEED;\n\t\t\telse return PY_FAIL;\n\t\t}\n\t\tcheck_num = PyArray_OBJECT;\n\t\tif (obj == (PyObject *)(&PyInt_Type))\n\t\t\tcheck_num = PyArray_LONG;\n\t\telse if (obj == (PyObject *)(&PyLong_Type))\n\t\t\tcheck_num = PyArray_LONGLONG;\n\t\telse if (obj == (PyObject *)(&PyFloat_Type)) \n\t\t\tcheck_num = PyArray_DOUBLE;\n\t\telse if (obj == (PyObject *)(&PyComplex_Type)) \n\t\t\tcheck_num = PyArray_CDOUBLE;\n\t\telse if (obj == (PyObject *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\n else if (obj == (PyObject *)(&PyString_Type))\n check_num = PyArray_STRING;\n else if (obj == (PyObject *)(&PyUnicode_Type))\n check_num = PyArray_UNICODE;\n\t\telse if (obj == (PyObject *)(&PyBuffer_Type))\n\t\t\tcheck_num = PyArray_VOID;\n\t\telse {\n\t\t\t*at = _arraydescr_fromobj(obj);\n\t\t\tif (*at) return PY_SUCCEED;\n\t\t}\n\t\tgoto finish;\n\t}\n\n\t/* or a typecode string */\n\n\tif (PyString_Check(obj)) {\n\t\t/* Check for a string typecode. */\n\t\ttype = PyString_AS_STRING(obj);\n\t\tlen = PyString_GET_SIZE(obj);\n\t\tif (len <= 0) goto fail;\n\t\tcheck_num = (int) type[0];\n\t\tif ((char) check_num == '>' || (char) check_num == '<' || \\\n\t\t (char) check_num == '|') {\n\t\t\tif (len <= 1) goto fail;\n\t\t\tendian = (char) check_num;\n\t\t\ttype++; len--;\n\t\t\tcheck_num = (int) type[0];\n\t\t\tif (endian == '|') endian = '=';\n\t\t}\n\t\tif (len > 1) {\n\t\t\telsize = atoi(type+1);\n\t\t\tif (len > 2 && elsize < 10) {\n\t\t\t\t/* perhaps commas present */\n\t\t\t\tint i;\n\t\t\t\tfor (i=1;ielsize == 0) && (elsize != 0)) {\n\t\tPyArray_DESCR_REPLACE(*at);\n\t\t(*at)->elsize = elsize;\n\t}\n\tif (endian != '=' && PyArray_ISNBO(endian)) endian = '='; \n\t\n\tif (endian != '=' && (*at)->byteorder != '|' &&\t\\\n\t (*at)->byteorder != endian) {\n\t\tPyArray_DESCR_REPLACE(*at);\n\t\t(*at)->byteorder = endian;\n\t}\n\t\n return PY_SUCCEED;\n\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\t*at=NULL;\n\treturn PY_FAIL;\n}\t\n\n/*MULTIARRAY_API\n Convert object to endian\n*/\nstatic int\nPyArray_ByteorderConverter(PyObject *obj, char *endian)\n{\n\tchar *str;\n\t*endian = PyArray_SWAP;\n\tstr = PyString_AsString(obj);\n\tif (!str) return PY_FAIL;\n\tif (strlen(str) < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Byteorder string must be at least length 1\");\n\t\treturn PY_FAIL;\n\t}\n\t*endian = str[0];\n\tif (str[0] != PyArray_BIG && str[0] != PyArray_LITTLE &&\t\\\n\t str[0] != PyArray_NATIVE) {\n\t\tif (str[0] == 'b' || str[0] == 'B')\n\t\t\t*endian = PyArray_BIG;\n\t\telse if (str[0] == 'l' || str[0] == 'L')\n\t\t\t*endian = PyArray_LITTLE;\n\t\telse if (str[0] == 'n' || str[0] == 'N')\n\t\t\t*endian = PyArray_NATIVE;\n\t\telse if (str[0] == 'i' || str[0] == 'I')\n\t\t\t*endian = PyArray_IGNORE;\n\t\telse if (str[0] == 's' || str[0] == 'S')\n\t\t\t*endian = PyArray_SWAP;\n\t\telse {\n\t\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t\t \"%s is an unrecognized byteorder\",\n\t\t\t\t str);\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n\treturn PY_SUCCEED;\n}\n\n/*MULTIARRAY_API\n Convert object to sort kind \n*/\nstatic int\nPyArray_SortkindConverter(PyObject *obj, PyArray_SORTKIND *sortkind)\n{\n\tchar *str;\n\t*sortkind = PyArray_QUICKSORT;\n\tstr = PyString_AsString(obj);\n\tif (!str) return PY_FAIL;\n\tif (strlen(str) < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Sort kind string must be at least length 1\");\n\t\treturn PY_FAIL;\n\t}\n\tif (str[0] == 'q' || str[0] == 'Q')\n\t\t*sortkind = PyArray_QUICKSORT;\n\telse if (str[0] == 'h' || str[0] == 'H')\n\t\t*sortkind = PyArray_HEAPSORT;\n\telse if (str[0] == 'm' || str[0] == 'M')\n\t\t*sortkind = PyArray_MERGESORT;\n\telse if (str[0] == 't' || str[0] == 'T')\n\t\t*sortkind = PyArray_TIMSORT;\n\telse {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"%s is an unrecognized kind of sort\",\n\t\t\t str);\n\t\treturn PY_FAIL;\n\t}\n\treturn PY_SUCCEED;\n}\n\n\n/* This function returns true if the two typecodes are \n equivalent (same basic kind and same itemsize).\n*/\n\n/*MULTIARRAY_API*/\nstatic Bool\nPyArray_EquivTypes(PyArray_Descr *typ1, PyArray_Descr *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->elsize;\n\tregister int size2=typ2->elsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typ1->fields != typ2->fields) return FALSE;\n\tif (PyArray_ISNBO(typ1->byteorder) != PyArray_ISNBO(typ2->byteorder))\n\t\treturn FALSE;\n\n\tif (typenum1 == PyArray_VOID || \\\n\t typenum2 == PyArray_VOID) {\n\t\treturn ((typenum1 == typenum2) && \n\t\t\t(typ1->typeobj == typ2->typeobj) &&\n\t\t\t(typ1->fields == typ2->fields));\n\t}\n\treturn (typ1->kind == typ2->kind);\n}\n\n/*** END C-API FUNCTIONS **/\n\n\n#define _ARET(x) PyArray_Return((PyArrayObject *)(x))\n\nstatic char doc_fromobject[] = \"array(object, dtype=None, copy=1, fortran=0, \"\\\n \"subok=0)\\n\"\\\n \"will return a new array formed from the given object type given.\\n\"\\\n \"Object can anything with an __array__ method, or any object\\n\"\\\n \"exposing the array interface, or any (nested) sequence.\\n\"\\\n \"If no type is given, then the type will be determined as the\\n\"\\\n \"minimum type required to hold the objects in the sequence.\\n\"\\\n \"If copy is zero and sequence is already an array with the right \\n\"\\\n \"type, a reference will be returned. If the sequence is an array,\\n\"\\\n \"type can be used only to upcast the array. For downcasting \\n\"\\\n \"use .astype(t) method. If subok is true, then subclasses of the\\n\"\\\n \"array may be returned. Otherwise, a base-class ndarray is returned\";\n\nstatic PyObject *\n_array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)\n{\n\tPyObject *op, *ret=NULL;\n\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", \"subok\", \n NULL};\n Bool subok=FALSE;\n\tBool copy=TRUE;\n\tPyArray_Descr *type=NULL;\n\tPyArray_Descr *oldtype=NULL;\n\tBool fortran=FALSE;\n\tint flags=0;\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&O&\", kwd, &op, \n\t\t\t\t\tPyArray_DescrConverter2,\n &type, \n\t\t\t\t\tPyArray_BoolConverter, ©, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) || PyBigArray_CheckExact(op))) {\n\t\tif (type==NULL) {\n\t\t\tif (!copy && fortran==PyArray_ISFORTRAN(op)) {\n\t\t\t\tPy_INCREF(op);\n\t\t\t\treturn op;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn PyArray_NewCopy((PyArrayObject*)op, \n\t\t\t\t\t\t fortran);\n\t\t\t}\n\t\t}\n\t\t/* One more chance */\n\t\toldtype = PyArray_DESCR(op);\n\t\tif (PyArray_EquivTypes(oldtype, type)) {\n\t\t\tif (!copy && fortran==PyArray_ISFORTRAN(op)) {\n\t\t\t\tPy_INCREF(op);\n\t\t\t\treturn op;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tret = PyArray_NewCopy((PyArrayObject*)op,\n\t\t\t\t\t\t fortran);\n\t\t\t\tif (oldtype == type) return ret;\n\t\t\t\tPy_INCREF(oldtype);\n\t\t\t\tPy_DECREF(PyArray_DESCR(ret));\n\t\t\t\tPyArray_DESCR(ret) = oldtype;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (copy) {\n\t\tflags = ENSURECOPY;\n\t}\n\tif (fortran) {\n\t\tflags |= FORTRAN;\n\t}\n if (!subok) {\n flags |= ENSUREARRAY;\n }\n\n\tif ((ret = PyArray_FromAny(op, type, 0, 0, flags)) == NULL) \n\t\treturn NULL;\n\n\treturn ret;\n}\n\n/* accepts NULL type */\n/* steals referenct to type */\n/*MULTIARRAY_API\n Empty\n*/\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Descr *type, int fortran)\n{\n\tPyArrayObject *ret;\n \n\tif (!type) type = PyArray_DescrFromType(PyArray_LONG);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t type, nd, dims, \n\t\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t\t fortran, NULL);\n\tif (ret == NULL) return NULL;\n \n\tif ((PyArray_TYPE(ret) == PyArray_OBJECT)) {\n PyArray_FillObjectArray(ret, Py_None);\n\t}\n\treturn (PyObject *)ret;\n}\n\n\nstatic char doc_empty[] = \"empty((d1,...,dn),dtype=int,fortran=0) will return a new array\\n of shape (d1,...,dn) and given type with all its entries uninitialized. This can be faster than zeros.\";\n\nstatic PyObject *\narray_empty(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n \n\tstatic char *kwlist[] = {\"shape\",\"dtype\",\"fortran\",NULL};\n\tPyArray_Descr *typecode=NULL;\n PyArray_Dims shape = {NULL, 0};\n\tBool fortran = FALSE;\t\n PyObject *ret=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &shape, \n PyArray_DescrConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\tgoto fail;\n\n\tret = PyArray_Empty(shape.len, shape.ptr, typecode, fortran); \n PyDimMem_FREE(shape.ptr);\n return ret;\n\n fail:\n\tPyDimMem_FREE(shape.ptr);\n\treturn ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypedescr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. The dtypedescr must be a valid data-type descriptor. If dtypedescr corresponds to an OBJECT descriptor, then obj can be any object, otherwise obj must be a string. If obj is not given it will be interpreted as None for object type and zeros for all other types.\";\n\nstatic PyObject *\narray_scalar(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n \n\tstatic char *kwlist[] = {\"dtypedescr\",\"obj\", NULL};\n\tPyArray_Descr *typecode;\n\tPyObject *obj=NULL;\n\tint alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O!|O\",\n\t\t\t\t\t kwlist, &PyArrayDescr_Type, \n\t\t\t\t\t &typecode,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\t\n\tif (typecode->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\t\t\\\n\t\t\t\t\"itemsize cannot be zero\");\n\t\treturn NULL;\n\t}\n\n\tif (typecode->type_num == PyArray_OBJECT) {\n\t\tif (obj == NULL) obj = Py_None;\n\t\tdptr = &obj;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = _pya_malloc(typecode->elsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode->elsize);\n\t\t\talloc = 1;\n\t\t}\n\t\telse {\n\t\t\tif (!PyString_Check(obj)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\t\"initializing object must \"\\\n\t\t\t\t\t\t\"be a string\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tif (PyString_GET_SIZE(obj) < typecode->elsize) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"initialization string is too\"\\\n\t\t\t\t\t\t\" small\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tdptr = PyString_AS_STRING(obj);\n\t\t}\n\t}\n\n\tret = PyArray_Scalar(dptr, typecode, NULL);\n\t\n\t/* free dptr which contains zeros */\n\tif (alloc) _pya_free(dptr);\n\treturn ret;\n}\n\n\n/* steal a reference */\n/* accepts NULL type */\n/*MULTIARRAY_API\n Zeros\n*/\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Descr *type, int fortran)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tif (!type) type = PyArray_DescrFromType(PyArray_LONG);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t type,\n\t\t\t\t\t\t nd, dims, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t fortran, NULL);\n\tif (ret == NULL) return NULL;\n \n\tif ((PyArray_TYPE(ret) == PyArray_OBJECT)) {\n\t\tPyObject *zero = PyInt_FromLong(0);\n PyArray_FillObjectArray(ret, zero);\n Py_DECREF(zero);\n\t}\n\telse {\n\t\tn = PyArray_NBYTES(ret);\n\t\tmemset(ret->data, 0, n);\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=int,fortran=0) will return a new array of shape (d1,...,dn) and type typecode with all it's entries initialized to zero.\";\n\n\nstatic PyObject *\narray_zeros(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\",\"dtype\",\"fortran\",NULL};\n\tPyArray_Descr *typecode=NULL;\n PyArray_Dims shape = {NULL, 0};\n\tBool fortran = FALSE;\t\n PyObject *ret=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &shape, \n PyArray_DescrConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\tgoto fail;\n\n\tret = PyArray_Zeros(shape.len, shape.ptr, typecode, (int) fortran);\n PyDimMem_FREE(shape.ptr);\n return ret;\n\n fail:\n\tPyDimMem_FREE(shape.ptr);\n\treturn ret;\n}\n\nstatic char doc_set_typeDict[] = \"set_typeDict(dict) set the internal \"\\\n\t\"dictionary that can look up an array type using a registered \"\\\n\t\"code\";\n\nstatic PyObject *\narray_set_typeDict(PyObject *ignored, PyObject *args)\n{\n\tPyObject *dict;\n\tif (!PyArg_ParseTuple(args, \"O\", &dict)) return NULL;\n\tPy_XDECREF(typeDict); /* Decrement old reference (if any)*/\n\ttypeDict = dict;\n\tPy_INCREF(dict); /* Create an internal reference to it */\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n/* steals a reference to dtype -- accepts NULL */\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromString(char *data, intp slen, PyArray_Descr *dtype, intp n)\n{\n\tint itemsize;\n\tPyArrayObject *ret;\n\n\tif (dtype == NULL)\n\t\tdtype=PyArray_DescrFromType(PyArray_LONG);\n\t\n\tif (dtype == &OBJECT_Descr) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Cannot create an object array from a\"\\\n\t\t\t\t\" string.\");\n\t\tPy_DECREF(dtype);\n\t\treturn NULL;\n\t}\n\t\n\titemsize = dtype->elsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize\");\n\t\tPy_DECREF(dtype);\n\t\treturn NULL;\n\t}\n\t\n\tif (n < 0 ) {\n\t\tif (slen % itemsize != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\n\t\t\tPy_DECREF(dtype);\n\t\t\treturn NULL;\n\t\t}\n\t\tn = slen/itemsize;\n\t} else {\n\t\tif (slen < n*itemsize) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\tPy_DECREF(dtype);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t dtype,\n\t\t\t\t\t\t\t 1, &n, \n\t\t\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t\t\t 0, NULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*dtype->elsize);\n\treturn (PyObject *)ret;\n}\n\nstatic char doc_fromString[] = \"fromstring(string, dtype=int, count=-1) returns a new 1d array initialized from the raw binary data in string. If count is positive, the new array will have count elements, otherwise it's size is determined by the size of string.\";\n\nstatic PyObject *\narray_fromString(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tchar *data;\n\tlonglong nin=-1;\n\tint s;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", NULL};\n\tPyArray_Descr *descr=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&L\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_DescrConverter, &descr,\n\t\t\t\t\t &nin)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromString(data, (intp)s, descr, (intp)nin);\n}\n\n/* This needs an open file object and reads it in directly. \n memory-mapped files handled differently through buffer interface.\n\nfile pointer number in resulting 1d array \n(can easily reshape later, -1 for to end of file)\ntype of array\nsep is a separator string for character-based data (or NULL for binary)\n \" \" means whitespace\n*/\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Descr *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\tBool binary;\n\n\tif (typecode->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"0-sized elements.\");\n\t\treturn NULL;\n\t}\n\n\tbinary = ((sep == NULL) || (strlen(sep) == 0));\n\tif (num == -1 && binary) { /* Get size for binary file*/\n\t\tintp start, numbytes;\n\t\tstart = (intp )ftell(fp);\n\t\tfseek(fp, 0, SEEK_END);\n\t\tnumbytes = (intp )ftell(fp) - start;\n\t\trewind(fp);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \n\t\t\t\t\t\"could not seek in file\");\n\t\t\treturn NULL;\n\t\t}\n\t\tnum = numbytes / typecode->elsize;\n\t}\n\t\n\tif (binary) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t typecode,\n\t\t\t\t\t\t\t 1, &num, \n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->elsize, num, fp);\n\t}\n\telse { /* character reading */\n\t\tintp i;\n\t\tchar *dptr;\n\t\tint done=0;\n\n\t\tscan = typecode->f->scanfunc;\n\t\tif (scan == NULL) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"don't know how to read \"\t\\\n\t\t\t\t\t\"character files with that \"\t\\\n\t\t\t\t\t\"array type\");\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (num != -1) { /* number to read is known */\n\t\t\tr = (PyArrayObject *)\\\n\t\t\t\tPyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t typecode, \n\t\t\t\t\t\t 1, &num, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\tdptr = r->data;\n\t\t\tfor (i=0; i < num; i++) {\n\t\t\t\tif (done) break;\n\t\t\t\tdone = scan(fp, dptr, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->descr->elsize;\n\t\t\t}\n\t\t\tif (PyErr_Occurred()) {\n\t\t\t\tPy_DECREF(r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\telse { /* we have to watch for the end of the file and \n\t\t\t reallocate at the end */\n#define _FILEBUFNUM 4096\n\t\t\tintp thisbuf=0;\n\t\t\tintp size = _FILEBUFNUM;\n\t\t\tintp bytes;\n\t\t\tintp totalbytes;\n\n\t\t\tr = (PyArrayObject *)\\\n\t\t\t\tPyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t typecode,\n\t\t\t\t\t\t 1, &size, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->elsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, sep, NULL);\n\n\t\t\t\t/* end of file reached trying to \n\t\t\t\t scan value. done is 1 or 2\n\t\t\t\t if end of file reached trying to\n\t\t\t\t scan separator. Still good value.\n\t\t\t\t*/\n\t\t\t\tif (done < -2) break;\n\t\t\t\tthisbuf += 1;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->descr->elsize;\n\t\t\t\tif (!done && thisbuf == size) {\n\t\t\t\t\ttotalbytes += bytes;\n\t\t\t\t\tr->data = PyDataMem_RENEW(r->data, \n\t\t\t\t\t\t\t\t totalbytes);\n\t\t\t\t\tdptr = r->data + (totalbytes - bytes);\n\t\t\t\t\tthisbuf = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (PyErr_Occurred()) {\n\t\t\t\tPy_DECREF(r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tr->data = PyDataMem_RENEW(r->data, nread*r->descr->elsize);\n\t\t\tPyArray_DIM(r,0) = nread;\n\t\t\tnum = nread;\n#undef _FILEBUFNUM\n\t\t}\n\t}\n\tif (nread < num) {\n\t\tfprintf(stderr, \"%ld items requested but only %ld read\\n\", \n\t\t\t(long) num, (long) nread);\n\t\tr->data = PyDataMem_RENEW(r->data, nread * r->descr->elsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=int, count=-1, sep='')\\n\"\t\\\n\t\"\\n\"\\\n\t\" Return an array of the given data type from a \\n\"\\\n\t\" (text or binary) file. The file argument can be an open file\\n\"\\\n\t\" or a string with the name of a file to read from. If\\n\"\\\n\t\" count==-1, then the entire file is read, otherwise count is\\n\"\\\n\t\" the number of items of the given type read in. If sep is ''\\n\"\\\n\t\" then read a binary file, otherwise it gives the separator\\n\"\\\n\t\" between elements in a text file.\\n\"\\\n\t\"\\n\"\\\n\t\" WARNING: This function should be used sparingly, as it is not\\n\"\\\n\t\" a robust method of persistence. But it can be useful to\\n\"\\\n\t\" read in simply-formatted or binary data quickly.\";\n\nstatic PyObject *\narray_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tPyObject *file=NULL, *ret;\n\tFILE *fp;\n\tchar *sep=\"\";\n\tchar *mode=NULL;\n\tlonglong nin=-1;\n\tstatic char *kwlist[] = {\"file\", \"dtype\", \"count\", \"sep\", NULL};\n\tPyArray_Descr *type=NULL;\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_DescrConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\n\n\tif (type == NULL) type = PyArray_DescrFromType(PyArray_LONG);\n\n\tif (PyString_Check(file)) {\n\t\tif (sep == \"\") mode=\"rb\";\n\t\telse mode=\"r\";\n\t\tfile = PyFile_FromString(PyString_AS_STRING(file), mode);\n\t\tif (file==NULL) return NULL;\n\t}\n\telse {\n\t\tPy_INCREF(file);\n\t}\n\tfp = PyFile_AsFile(file);\n\tif (fp == NULL) {\n\t\tPyErr_SetString(PyExc_IOError, \n\t\t\t\t\"first argument must be an open file\");\n\t\tPy_DECREF(file);\n\t\treturn NULL;\n\t}\n\tret = PyArray_FromFile(fp, type, (intp) nin, sep);\n\tPy_DECREF(file);\n\treturn ret;\n}\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Descr *type, \n\t\t intp count, intp offset) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\n\n\n\tif (type->type_num == PyArray_OBJECT) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"cannot create an OBJECT array from memory\"\\\n\t\t\t\t\" buffer\");\n\t\tPy_DECREF(type);\n\t\treturn NULL;\n\t}\n\tif (type->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"itemsize cannot be zero in type\");\n\t\tPy_DECREF(type);\n\t\treturn NULL; \t\t\n\t}\n\n\tif (buf->ob_type->tp_as_buffer == NULL || \\\n\t (buf->ob_type->tp_as_buffer->bf_getwritebuffer == NULL &&\t\\\n\t buf->ob_type->tp_as_buffer->bf_getreadbuffer == NULL)) {\n\t\tPyObject *newbuf;\n\t\tnewbuf = PyObject_GetAttrString(buf, \"__buffer__\");\n\t\tif (newbuf == NULL) {Py_DECREF(type); return NULL;}\n\t\tbuf = newbuf;\n\t}\n\telse {Py_INCREF(buf);}\n\n\tif (PyObject_AsWriteBuffer(buf, (void *)&data, &ts)==-1) {\n\t\twrite = 0;\n\t\tPyErr_Clear();\n\t\tif (PyObject_AsReadBuffer(buf, (void *)&data, &ts)==-1) {\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((offset < 0) || (offset >= ts)) {\n\t\tPyErr_Format(PyExc_ValueError,\n\t\t\t \"offset must be positive and smaller than %\"\n\t\t\t INTP_FMT, (intp)ts);\n\t}\n\n\tdata += offset;\n\ts = (intp)ts - offset;\n\tn = (intp)count;\n\titemsize = type->elsize;\n\t\n\tif (n < 0 ) {\n\t\tif (s % itemsize != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"buffer size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t\tn = s/itemsize;\n\t} else {\n\t\tif (s < n*itemsize) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"buffer is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t type, \n\t\t\t\t\t\t\t 1, &n, \n\t\t\t\t\t\t\t NULL, data, \n\t\t\t\t\t\t\t DEFAULT_FLAGS,\n\t\t\t\t\t\t\t NULL)) == NULL) {\n\t\tPy_DECREF(buf);\n\t\treturn NULL;\n\t}\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret;\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=int, count=-1, offset=0)\\n\"\\\n\t\"\\n\"\t\t\t\t\t\t\t\t\\\n\t\" Returns a 1-d array of data type dtype from buffer. The buffer\\n\"\\\n\t\" argument must be an object that exposes the buffer interface.\\n\"\\\n\t\" If count is -1 then the entire buffer is used, otherwise, count\\n\"\\\n\t\" is the size of the output. If offset is given then jump that\\n\"\\\n\t\" far into the buffer. If the buffer has data that is out\\n\" \\\n\t\" not in machine byte-order, than use a propert data type\\n\"\\\n\t\" descriptor. The data will not\\n\" \\\n\t\" be byteswapped, but the array will manage it in future\\n\"\\\n\t\" operations.\\n\";\n\nstatic PyObject *\narray_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tPyObject *obj=NULL;\n\tlonglong nin=-1, offset=0;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", NULL};\n\tPyArray_Descr *type=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&LL\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_DescrConverter, &type,\n\t\t\t\t\t &nin, &offset)) {\n\t\treturn NULL;\n\t}\n\tif (type==NULL)\n\t\ttype = PyArray_DescrFromType(PyArray_LONG);\n\t\n\treturn PyArray_FromBuffer(obj, type, (intp)nin, (intp)offset);\n}\n\n\nstatic char doc_concatenate[] = \"concatenate((a1,a2,...),axis=None).\";\n\nstatic PyObject *\narray_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds) \n{\n\tPyObject *a0;\n\tint axis=0;\n\tstatic char *kwlist[] = {\"seq\", \"axis\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O|O&\", kwlist,\n\t\t\t\t\t &a0,\n\t\t\t\t\t PyArray_AxisConverter, &axis))\n\t\treturn NULL;\n\treturn PyArray_Concatenate(a0, axis);\n}\n\nstatic char doc_innerproduct[] = \\\n\t\"inner(a,b) returns the dot product of two arrays, which has\\n\"\\\n\t\"shape a.shape[:-1] + b.shape[:-1] with elements computed by\\n\" \\\n\t\"the product of the elements from the last dimensions of a and b.\";\n\nstatic PyObject *array_innerproduct(PyObject *dummy, PyObject *args) {\n\tPyObject *b0, *a0;\n\t\n\tif (!PyArg_ParseTuple(args, \"OO\", &a0, &b0)) return NULL;\n\t\n\treturn _ARET(PyArray_InnerProduct(a0, b0));\n}\n\nstatic char doc_matrixproduct[] = \\\n\t\"dot(a,v) returns matrix-multiplication between a and b. \\n\"\\\n\t\"The product-sum is over the last dimension of a and the \\n\"\\\n\t\"second-to-last dimension of b.\";\n\nstatic PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) {\n\tPyObject *v, *a;\n\t\n\tif (!PyArg_ParseTuple(args, \"OO\", &a, &v)) return NULL;\n\t\n\treturn _ARET(PyArray_MatrixProduct(a, v));\n}\n\nstatic char doc_fastCopyAndTranspose[] = \"_fastCopyAndTranspose(a)\";\n\nstatic PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) {\n\tPyObject *a0;\n\t\n\tif (!PyArg_ParseTuple(args, \"O\", &a0)) return NULL;\n\t\n\treturn _ARET(PyArray_CopyAndTranspose(a0));\n}\n\nstatic char doc_correlate[] = \"cross_correlate(a,v, mode=0)\";\n\nstatic PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds) {\n\tPyObject *shape, *a0;\n\tint mode=0;\n\tstatic char *kwlist[] = {\"a\", \"v\", \"mode\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"OO|i\", kwlist, \n\t\t\t\t\t &a0, &shape, &mode)) return NULL;\n\t\n\treturn PyArray_Correlate(a0, shape, mode);\n}\n\n\n/*MULTIARRAY_API\n Arange, \n*/\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length;\n\tPyObject *range;\n\tPyArray_ArrFuncs *funcs;\n\tPyObject *obj;\n\tint ret;\n\n\tlength = (intp ) ceil((stop - start)/step);\n \n\tif (length <= 0) {\n\t\tlength = 0;\n\t\treturn PyArray_New(&PyArray_Type, 1, &length, type_num,\n\t\t\t\t NULL, NULL, 0, 0, NULL);\n\t}\n\n\trange = PyArray_New(&PyArray_Type, 1, &length, type_num, \n\t\t\t NULL, NULL, 0, 0, NULL);\n\tif (range == NULL) return NULL;\n\n\tfuncs = PyArray_DESCR(range)->f; \n\n\t/* place start in the buffer and the next value in the second position */\n\t/* if length > 2, then call the inner loop, otherwise stop */\n\n\tobj = PyFloat_FromDouble(start);\n\tret = funcs->setitem(obj, PyArray_DATA(range), (PyArrayObject *)range);\n\tPy_DECREF(obj);\n\tif (ret < 0) goto fail;\n\tif (length == 1) return range;\n\n\tobj = PyFloat_FromDouble(start + step);\n\tret = funcs->setitem(obj, PyArray_DATA(range)+PyArray_ITEMSIZE(range), \n\t\t\t (PyArrayObject *)range);\n\tPy_DECREF(obj);\n\tif (ret < 0) goto fail;\n\tif (length == 2) return range;\n\n\tif (!funcs->fill) {\n\t\tPyErr_SetString(PyExc_ValueError, \"no fill-function for data-type.\");\n\t\tPy_DECREF(range);\n\t\treturn NULL;\n\t}\n\tfuncs->fill(PyArray_DATA(range), length, (PyArrayObject *)range);\n\tif (PyErr_Occurred()) goto fail;\n\t\n\treturn range;\n\n fail:\n\tPy_DECREF(range);\n\treturn NULL;\n}\n\n/* the formula is \n len = (intp) ceil((start - stop) / step);\n*/\nstatic intp\n_calc_length(PyObject *start, PyObject *stop, PyObject *step, PyObject **next, int cmplx)\n{\n\tintp len;\n\tPyObject *val;\n\tdouble value;\n\t\n\t*next = PyNumber_Subtract(stop, start);\n\tif (!(*next)) return -1;\n\tval = PyNumber_TrueDivide(*next, step);\n\tPy_DECREF(*next); *next=NULL;\n\tif (!val) return -1;\n\tif (cmplx && PyComplex_Check(val)) {\n\t\tvalue = PyComplex_RealAsDouble(val);\n\t\tif (error_converting(value)) {Py_DECREF(val); return -1;}\n\t\tlen = (intp) ceil(value);\n\t\tvalue = PyComplex_ImagAsDouble(val);\n\t\tPy_DECREF(val);\n\t\tif (error_converting(value)) return -1;\n\t\tlen = MIN(len, (intp) ceil(value));\n\t}\n\telse {\n\t\tvalue = PyFloat_AsDouble(val);\n\t\tPy_DECREF(val);\n\t\tif (error_converting(value)) return -1;\n\t\tlen = (intp) ceil(value);\n\t}\n\t\n\tif (len > 0) {\n\t\t*next = PyNumber_Add(start, step);\n\t\tif (!next) return -1;\n\t}\n\treturn len;\n}\n\n/* this doesn't change the references */\n/*MULTIARRAY_API\n ArangeObj,\n*/\nstatic PyObject *\nPyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr *dtype) \n{\n\tPyObject *range;\n\tPyArray_ArrFuncs *funcs;\n\tPyObject *next;\n\tintp length;\n\n\tif (!dtype) {\n\t\tPyArray_Descr *deftype;\n\t\tPyArray_Descr *newtype;\n\t\tdeftype = PyArray_DescrFromType(PyArray_LONG);\n\t\tnewtype = PyArray_DescrFromObject(start, deftype);\n\t\tPy_DECREF(deftype);\n\t\tdeftype = newtype;\n\t\tif (stop && stop != Py_None) {\n\t\t\tnewtype = PyArray_DescrFromObject(stop, deftype);\n\t\t\tPy_DECREF(deftype);\n\t\t\tdeftype = newtype;\n\t\t}\n\t\tif (step && step != Py_None) {\n\t\t\tnewtype = PyArray_DescrFromObject(step, deftype);\n\t\t\tPy_DECREF(deftype);\n\t\t\tdeftype = newtype;\n\t\t}\n\t\tdtype = deftype;\n\t}\n\telse Py_INCREF(dtype);\n\n\tif (!step || step == Py_None) {\n\t\tstep = PyInt_FromLong(1);\n\t}\n\telse Py_XINCREF(step);\n\n\tif (!stop || stop == Py_None) {\n\t\tstop = start;\n\t\tstart = PyInt_FromLong(0);\n\t}\n\telse Py_INCREF(start);\n\n\t/* calculate the length and next = start + step*/\n\tlength = _calc_length(start, stop, step, &next, \n\t\t\t PyTypeNum_ISCOMPLEX(dtype->type_num));\n\n\tif (PyErr_Occurred()) {Py_DECREF(dtype); goto fail;}\n\tif (length <= 0) {\n\t\tlength = 0;\n\t\trange = PyArray_SimpleNewFromDescr(1, &length, dtype);\n\t\tPy_DECREF(step); Py_DECREF(start); return range;\n\t}\n\n\trange = PyArray_SimpleNewFromDescr(1, &length, dtype);\n\tif (range == NULL) goto fail;\n\n\tfuncs = PyArray_DESCR(range)->f;\n\n\t/* place start in the buffer and the next value in the second position */\n\t/* if length > 2, then call the inner loop, otherwise stop */\n\n\tif (funcs->setitem(start, PyArray_DATA(range), (PyArrayObject *)range) < 0)\n\t\tgoto fail;\n\tif (length == 1) goto finish;\n\tif (funcs->setitem(next, PyArray_DATA(range)+PyArray_ITEMSIZE(range), \n\t\t\t (PyArrayObject *)range) < 0) goto fail;\n\tif (length == 2) goto finish;\n\n\tif (!funcs->fill) {\n\t\tPyErr_SetString(PyExc_ValueError, \"no fill-function for data-type.\");\n\t\tPy_DECREF(range);\n\t\tgoto fail;\n\t}\n\tfuncs->fill(PyArray_DATA(range), length, (PyArrayObject *)range);\n\tif (PyErr_Occurred()) goto fail;\n\n finish:\n\tPy_DECREF(start);\n\tPy_DECREF(step);\n\tPy_DECREF(next);\n\treturn range;\n\t\n fail:\n\tPy_DECREF(start);\n\tPy_DECREF(step);\n\tPy_XDECREF(next);\n\treturn NULL;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=int)\\n\\n Just like range() except it returns an array whose type can be\\n specified by the keyword argument typecode.\";\n\nstatic PyObject *\narray_arange(PyObject *ignored, PyObject *args, PyObject *kws) {\n\tPyObject *o_start=NULL, *o_stop=NULL, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tPyArray_Descr *typecode=NULL;\n\t\n\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|OOO&\", kwd, &o_start,\n\t\t\t\t\t&o_stop, &o_step, \n\t\t\t\t\tPyArray_DescrConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\treturn PyArray_ArangeObj(o_start, o_stop, o_step, typecode);\n}\n\n\nstatic char \ndoc_set_string_function[] = \"set_string_function(f, repr=1) sets the python function f to be the function used to obtain a pretty printable string version of a array whenever a array is printed. f(M) should expect a array argument M, and should return a string consisting of the desired representation of M for printing.\";\n\nstatic PyObject *\narray_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds) \n{\n\tPyObject *op;\n\tint repr=1;\n\tstatic char *kwlist[] = {\"f\", \"repr\", NULL};\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kwds, \"O|i\", kwlist, \n\t\t\t\t\t&op, &repr)) return NULL; \n\tif (!PyCallable_Check(op)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Argument must be callable.\");\n\t\treturn NULL;\n\t}\n\tPyArray_SetStringFunction(op, repr);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic char \ndoc_set_ops_function[] = \"set_numeric_ops(op=func, ...) sets some or all of the number methods for all array objects. Don't forget **dict can be used as the argument list. Returns the functions that were replaced -- can be stored and set later.\";\n\nstatic PyObject *\narray_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds) \n{\n\tPyObject *oldops=NULL;\n\t\n\tif ((oldops = PyArray_GetNumericOps())==NULL) return NULL;\n\n\t/* Should probably ensure that objects are at least callable */\n\t/* Leave this to the caller for now --- error will be raised\n\t later when use is attempted \n\t*/\n\tif (kwds && PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"one or more objects not callable\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\n\n/*MULTIARRAY_API\n Where\n*/\nstatic PyObject *\nPyArray_Where(PyObject *condition, PyObject *x, PyObject *y)\n{\n\tPyArrayObject *arr;\n\tPyObject *tup=NULL, *obj=NULL;\n\tPyObject *ret=NULL, *zero=NULL;\n\n\n\tarr = (PyArrayObject *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n\tif (arr == NULL) return NULL;\n\n\tif ((x==NULL) && (y==NULL)) {\n\t\tret = PyArray_Nonzero(arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\n\n\tif ((x==NULL) || (y==NULL)) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \"either both or neither \"\n\t\t\t\t\"of x and y should be given\");\n\t\treturn NULL;\n\t}\n\n\n\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, \n\t\t\t\t\t\t\t\tn_ops.not_equal));\n\tPy_DECREF(zero);\n\tPy_DECREF(arr);\n\tif (obj == NULL) return NULL;\n\n\ttup = Py_BuildValue(\"(OO)\", y, x);\n\tif (tup == NULL) {Py_DECREF(obj); return NULL;}\n\n\tret = PyArray_Choose((PyAO *)obj, tup);\n\n\tPy_DECREF(obj);\n\tPy_DECREF(tup);\n\treturn ret;\n}\n\nstatic char doc_where[] = \"where(condition, | x, y) is shaped like condition\"\\\n\t\" and has elements of x and y where condition is respectively true or\"\\\n\t\" false. If x or y are not given, then it is equivalent to\"\\\n\t\" nonzero(condition).\";\n\nstatic PyObject *\narray_where(PyObject *ignored, PyObject *args)\n{\n\tPyObject *obj=NULL, *x=NULL, *y=NULL;\n\t\n\tif (!PyArg_ParseTuple(args, \"O|OO\", &obj, &x, &y)) return NULL;\n\n\treturn PyArray_Where(obj, x, y);\n\n}\n\nstatic char doc_lexsort[] = \"lexsort(keys=, axis=-1) returns an array of indexes\"\\\n\t\" similar to argsort except the sorting is done using the provided sorting\"\\\n\t\" keys. First the sort is done using key[0], then the resulting list of\"\\\n\t\" indexes is further manipulated by sorting on key[0]. And so forth\"\\\n\t\" The result is a sort on multiple keys. If the keys represented columns\" \\\n\t\" of a spread-sheet, for example, this would sort using multiple columns.\"\\\n\t\" The keys argument must be a tuple of things that can be converted to \"\\\n\t\" arrays of the same shape.\";\n\nstatic PyObject *\narray_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds)\n{\n\tint axis=-1;\n\tPyObject *obj;\n\tstatic char *kwlist[] = {\"keys\", \"axis\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O!|i\", kwlist, \n\t\t\t\t\t &PyTuple_Type, &obj, &axis)) return NULL;\n\t\n\treturn _ARET(PyArray_LexSort(obj, axis));\n}\n\n#undef _ARET\n\n\nstatic char doc_register_dtype[] = \\\n\t\"register_dtype(a) registers a new type object -- gives it a typenum\";\n\nstatic PyObject *\narray_register_dtype(PyObject *dummy, PyObject *args)\n{\n\tPyObject *dtype;\n\tint ret;\n\t\n\tif (!PyArg_ParseTuple(args, \"O\", &dtype)) return NULL;\n\t\n\tret = PyArray_RegisterDataType((PyTypeObject *)dtype);\n\tif (ret < 0)\n\t\treturn NULL;\n\treturn PyInt_FromLong((long) ret);\n}\n\nstatic char doc_can_cast_safely[] = \\\n\t\"can_cast_safely(from=d1, to=d2) returns True if data type d1 \"\\\n\t\"can be cast to data type d2 without losing precision.\";\n\nstatic PyObject *\narray_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds)\n{\n\tPyArray_Descr *d1=NULL;\n\tPyArray_Descr *d2=NULL;\n\tBool ret;\n\tPyObject *retobj;\n\tstatic char *kwlist[] = {\"from\", \"to\", NULL};\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kwds, \"O&O&\", kwlist, \n\t\t\t\t\tPyArray_DescrConverter, &d1,\n\t\t\t\t\tPyArray_DescrConverter, &d2))\n\t\treturn NULL;\n\tif (d1 == NULL || d2 == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types; \"\t\\\n\t\t\t\t\"'None' not accepted\");\n\t\treturn NULL;\n\t}\n\t\t\n\tret = PyArray_CanCastTo(d1, d2);\n\tretobj = (ret ? Py_True : Py_False);\n\tPy_INCREF(retobj);\n\treturn retobj;\n}\n\nstatic char doc_new_buffer[] = \\\n\t\"newbuffer(size) return a new uninitialized buffer object of size \"\n\t\"bytes\";\n\nstatic PyObject *\nnew_buffer(PyObject *dummy, PyObject *args)\n{\n\tint size;\n\n\tif(!PyArg_ParseTuple(args, \"i\", &size))\n\t\treturn NULL;\n\t\n\treturn PyBuffer_New(size);\n}\n\nstatic char doc_buffer_buffer[] = \\\n\t\"getbuffer(obj [,offset[, size]]) create a buffer object from the \"\\\n\t\"given object\\n referencing a slice of length size starting at \"\\\n\t\"offset. Default\\n is the entire buffer. A read-write buffer is \"\\\n\t\"attempted followed by a read-only buffer.\";\n\nstatic PyObject *\nbuffer_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj;\n\tint offset=0, size=Py_END_OF_BUFFER, n;\n\tvoid *unused;\n\tstatic char *kwlist[] = {\"object\", \"offset\", \"size\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O|ii\", kwlist, \n\t\t\t\t\t &obj, &offset, &size))\n\t\treturn NULL;\n\n\n\tif (PyObject_AsWriteBuffer(obj, &unused, &n) < 0) {\n\t\tPyErr_Clear();\n\t\treturn PyBuffer_FromObject(obj, offset, size);\t\t\n\t}\n\telse\n\t\treturn PyBuffer_FromReadWriteObject(obj, offset, size);\n}\n\n\nstatic struct PyMethodDef array_module_methods[] = {\n\t{\"set_string_function\", (PyCFunction)array_set_string_function, \n\t METH_VARARGS|METH_KEYWORDS, doc_set_string_function},\n\t{\"set_numeric_ops\", (PyCFunction)array_set_ops_function,\n\t METH_VARARGS|METH_KEYWORDS, doc_set_ops_function},\n\t{\"set_typeDict\", (PyCFunction)array_set_typeDict,\n\t METH_VARARGS, doc_set_typeDict},\n\n\t{\"array\",\t(PyCFunction)_array_fromobject, \n\t METH_VARARGS|METH_KEYWORDS, doc_fromobject},\n\t{\"arange\", (PyCFunction)array_arange, \n\t METH_VARARGS|METH_KEYWORDS, doc_arange},\n\t{\"zeros\",\t(PyCFunction)array_zeros, \n\t METH_VARARGS|METH_KEYWORDS, doc_zeros},\n\t{\"empty\",\t(PyCFunction)array_empty, \n\t METH_VARARGS|METH_KEYWORDS, doc_empty},\n\t{\"scalar\", (PyCFunction)array_scalar,\n\t METH_VARARGS|METH_KEYWORDS, doc_scalar},\n\t{\"where\", (PyCFunction)array_where,\n\t METH_VARARGS, doc_where},\n\t{\"lexsort\", (PyCFunction)array_lexsort,\n\t METH_VARARGS | METH_KEYWORDS, doc_lexsort},\n\t{\"fromstring\",(PyCFunction)array_fromString,\n\t METH_VARARGS|METH_KEYWORDS, doc_fromString},\n\t{\"concatenate\", (PyCFunction)array_concatenate, \n\t METH_VARARGS|METH_KEYWORDS, doc_concatenate},\n\t{\"inner\", (PyCFunction)array_innerproduct, \n\t METH_VARARGS, doc_innerproduct}, \n\t{\"dot\", (PyCFunction)array_matrixproduct, \n\t METH_VARARGS, doc_matrixproduct}, \n\t{\"_fastCopyAndTranspose\", (PyCFunction)array_fastCopyAndTranspose, \n\t METH_VARARGS, doc_fastCopyAndTranspose},\n\t{\"correlate\", (PyCFunction)array_correlate, \n\t METH_VARARGS | METH_KEYWORDS, doc_correlate},\n\t{\"frombuffer\", (PyCFunction)array_frombuffer,\n\t METH_VARARGS | METH_KEYWORDS, doc_frombuffer},\n\t{\"fromfile\", (PyCFunction)array_fromfile,\n\t METH_VARARGS | METH_KEYWORDS, doc_fromfile},\n\t{\"register_dtype\", (PyCFunction)array_register_dtype,\n\t METH_VARARGS, doc_register_dtype},\n\t{\"can_cast\", (PyCFunction)array_can_cast_safely,\n\t METH_VARARGS | METH_KEYWORDS, doc_can_cast_safely},\t\t\n\t{\"newbuffer\", (PyCFunction)new_buffer,\n\t METH_VARARGS, doc_new_buffer},\t\n\t{\"getbuffer\", (PyCFunction)buffer_buffer,\n\t METH_VARARGS | METH_KEYWORDS, doc_buffer_buffer},\t\n\t{NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\n#include \"__multiarray_api.c\"\n\n/* Establish scalar-type hierarchy */\n\n/* For dual inheritance we need to make sure that the objects being\n inherited from have the tp->mro object initialized. This is\n not necessarily true for the basic type objects of Python (it is \n checked for single inheritance but not dual in PyType_Ready).\n\n Thus, we call PyType_Ready on the standard Python Types, here.\n*/ \nstatic int\nsetup_scalartypes(PyObject *dict)\n{\n\n\tinitialize_numeric_types();\n\n if (PyType_Ready(&PyBool_Type) < 0) return -1;\n if (PyType_Ready(&PyInt_Type) < 0) return -1;\n if (PyType_Ready(&PyFloat_Type) < 0) return -1;\n if (PyType_Ready(&PyComplex_Type) < 0) return -1;\n if (PyType_Ready(&PyString_Type) < 0) return -1;\n if (PyType_Ready(&PyUnicode_Type) < 0) return -1;\n\n#define SINGLE_INHERIT(child, parent) \\\n Py##child##ArrType_Type.tp_base = &Py##parent##ArrType_Type;\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) {\t\t\\\n PyErr_Print(); \\\n PyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1;\t\t\t\t\t\t\\\n }\n \n if (PyType_Ready(&PyGenericArrType_Type) < 0)\n return -1;\n\n SINGLE_INHERIT(Number, Generic);\n SINGLE_INHERIT(Integer, Number);\n SINGLE_INHERIT(Inexact, Number);\n SINGLE_INHERIT(SignedInteger, Integer);\n SINGLE_INHERIT(UnsignedInteger, Integer);\n SINGLE_INHERIT(Floating, Inexact);\n SINGLE_INHERIT(ComplexFloating, Inexact);\n SINGLE_INHERIT(Flexible, Generic);\n SINGLE_INHERIT(Character, Flexible);\n\t\n#define DUAL_INHERIT(child, parent1, parent2) \\\n Py##child##ArrType_Type.tp_base = &Py##parent2##ArrType_Type;\t\\\n Py##child##ArrType_Type.tp_bases = \\\n Py_BuildValue(\"(OO)\", &Py##parent2##ArrType_Type,\t\\\n\t\t\t &Py##parent1##_Type);\t\t\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) { \\\n PyErr_Print(); \\\n\t\tPyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1; \\\n }\\\n Py##child##ArrType_Type.tp_hash = Py##parent1##_Type.tp_hash;\n\n#define DUAL_INHERIT2(child, parent1, parent2)\t\t\t\t\\\n Py##child##ArrType_Type.tp_base = &Py##parent1##_Type;\t\t\\\n Py##child##ArrType_Type.tp_bases = \\\n Py_BuildValue(\"(OO)\", &Py##parent1##_Type,\t\t\\\n\t\t\t &Py##parent2##ArrType_Type);\t\t\\\n\tPy##child##ArrType_Type.tp_richcompare =\t\t\t\\\n\t\tPy##parent1##_Type.tp_richcompare;\t\t\t\\\n\tPy##child##ArrType_Type.tp_compare =\t\t\t\t\\\n\t\tPy##parent1##_Type.tp_compare;\t\t\t\t\\\n Py##child##ArrType_Type.tp_hash = Py##parent1##_Type.tp_hash;\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) { \\\n PyErr_Print(); \\\n\t\tPyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1; \\\n }\n\n SINGLE_INHERIT(Bool, Generic);\n SINGLE_INHERIT(Byte, SignedInteger);\n SINGLE_INHERIT(Short, SignedInteger);\n#if SIZEOF_INT == SIZEOF_LONG\n DUAL_INHERIT(Int, Int, SignedInteger);\n#else\n SINGLE_INHERIT(Int, SignedInteger);\n#endif\n DUAL_INHERIT(Long, Int, SignedInteger);\n#if SIZEOF_LONGLONG == SIZEOF_LONG\n DUAL_INHERIT(LongLong, Int, SignedInteger);\n#else\n SINGLE_INHERIT(LongLong, SignedInteger);\n#endif\n\n /* fprintf(stderr, \"tp_free = %p, PyObject_Del = %p, int_tp_free = %p, base.tp_free = %p\\n\", PyIntArrType_Type.tp_free, PyObject_Del, PyInt_Type.tp_free, PySignedIntegerArrType_Type.tp_free);\n\t */\n\tSINGLE_INHERIT(UByte, UnsignedInteger);\n SINGLE_INHERIT(UShort, UnsignedInteger);\n SINGLE_INHERIT(UInt, UnsignedInteger);\n SINGLE_INHERIT(ULong, UnsignedInteger);\n SINGLE_INHERIT(ULongLong, UnsignedInteger);\n\n SINGLE_INHERIT(Float, Floating);\n DUAL_INHERIT(Double, Float, Floating);\n SINGLE_INHERIT(LongDouble, Floating);\n\n SINGLE_INHERIT(CFloat, ComplexFloating);\n DUAL_INHERIT(CDouble, Complex, ComplexFloating);\n SINGLE_INHERIT(CLongDouble, ComplexFloating);\n\n DUAL_INHERIT2(String, String, Character);\n DUAL_INHERIT2(Unicode, Unicode, Character);\n\t\n SINGLE_INHERIT(Void, Flexible);\n \n SINGLE_INHERIT(Object, Generic);\n\n return 0;\n\n#undef SINGLE_INHERIT\n#undef DUAL_INHERIT\n\n\t/* Clean up string and unicode array types so they act more like\n\t strings -- get their tables from the standard types.\n\t*/\n}\n\n/* place a flag dictionary in d */\n\nstatic void\nset_flaginfo(PyObject *d)\n{\n PyObject *s;\n PyObject *newd;\n \n newd = PyDict_New();\n\n PyDict_SetItemString(newd, \"OWNDATA\", s=PyInt_FromLong(OWNDATA));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"FORTRAN\", s=PyInt_FromLong(FORTRAN));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"CONTIGUOUS\", s=PyInt_FromLong(CONTIGUOUS));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"ALIGNED\", s=PyInt_FromLong(ALIGNED));\n Py_DECREF(s);\n\n PyDict_SetItemString(newd, \"UPDATEIFCOPY\", s=PyInt_FromLong(UPDATEIFCOPY));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"WRITEABLE\", s=PyInt_FromLong(WRITEABLE));\n Py_DECREF(s);\n \n PyDict_SetItemString(d, \"_flagdict\", newd);\n Py_DECREF(newd);\n return;\n}\n\n\n/* Initialization function for the module */\n\nDL_EXPORT(void) initmultiarray(void) {\n\tPyObject *m, *d, *s;\n\tPyObject *c_api;\n\t\n\t/* Create the module and add the functions */\n\tm = Py_InitModule(\"multiarray\", array_module_methods);\n\tif (!m) goto err;\n\n\t/* Add some symbolic constants to the module */\n\td = PyModule_GetDict(m);\n\tif (!d) goto err; \n\n\t/* Create the module and add the functions */\n\tif (PyType_Ready(&PyBigArray_Type) < 0) \n\t\treturn;\n\n PyArray_Type.tp_base = &PyBigArray_Type;\n\n PyArray_Type.tp_as_mapping = &array_as_mapping;\n\t/* Even though, this would be inherited, it needs to be set now\n\t so that the __getitem__ will map to the as_mapping descriptor\n\t*/\n PyArray_Type.tp_as_number = &array_as_number; \n\t/* For good measure */\n\tPyArray_Type.tp_as_sequence = &array_as_sequence;\n\tPyArray_Type.tp_as_buffer = &array_as_buffer;\t\n PyArray_Type.tp_flags = (Py_TPFLAGS_DEFAULT \n\t\t\t\t | Py_TPFLAGS_BASETYPE\n\t\t\t\t | Py_TPFLAGS_CHECKTYPES);\n PyArray_Type.tp_doc = Arraytype__doc__;\n\n\tif (PyType_Ready(&PyArray_Type) < 0)\n return;\n\n if (setup_scalartypes(d) < 0) goto err;\n\n\tPyArrayIter_Type.tp_iter = PyObject_SelfIter;\n\tPyArrayMultiIter_Type.tp_iter = PyObject_SelfIter;\n\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n return; \n\n\tif (PyType_Ready(&PyArrayMultiIter_Type) < 0)\n\t\treturn;\n\n\tif (PyType_Ready(&PyArrayDescr_Type) < 0)\n\t\treturn;\n\n\tc_api = PyCObject_FromVoidPtr((void *)PyArray_API, NULL);\n\tif (PyErr_Occurred()) goto err;\n\tPyDict_SetItemString(d, \"_ARRAY_API\", c_api);\n\tPy_DECREF(c_api);\n\tif (PyErr_Occurred()) goto err;\n\n\tMultiArrayError = PyString_FromString (\"multiarray.error\");\n\tPyDict_SetItemString (d, \"error\", MultiArrayError);\n\t\n\ts = PyString_FromString(\"3.0\");\n\tPyDict_SetItemString(d, \"__version__\", s);\n\tPy_DECREF(s);\n Py_INCREF(&PyBigArray_Type);\n\tPyDict_SetItemString(d, \"bigndarray\", (PyObject *)&PyBigArray_Type);\n Py_INCREF(&PyArray_Type);\n\tPyDict_SetItemString(d, \"ndarray\", (PyObject *)&PyArray_Type);\n Py_INCREF(&PyArrayIter_Type);\n\tPyDict_SetItemString(d, \"flatiter\", (PyObject *)&PyArrayIter_Type);\n Py_INCREF(&PyArrayMultiIter_Type);\n\tPyDict_SetItemString(d, \"broadcast\", \n\t\t\t (PyObject *)&PyArrayMultiIter_Type);\n\tPy_INCREF(&PyArrayDescr_Type);\n\tPyDict_SetItemString(d, \"dtypedescr\", (PyObject *)&PyArrayDescr_Type);\n\n\t/* Doesn't need to be exposed to Python \n Py_INCREF(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\t*/\n set_flaginfo(d);\n\n\tif (set_typeinfo(d) != 0) goto err;\n\n\t_numpy_internal =\t\t\t\t\t\t\\\n\t\tPyImport_ImportModule(\"numpy.core._internal\");\n\tif (_numpy_internal != NULL) return;\n\n err:\t\n\t/* Check for errors */\n\tif (PyErr_Occurred())\n PyErr_Print();\n\t\tPy_FatalError(\"can't initialize module multiarray\");\n\n\treturn;\n}\n\n", + "source_code_before": "/*\n Python Multiarray Module -- A useful collection of functions for creating and\n using ndarrays\n\n Original file \n Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu\n\n Modified for numpy_core in 2005 \n\n Travis E. Oliphant\n Assistant Professor at\n Brigham Young University\n \n*/\n\n/* $Id: multiarraymodule.c,v 1.36 2005/09/14 00:14:00 teoliphant Exp $ */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n/*#include \n#include \n*/\n\n#define _MULTIARRAYMODULE\n#include \"numpy/arrayobject.h\"\n\n#define PyAO PyArrayObject\n\nstatic PyObject *typeDict=NULL; /* Must be explicitly loaded */\nstatic PyObject *_numpy_internal=NULL; /* A Python module for callbacks */\n\n\nstatic PyArray_Descr *\n_arraydescr_fromobj(PyObject *obj)\n{\n\tPyObject *dtypedescr;\n\tPyArray_Descr *new;\n\tint ret;\n\t\n\tdtypedescr = PyObject_GetAttrString(obj, \"dtypedescr\");\n\tPyErr_Clear();\n\tif (dtypedescr) {\n\t\tret = PyArray_DescrConverter(dtypedescr, &new);\n\t\tPy_DECREF(dtypedescr);\n\t\tif (ret) return new;\n\t\tPyErr_Clear();\n\t}\n\treturn NULL;\n}\n\n\n/* Including this file is the only way I know how to declare functions\n static in each file, and store the pointers from functions in both\n arrayobject.c and multiarraymodule.c for the C-API \n\n Declarying an external pointer-containing variable in arrayobject.c\n and trying to copy it to PyArray_API, did not work.\n\n Think about two modules with a common api that import each other...\n\n This file would just be the module calls. \n*/\n\n#include \"arrayobject.c\"\n\n\n/* An Error object -- rarely used? */\nstatic PyObject *MultiArrayError;\n\n/*MULTIARRAY_API\n Multiply a List of ints\n*/\nstatic int\nPyArray_MultiplyIntList(register int *l1, register int n) \n{\n\tregister int s=1;\n while (n--) s *= (*l1++);\n return s;\n}\n\n/*MULTIARRAY_API\n Multiply a List\n*/\nstatic intp \nPyArray_MultiplyList(register intp *l1, register int n) \n{\n\tregister intp s=1;\n while (n--) s *= (*l1++);\n return s;\n}\n\n/*MULTIARRAY_API\n Produce a pointer into array\n*/\nstatic char *\nPyArray_GetPtr(PyArrayObject *obj, register intp* ind)\n{\n\tregister int n = obj->nd;\n\tregister intp *strides = obj->strides;\n\tregister char *dptr = obj->data;\n\t\n\twhile (n--) dptr += (*strides++) * (*ind++);\n\treturn dptr;\n}\n\n/*MULTIARRAY_API\n Get axis from an object (possibly None) -- a converter function,\n*/\nstatic int \nPyArray_AxisConverter(PyObject *obj, int *axis)\n{\n\tif (obj == Py_None) {\n\t\t*axis = MAX_DIMS;\n\t}\n\telse {\n\t\t*axis = (int) PyInt_AsLong(obj);\n\t\tif (PyErr_Occurred()) {\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n\treturn PY_SUCCEED;\n}\n\n/*MULTIARRAY_API\n Compare Lists\n*/\nstatic int \nPyArray_CompareLists(intp *l1, intp *l2, int n) \n{\n int i;\n for(i=0;idescr);\n\tnew = PyArray_NewFromDescr(self->ob_type,\n\t\t\t\t self->descr,\n\t\t\t\t self->nd, self->dimensions,\n\t\t\t\t self->strides,\n\t\t\t\t self->data,\n\t\t\t\t self->flags, (PyObject *)self);\n\t\n\tif (new==NULL) return NULL;\n\tPy_INCREF(self);\n PyArray_BASE(new) = (PyObject *)self;\n\t\n\tif (type != NULL) {\n\t\tif (PyObject_SetAttrString(new, \"dtypedescr\", \n\t\t\t\t\t (PyObject *)type) < 0) {\n\t\t\tPy_DECREF(new);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t\tPy_DECREF(type);\n\t}\n\treturn new;\t\n}\n\n/*MULTIARRAY_API\n Ravel\n*/\nstatic PyObject *\nPyArray_Ravel(PyArrayObject *a, int fortran)\n{\n\tPyArray_Dims newdim = {NULL,1};\n\tintp val[1] = {-1};\n\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(a);\n\n\tnewdim.ptr = val;\n\tif (!fortran && PyArray_ISCONTIGUOUS(a)) {\n\t\tif (a->nd == 1) {\n\t\t\tPy_INCREF(a);\n\t\t\treturn (PyObject *)a;\n\t\t}\n\t\treturn PyArray_Newshape(a, &newdim);\n\t}\n\telse\n\t return PyArray_Flatten(a, fortran);\n}\n\n/*MULTIARRAY_API\n Flatten\n*/\nstatic PyObject *\nPyArray_Flatten(PyArrayObject *a, int fortran)\n{\n\tPyObject *ret, *new;\n\tintp size;\n\n\tif (fortran < 0) fortran = PyArray_ISFORTRAN(a);\n\n\tsize = PyArray_SIZE(a);\n\tPy_INCREF(a->descr);\n\tret = PyArray_NewFromDescr(a->ob_type,\n\t\t\t\t a->descr,\n\t\t\t\t 1, &size,\n\t\t\t\t NULL,\n\t\t\t\t NULL,\n\t\t\t\t 0, (PyObject *)a);\n\t\n\tif (ret== NULL) return NULL;\n\tif (fortran) {\n\t\tnew = PyArray_Transpose(a, NULL);\n\t\tif (new == NULL) {\n\t\t\tPy_DECREF(ret);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\telse {\n\t\tPy_INCREF(a);\n\t\tnew = (PyObject *)a;\n\t}\n\tif (PyArray_CopyInto((PyArrayObject *)ret, (PyArrayObject *)new) < 0) {\n\t\tPy_DECREF(ret);\n\t\tPy_DECREF(new);\n\t\treturn NULL;\n\t}\n\tPy_DECREF(new);\n\treturn ret;\n}\n\n\n/* For back-ward compatability *\n\n/ * Not recommended */\n\n/*MULTIARRAY_API\n Reshape an array\n*/\nstatic PyObject *\nPyArray_Reshape(PyArrayObject *self, PyObject *shape) \n{\n PyObject *ret;\n PyArray_Dims newdims;\n\n if (!PyArray_IntpConverter(shape, &newdims)) return NULL;\n ret = PyArray_Newshape(self, &newdims);\n PyDimMem_FREE(newdims.ptr);\n return ret;\n}\n\nstatic int\n_check_ones(PyArrayObject *self, int newnd, intp* newdims, intp *strides)\n{\n\tint nd;\n\tintp *dims;\n\tBool done=FALSE;\n\tint j, k;\n\n\tnd = self->nd;\n\tdims = self->dimensions;\n\n\tfor (k=0, j=0; !done && (jstrides[j];\n\t\t\tj++; k++;\n\t\t}\n\t\telse if ((kptr;\n PyArrayObject *ret;\n\tchar msg[] = \"total size of new array must be unchanged\";\n\tint n = newdims->len;\n Bool same;\n\tintp *strides = NULL;\n\tintp newstrides[MAX_DIMS];\n\n /* Quick check to make sure anything needs to be done */\n if (n == self->nd) {\n same = TRUE;\n i=0;\n while(same && i= 0) {\n\t\t\tif ((s_known == 0) || (s_original % s_known != 0)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tdimensions[i_unknown] = s_original/s_known;\n\t\t} else {\n\t\t\tif (s_original != s_known) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, msg);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}\n \n\tPy_INCREF(self->descr);\n\tret = (PyAO *)PyArray_NewFromDescr(self->ob_type,\n\t\t\t\t\t self->descr,\n\t\t\t\t\t n, dimensions,\n\t\t\t\t\t strides,\n\t\t\t\t\t self->data,\n\t\t\t\t\t self->flags, (PyObject *)self);\n\t\n\tif (ret== NULL) return NULL;\n\t\n Py_INCREF(self);\n ret->base = (PyObject *)self;\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\n\t\n return (PyObject *)ret;\n}\n\n/* return a new view of the array object with all of its unit-length \n dimensions squeezed out if needed, otherwise\n return the same array.\n */\n\n/*MULTIARRAY_API*/\nstatic PyObject *\nPyArray_Squeeze(PyArrayObject *self)\n{\n\tint nd = self->nd;\n\tint newnd = nd;\n\tintp dimensions[MAX_DIMS];\n\tintp strides[MAX_DIMS];\n\tint i,j;\n\tPyObject *ret;\n\n\tif (nd == 0) {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *)self;\n\t}\n\tfor (j=0, i=0; idimensions[i] == 1) {\n\t\t\tnewnd -= 1;\n\t\t}\n\t\telse {\n\t\t\tdimensions[j] = self->dimensions[i];\n\t\t\tstrides[j++] = self->strides[i];\n\t\t}\n\t}\n\t\n\tPy_INCREF(self->descr);\n\tret = PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t self->descr,\n\t\t\t\t newnd, dimensions, \n\t\t\t\t strides, self->data, \n\t\t\t\t self->flags,\n\t\t\t\t (PyObject *)self);\n\tif (ret == NULL) return NULL;\n\tPyArray_FLAGS(ret) &= ~OWN_DATA;\n\tPyArray_BASE(ret) = (PyObject *)self;\n\tPy_INCREF(self);\n\treturn (PyObject *)ret;\n}\n\n\n/*MULTIARRAY_API\n Mean\n*/\nstatic PyObject *\nPyArray_Mean(PyArrayObject *self, int axis, int rtype)\n{\n\tPyObject *obj1=NULL, *obj2=NULL;\n\tPyObject *new, *ret;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\n\tobj1 = PyArray_GenericReduceFunction((PyAO *)new, n_ops.add, axis,\n\t\t\t\t\t rtype);\n\tobj2 = PyFloat_FromDouble((double) PyArray_DIM(new,axis));\n Py_DECREF(new);\n\tif (obj1 == NULL || obj2 == NULL) {\n\t\tPy_XDECREF(obj1);\n\t\tPy_XDECREF(obj2);\n\t\treturn NULL;\n\t}\n\n\tret = PyNumber_Divide(obj1, obj2);\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\treturn ret;\n}\n\n/* Set variance to 1 to by-pass square-root calculation and return variance */\n/*MULTIARRAY_API\n Std\n*/\nstatic PyObject *\nPyArray_Std(PyArrayObject *self, int axis, int rtype, int variance)\n{\n\tPyObject *obj1=NULL, *obj2=NULL, *new=NULL;\n\tPyObject *ret=NULL, *newshape=NULL;\n\tint i, n;\n\tintp val;\n\n\tif ((new = _check_axis(self, &axis, 0))==NULL) return NULL;\n\t\n\t/* Compute and reshape mean */\n\tobj1 = PyArray_EnsureArray(PyArray_Mean((PyAO *)new, axis, rtype));\n\tif (obj1 == NULL) {Py_DECREF(new); return NULL;} \n\tn = PyArray_NDIM(new);\n\tnewshape = PyTuple_New(n);\n\tif (newshape == NULL) {Py_DECREF(obj1); Py_DECREF(new); return NULL;}\n\tfor (i=0; ind != 1) {\n Py_DECREF(cond);\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"condition must be 1-d array\");\n return NULL;\n }\n\n res = PyArray_Nonzero(cond);\n Py_DECREF(cond);\n\tret = PyArray_Take(self, res, axis);\n\tPy_DECREF(res);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Nonzero\n*/\nstatic PyObject *\nPyArray_Nonzero(PyArrayObject *self)\n{\n int n=self->nd, j;\n\tintp count=0, i, size;\n\tPyArrayIterObject *it=NULL;\n\tPyObject *ret=NULL, *item;\n\tintp *dptr[MAX_DIMS];\n\n\tit = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);\n\tif (it==NULL) return NULL;\n\n\tsize = it->size;\n\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) count++;\n\t\tPyArray_ITER_NEXT(it);\n\t}\n\n\tPyArray_ITER_RESET(it);\n\tif (n==1) {\n\t\tret = PyArray_New(self->ob_type, 1, &count, PyArray_INTP, \n\t\t\t\t NULL, NULL, 0, 0, (PyObject *)self);\n\t\tif (ret == NULL) goto fail;\n\t\tdptr[0] = (intp *)PyArray_DATA(ret);\n\t\t\n\t\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) \n\t\t\t\t*(dptr[0])++ = i;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\t\t\n\t}\n\telse {\n\t\tret = PyTuple_New(n);\n\t\tfor (j=0; job_type, 1, &count, \n\t\t\t\t\t PyArray_INTP, NULL, NULL, 0, 0,\n\t\t\t\t\t (PyObject *)self);\n\t\t\tif (item == NULL) goto fail;\n\t\t\tPyTuple_SET_ITEM(ret, j, item);\n\t\t\tdptr[j] = (intp *)PyArray_DATA(item);\n\t\t}\n\t\t\n\t\t/* reset contiguous so that coordinates gets updated */\n\t\tit->contiguous = 0;\n\t\tfor (i=0; idescr->f->nonzero(it->dataptr, self)) \n\t\t\t\tfor (j=0; jcoordinates[j];\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\n\n\tPy_DECREF(it);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(ret);\n\tPy_XDECREF(it);\n\treturn NULL;\n \n}\n\n/*MULTIARRAY_API\n Clip\n*/\nstatic PyObject *\nPyArray_Clip(PyArrayObject *self, PyObject *min, PyObject *max)\n{\n\tPyObject *selector=NULL, *newtup=NULL, *ret=NULL;\n\tPyObject *res1=NULL, *res2=NULL, *res3=NULL;\n\tPyObject *two;\n\n\ttwo = PyInt_FromLong((long)2);\n\tres1 = PyArray_GenericBinaryFunction(self, max, n_ops.greater);\n\tres2 = PyArray_GenericBinaryFunction(self, min, n_ops.less);\n\tif ((res1 == NULL) || (res2 == NULL)) {\n\t\tPy_DECREF(two);\n\t\tPy_XDECREF(res1);\n\t\tPy_XDECREF(res2);\n\t}\n\tres3 = PyNumber_Multiply(two, res1);\n\tPy_DECREF(two); \n\tPy_DECREF(res1); \n\tif (res3 == NULL) return NULL;\n\n\tselector = PyArray_EnsureArray(PyNumber_Add(res2, res3));\n\tPy_DECREF(res2);\n\tPy_DECREF(res3);\n\tif (selector == NULL) return NULL;\n\n\tnewtup = Py_BuildValue(\"(OOO)\", (PyObject *)self, min, max);\n\tif (newtup == NULL) {Py_DECREF(selector); return NULL;}\n\tret = PyArray_Choose((PyAO *)selector, newtup);\n\tPy_DECREF(selector);\n\tPy_DECREF(newtup);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Conjugate\n*/\nstatic PyObject *\nPyArray_Conjugate(PyArrayObject *self)\n{\n\tif (PyArray_ISCOMPLEX(self)) {\n\t\tPyObject *new;\n\t\tintp size, i;\n\t\t/* Make a copy */\n\t\tnew = PyArray_NewCopy(self, -1);\n\t\tif (new==NULL) return NULL;\n\t\tsize = PyArray_SIZE(new);\n\t\tif (self->descr->type_num == PyArray_CFLOAT) {\n\t\t\tcfloat *dptr = (cfloat *) PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\n\t\t}\n\t\telse if (self->descr->type_num == PyArray_CDOUBLE) {\n\t\t\tcdouble *dptr = (cdouble *)PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\n\t\t}\n\t\telse if (self->descr->type_num == PyArray_CLONGDOUBLE) {\n\t\t\tclongdouble *dptr = (clongdouble *)PyArray_DATA(new);\n\t\t\tfor (i=0; iimag = -dptr->imag;\n\t\t\t\tdptr++;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\treturn new;\n\t}\n\telse {\n\t\tPy_INCREF(self);\n\t\treturn (PyObject *) self;\n\t}\n}\n\n/*MULTIARRAY_API\n Trace\n*/\nstatic PyObject *\nPyArray_Trace(PyArrayObject *self, int offset, int axis1, int axis2, \nint rtype)\n{\n\tPyObject *diag=NULL, *ret=NULL;\n\n\tdiag = PyArray_Diagonal(self, offset, axis1, axis2);\n\tif (diag == NULL) return NULL;\n\tret = PyArray_GenericReduceFunction((PyAO *)diag, n_ops.add, -1, rtype);\n\tPy_DECREF(diag);\n\treturn ret;\n}\n\n/*MULTIARRAY_API\n Diagonal\n*/\nstatic PyObject *\nPyArray_Diagonal(PyArrayObject *self, int offset, int axis1, int axis2)\n{\n\tint n = self->nd;\n\tPyObject *new;\n\tPyArray_Dims newaxes;\n\tintp dims[MAX_DIMS];\n\tint i, pos;\t\n\n\tnewaxes.ptr = dims;\n\tif (n < 2) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"array.ndim must be >= 2\");\n\t\treturn NULL;\n\t}\n\tif (axis1 < 0) axis1 += n;\n\tif (axis2 < 0) axis2 += n;\n\tif ((axis1 == axis2) || (axis1 < 0) || (axis1 >= n) ||\t\\\n\t (axis2 < 0) || (axis2 >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \"axis1(=%d) and axis2(=%d) \"\\\n\t\t\t \"must be different and within range (nd=%d)\",\n\t\t\t axis1, axis2, n);\n\t\treturn NULL;\n\t}\n \n\tnewaxes.len = n;\n\t/* insert at the end */\n\tnewaxes.ptr[n-2] = axis1;\n\tnewaxes.ptr[n-1] = axis2;\n\tpos = 0;\n\tfor (i=0; idimensions[0];\n\t\tn2 = self->dimensions[1];\n\t\tstep = n2+1;\n\t\tif (offset < 0) {\n\t\t\tstart = -n2 * offset;\n\t\t\tstop = MIN(n2, n1+offset)*(n2+1) - n2*offset;\n\t\t}\n\t\telse {\n\t\t\tstart = offset;\n\t\t\tstop = MIN(n1, n2-offset)*(n2+1) + offset;\n\t\t}\n\t\t\n\t\t/* count = ceil((stop-start)/step) */\n\t\tcount = ((stop-start) / step) + (((stop-start) % step) != 0);\n\t\t\t\n\t\tindices = PyArray_New(&PyArray_Type, 1, &count, \n\t\t\t\t PyArray_INTP, NULL, NULL, 0, 0, NULL);\n\t\tif (indices == NULL) {\n\t\t\tPy_DECREF(self); return NULL;\n\t\t}\n\t\tdptr = (intp *)PyArray_DATA(indices);\n\t\tfor (n1=start; n1descr;\n\n\t\tmydiagonal = PyList_New(0);\n\t\tif (mydiagonal == NULL) {Py_DECREF(self); return NULL;}\n\t\tn1 = self->dimensions[0];\n\t\tfor (i=0; i 3)) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"C arrays of only 1-3 dimensions available\");\n\t\tPy_XDECREF(typedescr);\n\t\treturn -1;\n\t}\n\tif ((ap = (PyArrayObject*)PyArray_FromAny(*op, typedescr, nd, nd,\n\t\t\t\t\t\t CARRAY_FLAGS)) == NULL)\n\t\treturn -1;\n\tswitch(nd) {\n\tcase 1:\n\t\t*((char **)ptr) = ap->data;\n\t\tbreak;\n\tcase 2:\n\t\tn = ap->dimensions[0];\n\t\tptr2 = (char **)_pya_malloc(n * sizeof(char *));\n\t\tif (!ptr2) goto fail;\n\t\tfor (i=0; idata + i*ap->strides[0];\n\t\t}\n\t\t*((char ***)ptr) = ptr2;\n\t\tbreak;\t\t\n\tcase 3:\n\t\tn = ap->dimensions[0];\n\t\tm = ap->dimensions[1];\n\t\tptr3 = (char ***)_pya_malloc(n*(m+1) * sizeof(char *));\n\t\tif (!ptr3) goto fail;\n\t\tfor (i=0; idata + i*ap->strides[0] + \\\n\t\t\t\t\tj*ap->strides[1];\n\t\t\t}\n\t\t}\n\t\t*((char ****)ptr) = ptr3;\n\t}\n\tmemcpy(dims, ap->dimensions, nd*sizeof(intp));\n\t*op = (PyObject *)ap;\n\treturn 0;\n\n fail:\n\tPyErr_SetString(PyExc_MemoryError, \"no memory\");\n\treturn -1;\n}\n\n/* Deprecated --- Use PyArray_AsCArray instead */\n\n/*MULTIARRAY_API\n Convert to a 1D C-array\n*/\nstatic int \nPyArray_As1D(PyObject **op, char **ptr, int *d1, int typecode) \n{\n\tintp newd1;\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(typecode);\t\n\tif (PyArray_AsCArray(op, (void *)ptr, &newd1, 1, descr) == -1)\n\t\treturn -1;\t\n\t*d1 = (int) newd1;\n\treturn 0;\n}\n\n/*MULTIARRAY_API\n Convert to a 2D C-array\n*/\nstatic int \nPyArray_As2D(PyObject **op, char ***ptr, int *d1, int *d2, int typecode) \n{\n\tintp newdims[2];\n\tPyArray_Descr *descr;\n\n\tdescr = PyArray_DescrFromType(typecode);\t\n\tif (PyArray_AsCArray(op, (void *)ptr, newdims, 2, descr) == -1)\n\t\treturn -1;\n\n\t*d1 = (int ) newdims[0];\n\t*d2 = (int ) newdims[1];\n return 0;\n}\n\n/* End Deprecated */\n\n/*MULTIARRAY_API\n Free pointers created if As2D is called\n*/\nstatic int \nPyArray_Free(PyObject *op, void *ptr) \n{\n PyArrayObject *ap = (PyArrayObject *)op;\n\t\n if ((ap->nd < 1) || (ap->nd > 3)) \n\t\treturn -1;\n if (ap->nd >= 2) {\n\t\t_pya_free(ptr);\n }\n Py_DECREF(ap);\n return 0;\n}\n\n\nstatic PyObject *\n_swap_and_concat(PyObject *op, int axis, int n)\n{\n\tPyObject *newtup=NULL;\n\tPyObject *otmp, *arr;\n\tint i;\n\n\tnewtup = PyTuple_New(n);\n\tif (newtup==NULL) return NULL;\n\tfor (i=0; i= MAX_DIMS) {\n\t\t\totmp = PyArray_Ravel(mps[i],0);\n\t\t\tPy_DECREF(mps[i]);\n\t\t\tmps[i] = (PyArrayObject *)otmp;\n\t\t}\n\t\tprior2 = PyArray_GetPriority((PyObject *)(mps[i]), 0.0);\n\t\tif (prior2 > prior1) {\n\t\t\tprior1 = prior2;\n\t\t\tsubtype = mps[i]->ob_type;\n\t\t\tret = mps[i];\n\t\t}\n\t}\n\t\n\tnew_dim = 0;\n\tfor(i=0; ind;\n\t\telse {\n\t\t\tif (nd != mps[i]->nd) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"arrays must have same \"\\\n\t\t\t\t\t\t\"number of dimensions\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t\tif (!PyArray_CompareLists(mps[0]->dimensions+1, \n\t\t\t\t\t\t mps[i]->dimensions+1, \n\t\t\t\t\t\t nd-1)) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"array dimensions must \"\\\n\t\t\t\t\t\t\"agree except for d_0\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t}\n\t\tif (nd == 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"0-d arrays can't be concatenated\");\n\t\t\tgoto fail;\n\t\t}\n\t\tnew_dim += mps[i]->dimensions[0];\n\t}\n\t\n\ttmp = mps[0]->dimensions[0];\n\tmps[0]->dimensions[0] = new_dim;\n\tPy_INCREF(mps[0]->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(subtype, \n\t\t\t\t\t\t mps[0]->descr, nd,\n\t\t\t\t\t\t mps[0]->dimensions, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)ret);\n\tmps[0]->dimensions[0] = tmp;\n\t\n\tif (ret == NULL) goto fail;\n\t\n\tdata = ret->data;\n\tfor(i=0; idata, numbytes);\n\t\tdata += numbytes;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; ind;\n\tif (n <= 1) {\n\t\tPy_INCREF(ap);\n\t\treturn (PyObject *)ap;\n\t}\n\n\tif (a1 < 0) a1 += n;\n\tif (a2 < 0) a2 += n;\n\tif ((a1 < 0) || (a1 >= n)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"bad axis1 argument to swapaxes\");\n\t\treturn NULL;\n\t}\n\tif ((a2 < 0) || (a2 >= n)) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"bad axis2 argument to swapaxes\");\n\t\treturn NULL;\n\t}\n\tnew_axes.ptr = dims;\n\tnew_axes.len = n;\n\n\tfor (i=0; ind;\n\t\tfor(i=0; ilen;\n\t\taxes = permute->ptr;\n\t\tif (n > ap->nd) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"too many axes for this array\");\n\t\t\treturn NULL;\n\t\t}\n\t\tfor(i=0; ind+axis;\n\t\t\tif (axis < 0 || axis >= ap->nd) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\t\"invalid axis for this array\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tpermutation[i] = axis;\n\t\t}\n\t}\n\t\n\t/* this allocates memory for dimensions and strides (but fills them\n\t incorrectly), sets up descr, and points data at ap->data. */\n\tPy_INCREF(ap->descr);\n\tret = (PyArrayObject *)\\\n\t\tPyArray_NewFromDescr(ap->ob_type, \n\t\t\t\t ap->descr, \n\t\t\t\t n, permutation, \n\t\t\t\t NULL, ap->data, ap->flags,\n\t\t\t\t (PyObject *)ap);\n\tif (ret == NULL) return NULL;\n\t\n\t/* point at true owner of memory: */\n\tret->base = (PyObject *)ap;\n\tPy_INCREF(ap);\n\t\n\tfor(i=0; idimensions[i] = ap->dimensions[permutation[i]];\n\t\tret->strides[i] = ap->strides[permutation[i]];\n\t}\n\tPyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN);\t\n\n\treturn (PyObject *)ret;\t\n}\n\n/*MULTIARRAY_API\n Repeat the array.\n*/\nstatic PyObject *\nPyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis)\n{\n\tintp *counts;\n\tintp n, n_outer, i, j, k, chunk, total;\n\tintp tmp;\n\tint nd;\n\tPyArrayObject *repeats=NULL;\n\tPyObject *ap=NULL;\n\tPyArrayObject *ret=NULL;\n\tchar *new_data, *old_data;\n\n\trepeats = (PyAO *)PyArray_ContiguousFromAny(op, PyArray_INTP, 0, 1);\n\tif (repeats == NULL) return NULL;\n\tnd = repeats->nd;\n\tcounts = (intp *)repeats->data;\n\n\tif ((ap=_check_axis(aop, &axis, CARRAY_FLAGS))==NULL) {\n\t\tPy_DECREF(repeats);\n\t\treturn NULL;\n\t}\n\n\taop = (PyAO *)ap;\n\n\tif (nd == 1)\n\t\tn = repeats->dimensions[0];\n\telse /* nd == 0 */\n\t\tn = aop->dimensions[axis];\n\n\tif (aop->dimensions[axis] != n) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"a.shape[axis] != len(repeats)\");\n\t\tgoto fail;\n\t}\n\n\t\n\tif (nd == 0) \n\t\ttotal = counts[0]*n;\n\telse {\n\t\t\n\t\ttotal = 0;\n\t\tfor(j=0; jdimensions[axis] = total;\n\tPy_INCREF(aop->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(aop->ob_type, \n\t\t\t\t\t\t aop->descr,\n\t\t\t\t\t\t aop->nd,\n\t\t\t\t\t\t aop->dimensions,\n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)aop);\n\taop->dimensions[axis] = n;\n\t\n\tif (ret == NULL) goto fail;\n\t\n\tnew_data = ret->data;\n\told_data = aop->data;\n\t\n\tchunk = aop->descr->elsize;\n\tfor(i=axis+1; ind; i++) {\n\t\tchunk *= aop->dimensions[i];\n\t}\n\t\n\tn_outer = 1;\n\tfor(i=0; idimensions[i];\n\n\tfor(i=0; ind < mps[i]->nd) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"too many dimensions\");\n\t\t\tgoto fail;\n\t\t}\n\t\tif (!PyArray_CompareLists(ap->dimensions+(ap->nd-mps[i]->nd),\n\t\t\t\t mps[i]->dimensions, mps[i]->nd)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"array dimensions must agree\");\n\t\t\tgoto fail;\n\t\t}\n\t\tsizes[i] = PyArray_NBYTES(mps[i]);\n\t}\n\t\n\tPy_INCREF(mps[0]->descr);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(ap->ob_type, \n\t\t\t\t\t\t mps[0]->descr,\n\t\t\t\t\t\t ap->nd,\n\t\t\t\t\t\t ap->dimensions, \n\t\t\t\t\t\t NULL, NULL, 0,\n\t\t\t\t\t\t (PyObject *)ap);\n\tif (ret == NULL) goto fail;\n\t\n\telsize = ret->descr->elsize;\n\tm = PyArray_SIZE(ret);\n\tself_data = (intp *)ap->data;\n\tret_data = ret->data;\n\t\n\tfor (i=0; i= n) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid entry in choice array\");\n\t\t\tgoto fail;\n\t\t}\n\t\toffset = i*elsize;\n\t\tif (offset >= sizes[mi]) {offset = offset % sizes[mi]; }\n\t\tmemmove(ret_data, mps[mi]->data+offset, elsize);\n\t\tret_data += elsize; self_data++;\n\t}\n\t\n\tPyArray_INCREF(ret);\n\tfor(i=0; idescr->f->sort[which];\n\tsize = it->size;\n\tN = op->dimensions[axis];\n\telsize = op->descr->elsize;\n\tastride = op->strides[axis];\n\n\tneedcopy = !(op->flags & ALIGNED) || (astride != (intp) elsize);\n\n\tif (needcopy) {\n\t\tchar *buffer;\n\t\tbuffer = PyDataMem_NEW(N*elsize);\n\t\twhile (size--) {\n\t\t\t_strided_copy(buffer, (intp) elsize, it->dataptr, \n\t\t\t\t astride, N, elsize);\n\t\t\tif (sort(buffer, N, op) < 0) {\n\t\t\t\tPyDataMem_FREE(buffer); goto fail;\n\t\t\t}\n\t\t\t_strided_copy(it->dataptr, astride, buffer, \n\t\t\t\t (intp) elsize, N, elsize);\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t\tPyDataMem_FREE(buffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tif (sort(it->dataptr, N, op) < 0) goto fail;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t}\n\t}\t\n\t\n\tEND_THREADS\n\t\n\tPy_DECREF(it);\n\treturn 0;\n\n fail:\n\tEND_THREADS\n\n\tPy_DECREF(it);\n\treturn 0;\n}\n\nstatic PyObject*\n_new_argsort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\n\tPyArrayIterObject *it=NULL;\n\tPyArrayIterObject *rit=NULL;\n\tPyObject *ret;\n\tint needcopy=0, i;\n\tintp N, size;\n\tint elsize;\n\tintp astride, rstride, *iptr;\n\tPyArray_ArgSortFunc *argsort;\n\tBEGIN_THREADS_DEF \n\n\tret = PyArray_New(op->ob_type, op->nd,\n\t\t\t op->dimensions, PyArray_INTP,\n\t\t\t NULL, NULL, 0, 0, (PyObject *)op);\n\tif (ret == NULL) return NULL;\n\n\tit = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, axis);\n\trit = (PyArrayIterObject *)PyArray_IterAllButAxis(ret, axis);\n\tif (rit == NULL || it == NULL) goto fail;\n\n\tBEGIN_THREADS\n\n\targsort = op->descr->f->argsort[which];\n\tsize = it->size;\n\tN = op->dimensions[axis];\n\telsize = op->descr->elsize;\n\tastride = op->strides[axis];\n\trstride = PyArray_STRIDE(ret,axis);\n\n\tneedcopy = !(op->flags & ALIGNED) || (astride != (intp) elsize) || \\\n\t\t(rstride != sizeof(intp));\n\t\n\tif (needcopy) {\n\t\tchar *valbuffer, *indbuffer;\n\t\tvalbuffer = PyDataMem_NEW(N*(elsize+sizeof(intp)));\n\t\tindbuffer = valbuffer + (N*elsize);\n\t\twhile (size--) {\n\t\t\t_strided_copy(valbuffer, (intp) elsize, it->dataptr,\n\t\t\t\t astride, N, elsize);\n\t\t\tiptr = (intp *)indbuffer;\n\t\t\tfor (i=0; idataptr, rstride, indbuffer, \n\t\t\t\t sizeof(intp), N, sizeof(intp));\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t\tPyDataMem_FREE(valbuffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)rit->dataptr;\n\t\t\tfor (i=0; idataptr, (intp *)rit->dataptr, \n\t\t\t\t N, op) < 0) goto fail;\n\t\t\tPyArray_ITER_NEXT(it);\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t}\n\t\n\tEND_THREADS\n\n\tPy_DECREF(it);\n\tPy_DECREF(rit);\n\treturn ret;\n\n fail:\n\n\tEND_THREADS\n\n\tPy_DECREF(ret);\n\tPy_XDECREF(it);\n\tPy_XDECREF(rit);\n\treturn NULL;\n}\n\n\n/* Be sure to save this global_compare when necessary */\n\nstatic PyArrayObject *global_obj;\n\nstatic int \nqsortCompare (const void *a, const void *b) \n{\n\treturn global_obj->descr->f->compare(a,b,global_obj);\n}\n\n/* Consumes reference to ap (op gets it)\n op contains a version of the array with axes swapped if\n local variable axis is not the last dimension.\n orign must be defined locally. \n*/\n\n#define SWAPAXES(op, ap) {\t\t\t\t\t\t\\\n\t\torign = (ap)->nd-1;\t\t\t\t\t\\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\t(op) = (PyAO *)PyArray_SwapAxes((ap), axis, orign); \\\n\t\t\tPy_DECREF((ap));\t\t\t\t\\\n\t\t\tif ((op) == NULL) return NULL;\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse (op) = (ap);\t\t\t\t\t\\\n\t}\n\n/* Consumes reference to ap (op gets it)\n origin must be previously defined locally. \n SWAPAXES must have been called previously. \n op contains the swapped version of the array. \n*/\n#define SWAPBACK(op, ap) {\t \\\n\t\tif (axis != orign) { \\\n\t\t\t(op) = (PyAO *)PyArray_SwapAxes((ap), axis, orign); \\\n\t\t\tPy_DECREF((ap));\t\t\t\t\\\n\t\t\tif ((op) == NULL) return NULL;\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse (op) = (ap);\t\t\t\t\t\\\n\t}\n\n/* These swap axes in-place if necessary */\n#define SWAPINTP(a,b) {intp c; c=(a); (a) = (b); (b) = c;}\n#define SWAPAXES2(ap) {\t\t\t\t\t\t\\\n\t\torign = (ap)->nd-1;\t\t\t\t\t\\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\tSWAPINTP(ap->dimensions[axis], ap->dimensions[orign]); \\\n\t\t\tSWAPINTP(ap->strides[axis], ap->strides[orign]); \\\n\t\t\tPyArray_UpdateFlags(ap, CONTIGUOUS | FORTRAN); \\\n\t\t}\t\t\t\t\t\t \\\n\t}\n\n#define SWAPBACK2(ap) {\t\t \\\n\t\tif (axis != orign) {\t\t\t\t\t\\\n\t\t\tSWAPINTP(ap->dimensions[axis], ap->dimensions[orign]); \\\n\t\t\tSWAPINTP(ap->strides[axis], ap->strides[orign]); \\\n\t\t\tPyArray_UpdateFlags(ap, CONTIGUOUS | FORTRAN);\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\n\n/*MULTIARRAY_API\n Sort an array in-place\n*/\nstatic int\nPyArray_Sort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\tPyArrayObject *ap=NULL, *store_arr=NULL;\n\tchar *ip;\n\tint i, n, m, elsize, orign;\n\n\tn = op->nd;\n\tif ((n==0) || (PyArray_SIZE(op)==1)) return 0;\n\n\tif (axis < 0) axis += n;\n\tif ((axis < 0) || (axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\treturn -1;\n\t}\n\tif (!PyArray_ISWRITEABLE(op)) {\n\t\tPyErr_SetString(PyExc_RuntimeError, \n\t\t\t\t\"attempted sort on unwriteable array.\");\n\t\treturn -1;\n\t}\n\n\t/* Determine if we should use type-specific algorithm or not */\n\tif (op->descr->f->sort[which] != NULL) {\n\t\treturn _new_sort(op, axis, which);\n\t}\n\n\tif ((which != PyArray_QUICKSORT) || \\\n\t op->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"desired sort not supported for this type\");\n\t\treturn -1;\n\t}\n\n\tSWAPAXES2(op);\n\n ap = (PyArrayObject *)PyArray_FromAny((PyObject *)op, \n\t\t\t\t\t NULL, 1, 0, \n\t\t\t\t\t DEFAULT_FLAGS | UPDATEIFCOPY);\t\n\tif (ap == NULL) goto fail;\n\t\n\telsize = ap->descr->elsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(ap)/m;\n\n\t/* Store global -- allows re-entry -- restore before leaving*/\n\tstore_arr = global_obj; \n\tglobal_obj = ap;\n\t\n\tfor (ip=ap->data, i=0; idescr->elsize;\n\tconst intp *ipa = ip1;\n\tconst intp *ipb = ip2;\t\n\treturn global_obj->descr->f->compare(global_data + (isize * *ipa),\n global_data + (isize * *ipb), \n\t\t\t\t\t global_obj);\n}\n\n/*MULTIARRAY_API\n ArgSort an array\n*/\nstatic PyObject *\nPyArray_ArgSort(PyArrayObject *op, int axis, PyArray_SORTKIND which) \n{\n\tPyArrayObject *ap=NULL, *ret=NULL, *store;\n\tintp *ip;\n\tintp i, j, n, m, orign;\n\tint argsort_elsize;\n\tchar *store_ptr;\n\n\tn = op->nd;\n\tif ((n==0) || (PyArray_SIZE(op)==1)) {\n\t\tret = (PyArrayObject *)PyArray_New(op->ob_type, op->nd,\n\t\t\t\t\t\t op->dimensions, \n\t\t\t\t\t\t PyArray_INTP,\n\t\t\t\t\t\t NULL, NULL, 0, 0, \n\t\t\t\t\t\t (PyObject *)op);\n\t\tif (ret == NULL) return NULL;\n\t\t*((intp *)ret->data) = 0;\n\t\treturn (PyObject *)ret;\n\t}\n\tif (axis < 0) axis += n;\n\tif ((axis < 0) || (axis >= n)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\treturn NULL;\n\t}\n\n\t/* Determine if we should use new algorithm or not */\n\tif (op->descr->f->argsort[which] != NULL) {\n\t\treturn _new_argsort(op, axis, which);\n\t}\n\n\tif ((which != PyArray_QUICKSORT) || op->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"requested sort not available for type\");\n\t\tgoto fail;\n\t}\n\n\tSWAPAXES(ap, op);\n\n\top = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)ap, \n\t\t\t\t\t\t\t PyArray_NOTYPE,\n\t\t\t\t\t\t\t 1, 0);\n\n\tif (op == NULL) return NULL;\n\t\n\tret = (PyArrayObject *)PyArray_New(op->ob_type, op->nd,\n\t\t\t\t\t op->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, (PyObject *)op);\n\tif (ret == NULL) goto fail;\n\t\n\t\n\tip = (intp *)ret->data;\n\targsort_elsize = op->descr->elsize;\n\tm = op->dimensions[op->nd-1];\n\tif (m == 0) goto finish;\n\n\tn = PyArray_SIZE(op)/m;\n\tstore_ptr = global_data;\n\tglobal_data = op->data;\n\tstore = global_obj;\n\tglobal_obj = op;\n\tfor (i=0; i 0 in lexsort\");\n\t\treturn NULL;\n\t}\n\tmps = (PyArrayObject **) _pya_malloc(n*sizeof(PyArrayObject));\n\tif (mps==NULL) return PyErr_NoMemory();\n\tits = (PyArrayIterObject **) _pya_malloc(n*sizeof(PyArrayIterObject));\n\tif (its == NULL) {_pya_free(mps); return PyErr_NoMemory();}\n\tfor (i=0; i0) {\n\t\t\tif ((mps[i]->nd != mps[0]->nd) ||\t\\\n\t\t\t (!PyArray_CompareLists(mps[i]->dimensions,\n\t\t\t\t\t\t mps[0]->dimensions,\n\t\t\t\t\t\t mps[0]->nd))) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"all keys need to be the same shape\");\n\t\t\t\tgoto fail;\n\t\t\t}\n\t\t}\n\t\tif (!mps[i]->descr->f->argsort[PyArray_MERGESORT]) {\n\t\t\tPyErr_Format(PyExc_TypeError, \n\t\t\t\t \"merge sort not available for item %d\", i);\n\t\t\tgoto fail;\n\t\t}\n\t\tits[i] = (PyArrayIterObject *)PyArray_IterAllButAxis\t\\\n\t\t\t((PyObject *)mps[i], axis);\n\t\tif (its[i]==NULL) goto fail;\n\t}\n\n\t/* Now we can check the axis */\n\tnd = mps[0]->nd;\n\tif ((nd==0) || (PyArray_SIZE(mps[0])==1)) {\n\t\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, mps[0]->nd,\n\t\t\t\t\t\t mps[0]->dimensions, \n\t\t\t\t\t\t PyArray_INTP,\n\t\t\t\t\t\t NULL, NULL, 0, 0, NULL);\n\t\tif (ret == NULL) return NULL;\n\t\t*((intp *)(ret->data)) = 0;\n\t\treturn (PyObject *)ret;\n\t}\n\tif (axis < 0) axis += nd;\n\tif ((axis < 0) || (axis >= nd)) {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"axis(=%d) out of bounds\", axis);\n\t\tgoto fail;\n\t}\n\n\t/* Now do the sorting */\n\n\tret = (PyArrayObject *)PyArray_New(&PyArray_Type, mps[0]->nd,\n\t\t\t\t\t mps[0]->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, NULL);\n\tif (ret == NULL) goto fail;\n\n\trit = (PyArrayIterObject *)\\\n\t\tPyArray_IterAllButAxis((PyObject *)ret, axis);\n\tif (rit == NULL) goto fail;\n\n\tsize = rit->size;\n\tN = mps[0]->dimensions[axis];\n\trstride = PyArray_STRIDE(ret,axis);\n\n maxelsize = mps[0]->descr->elsize;\n\tneedcopy = (rstride != sizeof(intp));\n\tfor (j=0; jflags & ALIGNED) || \\\n\t\t\t(mps[j]->strides[axis] != (intp)mps[j]->descr->elsize);\n if (mps[j]->descr->elsize > maxelsize) \n maxelsize = mps[j]->descr->elsize;\n\t}\n\n\tif (needcopy) {\n\t\tchar *valbuffer, *indbuffer;\n\t\tvalbuffer = PyDataMem_NEW(N*(maxelsize+sizeof(intp)));\n\t\tindbuffer = valbuffer + (N*maxelsize);\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)indbuffer;\n\t\t\tfor (i=0; idescr->elsize;\n\t\t\t\tastride = mps[j]->strides[axis];\t\n\t\t\t\targsort = mps[j]->descr->f->argsort[PyArray_MERGESORT];\n\t\t\t\t_strided_copy(valbuffer, (intp) elsize, its[j]->dataptr,\n\t\t\t\t\t astride, N, elsize);\n\t\t\t\tif (argsort(valbuffer, (intp *)indbuffer, N, mps[j]) < 0) {\n\t\t\t\t\tPyDataMem_FREE(valbuffer); goto fail;\n\t\t\t\t}\n\t\t\t\tPyArray_ITER_NEXT(its[j]);\n\t\t\t}\n\t\t\t_strided_copy(rit->dataptr, rstride, indbuffer,\n\t\t\t\t sizeof(intp), N, sizeof(intp));\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t\tPyDataMem_FREE(valbuffer);\n\t}\n\telse {\n\t\twhile (size--) {\n\t\t\tiptr = (intp *)rit->dataptr;\n\t\t\tfor (i=0; idescr->f->argsort[PyArray_MERGESORT];\n\t\t\t\tif (argsort(its[j]->dataptr, (intp *)rit->dataptr,\n\t\t\t\t\t N, mps[j]) < 0) goto fail;\n\t\t\t\tPyArray_ITER_NEXT(its[j]);\n\t\t\t}\n\t\t\tPyArray_ITER_NEXT(rit);\n\t\t}\n\t}\n\n\tfor (i=0; idescr->f->compare;\n\tintp min_i, max_i, i, j;\n\tint location, elsize = ap1->descr->elsize;\n\tintp elements = ap1->dimensions[ap1->nd-1];\n\tintp n = PyArray_SIZE(ap2);\n\tintp *rp = (intp *)ret->data;\n\tchar *ip = ap2->data;\n\tchar *vp = ap1->data;\n\n\tfor (j=0; j 0) {\n\t\t\t\t\tif (compare(ip, vp+elsize*(--i), ap2) \\\n\t\t\t\t\t != 0) {\n\t\t\t\t\t\ti = i+1; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmin_i = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (location < 0) {\n\t\t\t\tmax_i = i;\n\t\t\t} else {\n\t\t\t\tmin_i = i+1;\n\t\t\t}\n\t\t}\n\t\t*rp = min_i;\n\t}\n}\n\n/*MULTIARRAY_API\n Numeric.searchsorted(a,v)\n*/\nstatic PyObject *\nPyArray_SearchSorted(PyArrayObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1=NULL, *ap2=NULL, *ret=NULL;\n\tint typenum = 0;\n\n\t/* \n PyObject *args;\n args = Py_BuildValue(\"O\",op2);\n\tPy_DELEGATE_ARGS(((PyObject *)op1), searchsorted, args);\n Py_XDECREF(args);\n\t*/\n\n\ttypenum = PyArray_ObjectType((PyObject *)op1, 0);\n\ttypenum = PyArray_ObjectType(op2, typenum);\n\tret = NULL;\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1, \n\t\t\t\t\t\t\t typenum, \n\t\t\t\t\t\t\t 1, 1);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap2 == NULL) goto fail;\n\t\n\tret = (PyArrayObject *)PyArray_New(ap2->ob_type, ap2->nd, \n\t\t\t\t\t ap2->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, (PyObject *)ap2);\n\tif (ret == NULL) goto fail;\n\n\tif (ap2->descr->f->compare == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"compare not supported for type\");\n\t\tgoto fail;\n\t}\n\t\n\tlocal_where(ap1, ap2, ret); \n\t\n\tPy_DECREF(ap1);\n\tPy_DECREF(ap2);\n\treturn (PyObject *)ret;\n\t\n fail:\n\tPy_XDECREF(ap1);\n\tPy_XDECREF(ap2);\n\tPy_XDECREF(ret);\n\treturn NULL;\n}\n\n\n\n/* Could perhaps be redone to not make contiguous arrays \n */\n\n/*MULTIARRAY_API\n Numeric.innerproduct(a,v)\n*/\nstatic PyObject *\nPyArray_InnerProduct(PyObject *op1, PyObject *op2) \n{\n\tPyArrayObject *ap1, *ap2, *ret=NULL;\n\tintp i, j, l, i1, i2, n1, n2;\n\tint typenum;\n\tintp is1, is2, os;\n\tchar *ip1, *ip2, *op;\n\tintp dimensions[MAX_DIMS], nd;\n\tPyArray_DotFunc *dot;\n\tPyTypeObject *subtype;\n double prior1, prior2;\n\t\n\ttypenum = PyArray_ObjectType(op1, 0); \n\ttypenum = PyArray_ObjectType(op2, typenum);\n\t\t\n\tap1 = (PyArrayObject *)PyArray_ContiguousFromAny(op1, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap1 == NULL) return NULL;\n\tap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum, \n\t\t\t\t\t\t\t 0, 0);\n\tif (ap2 == NULL) goto fail;\n\t\n\tif (ap1->nd == 0 || ap2->nd == 0) {\n\t\tret = (ap1->nd == 0 ? ap1 : ap2);\n\t\tret = (PyArrayObject *)ret->ob_type->tp_as_number->\\\n\t\t\tnb_multiply((PyObject *)ap1, (PyObject *)ap2);\n\t\tPy_DECREF(ap1);\n\t\tPy_DECREF(ap2);\n\t\treturn (PyObject *)ret;\n\t}\n\t\n\tl = ap1->dimensions[ap1->nd-1];\n\t\n\tif (ap2->dimensions[ap2->nd-1] != l) {\n\t\tPyErr_SetString(PyExc_ValueError, \"matrices are not aligned\");\n\t\tgoto fail;\n\t}\n\t\n\tif (l == 0) n1 = n2 = 0;\n\telse {\n\t\tn1 = PyArray_SIZE(ap1)/l;\n\t\tn2 = PyArray_SIZE(ap2)/l;\n\t}\n\n\tnd = ap1->nd+ap2->nd-2;\n\tj = 0;\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap2->dimensions[i];\n\t}\n\n\n\t/* Need to choose an output array that can hold a sum \n\t -- use priority to determine which subtype.\n\t */\n prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0);\n prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0);\n subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type);\n \n\tret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, \n\t\t\t\t\t typenum, NULL, NULL, 0, 0, \n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\n\tdot = (ret->descr->f->dotfunc);\n\t\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"dot not available for this type\");\n\t\tgoto fail;\n\t}\n\n\t\n\tis1 = ap1->strides[ap1->nd-1]; \n\tis2 = ap2->strides[ap2->nd-1];\n\top = ret->data; os = ret->descr->elsize;\n\t\n\tip1 = ap1->data;\n\tfor(i1=0; i1data;\n\t\tfor(i2=0; i2nd == 0 || ap2->nd == 0) {\n\t\tret = (ap1->nd == 0 ? ap1 : ap2);\n\t\tret = (PyArrayObject *)ret->ob_type->tp_as_number->\\\n\t\t\tnb_multiply((PyObject *)ap1, (PyObject *)ap2);\n\t\tPy_DECREF(ap1);\n\t\tPy_DECREF(ap2);\n\t\treturn (PyObject *)ret;\n\t}\n\t\n\tl = ap1->dimensions[ap1->nd-1];\n\tif (ap2->nd > 1) {\n\t\tmatchDim = ap2->nd - 2;\n\t\totherDim = ap2->nd - 1;\n\t}\n\telse {\n\t\tmatchDim = 0;\n\t\totherDim = 0;\n\t}\n\n\tif (ap2->dimensions[matchDim] != l) {\n\t\tPyErr_SetString(PyExc_ValueError, \"objects are not aligned\");\n\t\tgoto fail;\n\t}\n\t\n\tif (l == 0) n1 = n2 = 0;\n\telse {\n\t\tn1 = PyArray_SIZE(ap1)/l;\n\t\tn2 = PyArray_SIZE(ap2)/l;\n\t}\n\n\tnd = ap1->nd+ap2->nd-2;\n\tj = 0;\n\tfor(i=0; ind-1; i++) {\n\t\tdimensions[j++] = ap1->dimensions[i];\n\t}\n\tfor(i=0; ind-2; i++) {\n\t\tdimensions[j++] = ap2->dimensions[i];\n\t}\n\tif(ap2->nd > 1) {\n\t\tdimensions[j++] = ap2->dimensions[ap2->nd-1];\n\t}\n\t/*\n\tfprintf(stderr, \"nd=%d dimensions=\", nd);\n\t for(i=0; i prior1 ? ap2->ob_type : ap1->ob_type);\n\n\tret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, \n\t\t\t\t\t typenum, NULL, NULL, 0, 0, \n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\n\tdot = ret->descr->f->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"dot not available for this type\");\n\t\tgoto fail;\n\t}\n\t\t\n\tis1 = ap1->strides[ap1->nd-1]; is2 = ap2->strides[matchDim];\n\tif(ap1->nd > 1)\n\t\tis1r = ap1->strides[ap1->nd-2];\n\telse\n\t\tis1r = ap1->strides[ap1->nd-1];\n\tis2r = ap2->strides[otherDim];\n\n\top = ret->data; os = ret->descr->elsize;\n\n\tip1 = ap1->data;\n\tfor(i1=0; i1data;\n\t\tfor(i2=0; i2ob_type, \n\t\t\t\t PyArray_DESCR(arr),\n\t\t\t\t 2, dims, \n\t\t\t\t NULL, NULL, 0, arr);\n\n\tif (ret == NULL) {\n\t\tPy_DECREF(arr);\n\t\treturn NULL;\n\t}\n\t/* do 2-d loop */\n\toptr = PyArray_DATA(ret);\n\tstr2 = elsize*dims[0];\n\tfor (i=0; idimensions[0];\n\tn2 = ap2->dimensions[0];\n\n\tif (n1 < n2) { \n\t\tret = ap1; ap1 = ap2; ap2 = ret; \n\t\tret = NULL; i = n1;n1=n2;n2=i;\n\t}\n\tlength = n1;\n\tn = n2;\n\tswitch(mode) {\n\tcase 0:\t\n\t\tlength = length-n+1;\n\t\tn_left = n_right = 0;\n\t\tbreak;\n\tcase 1:\n\t\tn_left = (intp)(n/2);\n\t\tn_right = n-n_left-1;\n\t\tbreak;\n\tcase 2:\n\t\tn_right = n-1;\n\t\tn_left = n-1;\n\t\tlength = length+n-1;\n\t\tbreak;\n\tdefault:\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"mode must be 0, 1, or 2\");\n\t\tgoto fail;\n\t}\n\n\t/* Need to choose an output array that can hold a sum \n\t -- use priority to determine which subtype.\n\t */\n prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0);\n prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0);\n subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type);\n\t\n\tret = (PyArrayObject *)PyArray_New(subtype, 1,\n\t\t\t\t\t &length, typenum, \n\t\t\t\t\t NULL, NULL, 0, 0,\n (PyObject *)\n\t\t\t\t\t (prior2 > prior1 ? ap2 : ap1));\n\tif (ret == NULL) goto fail;\n\t\n\tdot = ret->descr->f->dotfunc;\n\tif (dot == NULL) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"function not available for this data type\");\n\t\tgoto fail;\n\t}\n\t\n\tis1 = ap1->strides[0]; is2 = ap2->strides[0];\n\top = ret->data; os = ret->descr->elsize;\n\t\n\tip1 = ap1->data; ip2 = ap2->data+n_left*is2;\n\tn = n-n_left;\n\tfor(i=0; idescr->type_num);\n\tPy_DECREF(arr);\n\treturn ret;\t \n}\n\n/*MULTIARRAY_API\n Min\n*/\nstatic PyObject *\nPyArray_Min(PyArrayObject *ap, int axis)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\n\tif ((arr=(PyArrayObject *)_check_axis(ap, &axis, 0))==NULL)\n\t\treturn NULL;\n\tret = PyArray_GenericReduceFunction(arr, n_ops.minimum, axis,\n\t\t\t\t\t arr->descr->type_num);\n\tPy_DECREF(arr);\n\treturn ret;\t \n}\n\n/*MULTIARRAY_API\n Ptp\n*/\nstatic PyObject *\nPyArray_Ptp(PyArrayObject *ap, int axis)\n{\n\tPyArrayObject *arr;\n\tPyObject *ret;\n\tPyObject *obj1=NULL, *obj2=NULL;\n\n\tif ((arr=(PyArrayObject *)_check_axis(ap, &axis, 0))==NULL)\n\t\treturn NULL;\n\tobj1 = PyArray_Max(arr, axis);\n\tif (obj1 == NULL) goto fail;\n\tobj2 = PyArray_Min(arr, axis);\n\tif (obj2 == NULL) goto fail;\n\tPy_DECREF(arr);\n\tret = PyNumber_Subtract(obj1, obj2);\n\tPy_DECREF(obj1);\n\tPy_DECREF(obj2);\n\treturn ret;\n\n fail:\n\tPy_XDECREF(arr);\n\tPy_XDECREF(obj1);\n\tPy_XDECREF(obj2);\n\treturn NULL;\n}\n\n\n/*MULTIARRAY_API\n ArgMax\n*/\nstatic PyObject *\nPyArray_ArgMax(PyArrayObject *op, int axis) \n{\n\tPyArrayObject *ap=NULL, *rp=NULL;\n\tPyArray_ArgFunc* arg_func;\n\tchar *ip;\n\tintp *rptr;\n\tintp i, n, orign, m;\n\tint elsize;\n\t\n\tif ((ap=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;\n\n\tSWAPAXES(op, ap);\n\n\tap = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny((PyObject *)op, \n\t\t\t\t\t PyArray_NOTYPE, 1, 0);\n\n\tPy_DECREF(op);\n\tif (ap == NULL) return NULL;\n\t\n\targ_func = ap->descr->f->argmax;\n\tif (arg_func == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \"data type not ordered\");\n\t\tgoto fail;\n\t}\n\n\trp = (PyArrayObject *)PyArray_New(ap->ob_type, ap->nd-1,\n\t\t\t\t\t ap->dimensions, PyArray_INTP,\n\t\t\t\t\t NULL, NULL, 0, 0, \n (PyObject *)ap);\n\tif (rp == NULL) goto fail;\n\n\n\telsize = ap->descr->elsize;\n\tm = ap->dimensions[ap->nd-1];\n\tif (m == 0) {\n\t\tPyErr_SetString(MultiArrayError, \n\t\t\t\t\"attempt to get argmax/argmin \"\\\n\t\t\t\t\"of an empty sequence??\");\n\t\tgoto fail;\n\t}\n\tn = PyArray_SIZE(ap)/m;\n\trptr = (intp *)rp->data;\n\tfor (ip = ap->data, i=0; ind + indices->nd - 1;\n for (i=0; i< nd; i++) {\n if (i < axis) {\n shape[i] = self->dimensions[i];\n n *= shape[i];\n } else {\n if (i < axis+indices->nd) {\n shape[i] = indices->dimensions[i-axis];\n m *= shape[i];\n } else {\n shape[i] = self->dimensions[i-indices->nd+1];\n chunk *= shape[i];\n }\n }\n }\n\tPy_INCREF(self->descr);\n ret = (PyArrayObject *)PyArray_NewFromDescr(self->ob_type, \n\t\t\t\t\t\t self->descr,\n\t\t\t\t\t\t nd, shape, \n\t\t\t\t\t\t NULL, NULL, 0, \n\t\t\t\t\t\t (PyObject *)self);\n\t\n if (ret == NULL) goto fail;\n\t\n max_item = self->dimensions[axis];\n chunk = chunk * ret->descr->elsize;\n src = self->data;\n dest = ret->data;\n\t\n for(i=0; idata))[j];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \n\t\t\t\t\t\t\"index out of range for \"\\\n\t\t\t\t\t\t\"array\");\n goto fail;\n }\n memmove(dest, src+tmp*chunk, chunk);\n dest += chunk;\n }\n src += chunk*max_item;\n }\n\t\n PyArray_INCREF(ret);\n\n Py_XDECREF(indices);\n Py_XDECREF(self);\n\n return (PyObject *)ret;\n\t\n\t\n fail:\n Py_XDECREF(ret);\n Py_XDECREF(indices);\n Py_XDECREF(self);\n return NULL;\n}\n\n/*MULTIARRAY_API\n Put values into an array\n*/\nstatic PyObject *\nPyArray_Put(PyArrayObject *self, PyObject* values0, PyObject *indices0) \n{\n PyArrayObject *indices, *values;\n int i, chunk, ni, max_item, nv, tmp, thistype; \n char *src, *dest;\n\n indices = NULL;\n values = NULL;\n\n if (!PyArray_Check(self)) {\n PyErr_SetString(PyExc_TypeError, \"put: first argument must be an array\");\n return NULL;\n }\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \"put: first argument must be contiguous\");\n return NULL;\n }\n max_item = PyArray_SIZE(self);\n dest = self->data;\n chunk = self->descr->elsize;\n\n indices = (PyArrayObject *)PyArray_ContiguousFromAny(indices0, PyArray_INTP, 0, 0);\n if (indices == NULL) goto fail;\n ni = PyArray_SIZE(indices);\n\n\tthistype = self->descr->type_num;\n values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, thistype, 0, 0);\n if (values == NULL) goto fail;\n nv = PyArray_SIZE(values);\n if (nv > 0) { /* nv == 0 for a null array */\n if (thistype == PyArray_OBJECT) { \n for(i=0; idata + chunk * (i % nv);\n tmp = ((intp *)(indices->data))[i];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \"index out of range for array\");\n goto fail;\n }\n Py_INCREF(*((PyObject **)src));\n Py_XDECREF(*((PyObject **)(dest+tmp*chunk)));\n memmove(dest + tmp * chunk, src, chunk);\n }\n }\n else {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((intp *)(indices->data))[i];\n if (tmp < 0) tmp = tmp+max_item;\n if ((tmp < 0) || (tmp >= max_item)) {\n PyErr_SetString(PyExc_IndexError, \"index out of range for array\");\n goto fail;\n }\n memmove(dest + tmp * chunk, src, chunk);\n }\n }\n\n }\n\n Py_XDECREF(values);\n Py_XDECREF(indices);\n Py_INCREF(Py_None);\n return Py_None;\n\t\n fail:\n Py_XDECREF(indices);\n Py_XDECREF(values);\n return NULL;\n}\n\n/*MULTIARRAY_API\n Put values into an array according to a mask.\n*/\nstatic PyObject *\nPyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0) \n{\n PyArrayObject *mask, *values;\n int i, chunk, ni, max_item, nv, tmp, thistype;\n char *src, *dest;\n\n mask = NULL;\n values = NULL;\n\n if (!PyArray_Check(self)) {\n PyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"putmask: first argument must \"\\\n\t\t\t\t\"be an array\");\n return NULL;\n }\n if (!PyArray_ISCONTIGUOUS(self)) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"putmask: first argument must be contiguous\");\n return NULL;\n }\n\n max_item = PyArray_SIZE(self);\n dest = self->data;\n chunk = self->descr->elsize;\n\n mask = (PyArrayObject *)\\\n\t\tPyArray_FROM_OTF(mask0, PyArray_BOOL, CARRAY_FLAGS | FORCECAST);\n\tif (mask == NULL) goto fail;\n ni = PyArray_SIZE(mask);\n if (ni != max_item) {\n PyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"putmask: mask and data must be \"\\\n\t\t\t\t\"the same size\");\n goto fail;\n }\n\n\tthistype = self->descr->type_num;\n values = (PyArrayObject *)\\\n\t\tPyArray_ContiguousFromAny(values0, thistype, 0, 0);\n\tif (values == NULL) goto fail;\n nv = PyArray_SIZE(values);\t /* zero if null array */\n if (nv > 0) {\n if (thistype == PyArray_OBJECT) {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((Bool *)(mask->data))[i];\n if (tmp) {\n\t\t\t\t\tPy_INCREF(*((PyObject **)src));\n Py_XDECREF(*((PyObject **)(dest+i*chunk)));\n memmove(dest + i * chunk, src, chunk);\n }\n\t\t\t}\n }\n else {\n for(i=0; idata + chunk * (i % nv);\n tmp = ((Bool *)(mask->data))[i];\n if (tmp) memmove(dest + i * chunk, src, chunk);\n\t\t\t}\n\t\t}\n }\n\n Py_XDECREF(values);\n Py_XDECREF(mask);\n Py_INCREF(Py_None);\n return Py_None;\n\t\n fail:\n Py_XDECREF(mask);\n Py_XDECREF(values);\n return NULL;\n}\n\n\n/* This conversion function can be used with the \"O&\" argument for\n PyArg_ParseTuple. It will immediately return an object of array type\n or will convert to a CARRAY any other object. \n\n If you use PyArray_Converter, you must DECREF the array when finished\n as you get a new reference to it.\n*/\n \n/*MULTIARRAY_API\n Useful to pass as converter function for O& processing in\n PyArgs_ParseTuple.\n*/\nstatic int \nPyArray_Converter(PyObject *object, PyObject **address) \n{\n if (PyArray_Check(object)) {\n *address = object;\n\t\tPy_INCREF(object);\n return PY_SUCCEED;\n }\n else {\n\t\t*address = PyArray_FromAny(object, NULL, 0, 0, CARRAY_FLAGS);\n\t\tif (*address == NULL) return PY_FAIL;\n\t\treturn PY_SUCCEED;\n }\n}\n\n/*MULTIARRAY_API\n Convert an object to true / false\n*/\nstatic int\nPyArray_BoolConverter(PyObject *object, Bool *val)\n{ \n if (PyObject_IsTrue(object))\n *val=TRUE;\n else *val=FALSE;\n if (PyErr_Occurred())\n return PY_FAIL;\n return PY_SUCCEED;\n}\n\n\n/*MULTIARRAY_API\n Typestr converter\n*/\nstatic int\nPyArray_TypestrConvert(int itemsize, int gentype)\n{\n\tregister int newtype = gentype;\n\t\n\tif (gentype == PyArray_GENBOOLLTR) {\n\t\tif (itemsize == 1)\n\t\t\tnewtype = PyArray_BOOL;\n\t\telse \n\t\t\tnewtype = PyArray_NOTYPE;\n\t}\n\telse if (gentype == PyArray_SIGNEDLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 1:\n\t\t\tnewtype = PyArray_INT8;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tnewtype = PyArray_INT16;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tnewtype = PyArray_INT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_INT64;\n\t\t\tbreak;\n#ifdef PyArray_INT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_INT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\n\t}\n\n\telse if (gentype == PyArray_UNSIGNEDLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 1:\n\t\t\tnewtype = PyArray_UINT8;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tnewtype = PyArray_UINT16;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tnewtype = PyArray_UINT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_UINT64;\n\t\t\tbreak;\n#ifdef PyArray_INT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_UINT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t\tbreak;\n\t\t}\n\t}\n\telse if (gentype == PyArray_FLOATINGLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 4:\n\t\t\tnewtype = PyArray_FLOAT32;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tnewtype = PyArray_FLOAT64;\n\t\t\tbreak;\n#ifdef PyArray_FLOAT80\n case 10:\n\t\t\tnewtype = PyArray_FLOAT80;\n\t\t\tbreak;\n#endif\n#ifdef PyArray_FLOAT96\n\t\tcase 12:\n\t\t\tnewtype = PyArray_FLOAT96;\n\t\t\tbreak;\n#endif\t\t \n#ifdef PyArray_FLOAT128\n\t\tcase 16:\n\t\t\tnewtype = PyArray_FLOAT128;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\t\t\n\t}\n\t\n\telse if (gentype == PyArray_COMPLEXLTR) {\n\t\tswitch(itemsize) {\n\t\tcase 8:\n\t\t\tnewtype = PyArray_COMPLEX64;\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\tnewtype = PyArray_COMPLEX128;\n\t\t\tbreak;\n#ifdef PyArray_FLOAT80\n case 20:\n\t\t\tnewtype = PyArray_COMPLEX160;\n\t\t\tbreak;\n#endif\n#ifdef PyArray_FLOAT96\n\t\tcase 24:\n\t\t\tnewtype = PyArray_COMPLEX192;\t\t\t\n\t\t\tbreak;\n#endif\t\t \n#ifdef PyArray_FLOAT128\n\t\tcase 32:\n\t\t\tnewtype = PyArray_COMPLEX256;\n\t\t\tbreak;\n#endif\n\t\tdefault:\n\t\t\tnewtype = PyArray_NOTYPE;\n\t\t}\t\t\n\t}\n\n\treturn newtype;\n}\n\n\n/* this function takes a Python object which exposes the (single-segment)\n buffer interface and returns a pointer to the data segment\n \n You should increment the reference count by one of buf->base\n if you will hang on to a reference\n\n You only get a borrowed reference to the object. Do not free the\n memory...\n*/\n\n\n/*MULTIARRAY_API\n Get buffer chunk from object\n*/\nstatic int\nPyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)\n{\n int buflen;\n\n buf->ptr = NULL;\n buf->flags = BEHAVED_FLAGS;\n buf->base = NULL;\n\n\tif (obj == Py_None)\n\t\treturn PY_SUCCEED;\n\n if (PyObject_AsWriteBuffer(obj, &(buf->ptr), &buflen) < 0) {\n PyErr_Clear();\n buf->flags &= ~WRITEABLE;\n if (PyObject_AsReadBuffer(obj, (const void **)&(buf->ptr), \n &buflen) < 0)\n return PY_FAIL;\n }\n buf->len = (intp) buflen;\n \n /* Point to the base of the buffer object if present */\n if (PyBuffer_Check(obj)) buf->base = ((PyArray_Chunk *)obj)->base;\n if (buf->base == NULL) buf->base = obj;\n \n return PY_SUCCEED; \n}\n\n\n\n/* This function takes a Python sequence object and allocates and\n fills in an intp array with the converted values.\n\n **Remember to free the pointer seq.ptr when done using\n PyDimMem_FREE(seq.ptr)**\n*/\n\n/*MULTIARRAY_API\n Get intp chunk from sequence\n*/\nstatic int\nPyArray_IntpConverter(PyObject *obj, PyArray_Dims *seq)\n{\n int len;\n int nd;\n\n seq->ptr = NULL;\n if (obj == Py_None) return PY_SUCCEED;\n len = PySequence_Size(obj);\n if (len == -1) { /* Check to see if it is a number */\n if (PyNumber_Check(obj)) len = 1;\n }\n if (len < 0) {\n PyErr_SetString(PyExc_TypeError, \n \"expected sequence object with len >= 0\");\n return PY_FAIL;\n }\n if (len > MAX_DIMS) {\n PyErr_Format(PyExc_ValueError, \"sequence too large; \" \\\n \"must be smaller than %d\", MAX_DIMS);\n return PY_FAIL;\n }\n\tif (len > 0) {\n\t\tseq->ptr = PyDimMem_NEW(len);\n\t\tif (seq->ptr == NULL) {\n\t\t\tPyErr_NoMemory();\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n seq->len = len;\n nd = PyArray_IntpFromSequence(obj, (intp *)seq->ptr, len);\n if (nd == -1 || nd != len) {\n\t\tPyDimMem_FREE(seq->ptr);\n\t\tseq->ptr=NULL;\n\t\treturn PY_FAIL;\n\t}\n return PY_SUCCEED;\n}\n\n\n/* A tuple type would be either (generic typeobject, typesize) \n or (fixed-length data-type, shape) \n\n or (inheriting data-type, new-data-type)\n The new data-type must have the same itemsize as the inheriting data-type\n unless the latter is 0 \n \n Thus (int32, {'real':(int16,0),'imag',(int16,2)})\n\n is one way to specify a descriptor that will give \n a['real'] and a['imag'] to an int32 array.\n*/\n\n/* leave type reference alone */\nstatic PyArray_Descr *\n_use_inherit(PyArray_Descr *type, PyObject *newobj, int *errflag) \n{\n\tPyArray_Descr *new;\n\tPyArray_Descr *conv;\n\t\n\t*errflag = 0;\n\tif (!PyArray_DescrConverter(newobj, &conv)) {\n\t\treturn NULL;\n\t}\n\t*errflag = 1;\n\tif (type == &OBJECT_Descr) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"cannot base a new descriptor on an\"\\\n\t\t\t\t\" OBJECT descriptor.\");\n\t\treturn NULL;\n\t}\n\tnew = PyArray_DescrNew(type);\n\tif (new == NULL) return NULL;\n\n\tif (new->elsize && new->elsize != conv->elsize) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"mismatch in size of old\"\\\n\t\t\t\t\"and new data-descriptor\");\n\t\treturn NULL;\n\t}\n\tnew->elsize = conv->elsize;\n\tif (conv->fields != Py_None) {\n\t\tnew->fields = conv->fields;\n\t\tPy_XINCREF(new->fields);\n\t}\n\tPy_DECREF(conv);\n\t*errflag = 0;\n\treturn new;\n}\n\nstatic PyArray_Descr *\n_convert_from_tuple(PyObject *obj) \n{\n\tPyArray_Descr *type, *res;\n\tPyObject *val;\n\tint errflag;\n\t\n\tif (PyTuple_GET_SIZE(obj) != 2) return NULL;\n\n\tif (!PyArray_DescrConverter(PyTuple_GET_ITEM(obj,0), &type)) \n\t\treturn NULL;\n\tval = PyTuple_GET_ITEM(obj,1);\n\t/* try to interpret next item as a type */\n\tres = _use_inherit(type, val, &errflag);\n\tif (res || errflag) {\n\t\tPy_DECREF(type);\n\t\tif (res) return res;\n\t\telse return NULL;\n\t}\n\tPyErr_Clear();\n\t/* We get here if res was NULL but errflag wasn't set\n\t --- i.e. the conversion to a data-descr failed in _use_inherit\n\t*/\n\n\tif (type->elsize == 0) { /* interpret next item as a typesize */\n\t\tint itemsize;\n\t\titemsize = PyArray_PyIntAsInt(PyTuple_GET_ITEM(obj,1));\n\t\tif (error_converting(itemsize)) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid itemsize in generic type \"\\\n\t\t\t\t\t\"tuple\");\n\t\t\tgoto fail;\n\t\t}\n\t\tPyArray_DESCR_REPLACE(type);\n\t\ttype->elsize = itemsize;\n\t}\n\telse {\n\t\t/* interpret next item as shape (if it's a tuple)\n\t\t and reset the type to PyArray_VOID with \n\t\t anew fields attribute. \n\t */\n\t\tPyArray_Dims shape={NULL,-1};\n\t\tPyArray_Descr *newdescr;\n\t\tif (!(PyArray_IntpConverter(val, &shape)) || \n\t\t (shape.len > MAX_DIMS)) {\n\t\t\tPyDimMem_FREE(shape.ptr);\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"invalid shape in fixed-type tuple.\");\n\t\t\tgoto fail;\n\t\t}\n\t\tnewdescr = PyArray_DescrNewFromType(PyArray_VOID);\n\t\tif (newdescr == NULL) {PyDimMem_FREE(shape.ptr); goto fail;}\n\t\tnewdescr->elsize = type->elsize;\n\t\tnewdescr->elsize *= PyArray_MultiplyList(shape.ptr, \n\t\t\t\t\t\t\t shape.len);\n\t\tPyDimMem_FREE(shape.ptr);\n\t\tnewdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr));\n\t\tnewdescr->subarray->base = type;\n\t\tPy_INCREF(val);\n\t\tnewdescr->subarray->shape = val;\n\t\tPy_XDECREF(newdescr->fields);\n\t\tnewdescr->fields = NULL;\n\t\ttype = newdescr;\n\t}\n\treturn type;\n\n fail:\n\tPy_XDECREF(type);\n\treturn NULL;\n}\n\n/* obj is a list. Each item is a tuple with\n\n(field-name, data-type (either a list or a string), and an optional \n shape parameter).\n*/\nstatic PyArray_Descr *\n_convert_from_array_descr(PyObject *obj)\n{\n\tint n, i, totalsize;\n\tint ret;\n\tPyObject *fields, *item, *newobj;\n\tPyObject *name, *key, *tup;\n\tPyObject *nameslist;\n\tPyArray_Descr *new;\n\tPyArray_Descr *conv;\n\t\n\tn = PyList_GET_SIZE(obj);\t\n\tnameslist = PyList_New(n);\n\tif (!nameslist) return NULL;\n\ttotalsize = 0;\n\tfields = PyDict_New();\n\tfor (i=0; ielsize;\n\t\tPyDict_SetItem(fields, name, tup);\n\t\tPy_DECREF(tup);\n\t}\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, nameslist);\n\tPy_DECREF(key);\n\tPy_DECREF(nameslist);\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tnew->fields = fields;\n\tnew->elsize = totalsize;\n\treturn new;\n \n fail:\n\tPy_DECREF(fields);\n\tPy_DECREF(nameslist);\n\treturn NULL;\n\n}\n\n/* a list specifying a data-type can just be\n a list of formats. The names for the fields\n will default to f1, f2, f3, and so forth.\n\n or it can be an array_descr format string -- in which case\n align must be 0. \n*/\n\nstatic PyArray_Descr *\n_convert_from_list(PyObject *obj, int align, int try_descr)\n{\n\tint n, i;\n\tint totalsize;\n\tPyObject *fields;\n\tPyArray_Descr *conv=NULL;\n\tPyArray_Descr *new;\n\tPyObject *key, *tup;\n\tPyObject *nameslist=NULL;\n \tint ret;\n\tint maxalign=0;\n\t\n\tn = PyList_GET_SIZE(obj);\n\ttotalsize = 0;\n\tif (n==0) return NULL;\n\tnameslist = PyList_New(n);\n\tif (!nameslist) return NULL;\n\tfields = PyDict_New();\n\tfor (i=0; ielsize;\n\t\tif (align) {\n\t\t\tint _align;\n\t\t\t_align = conv->alignment;\n\t\t\tif (_align > 1) totalsize =\t\t\t\\\n\t\t\t\t((totalsize + _align - 1)/_align)*_align;\n\t\t\tmaxalign = MAX(maxalign, _align);\n\t\t}\n\t}\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, nameslist);\n\tPy_DECREF(key);\n\tPy_DECREF(nameslist);\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tnew->fields = fields;\n\tif (maxalign > 1) {\n\t\ttotalsize = ((totalsize+maxalign-1)/maxalign)*maxalign;\n\t}\n\tif (align) new->alignment = maxalign;\n\tnew->elsize = totalsize;\n\treturn new;\n\n fail:\n\tPy_DECREF(nameslist);\n\tPy_DECREF(fields);\n\tif (!try_descr) return NULL;\n\tif (align) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"failed to convert from list of formats \"\\\n\t\t\t\t\"and align cannot be 1 for conversion from \"\\\n\t\t\t\t\"array_descr structure\");\n\t\treturn NULL;\n\t}\n\tPyErr_Clear();\n\treturn _convert_from_array_descr(obj);\n}\n\n\n/* comma-separated string */\n/* this is the format developed by the numarray records module */\n/* and implemented by the format parser in that module */\n/* this is an alternative implementation found in the _internal.py \n file patterned after that one -- the approach is to try to convert \n to a list (with tuples if any repeat information is present) \n and then call the _convert_from_list)\n*/\n\nstatic PyArray_Descr *\n_convert_from_commastring(PyObject *obj, int align)\n{\n\tPyObject *listobj;\n\tPyArray_Descr *res;\n\n\tif (!PyString_Check(obj)) return NULL;\n listobj = PyObject_CallMethod(_numpy_internal, \"_commastring\",\n\t\t\t\t \"O\", obj);\n\tif (!listobj) return NULL;\n\tres = _convert_from_list(listobj, align, 0);\n\tPy_DECREF(listobj);\n\tif (!res && !PyErr_Occurred()) {\n\t\tPyErr_SetString(PyExc_ValueError, \"invalid data-type\");\n\t\treturn NULL;\n\t}\n\treturn res;\n}\n\n\n\n/* a dictionary specifying a data-type\n must have at least two and up to four\n keys These must all be sequences of the same length.\n\n \"names\" --- field names \n \"formats\" --- the data-type descriptors for the field.\n \n Optional:\n\n \"offsets\" --- integers indicating the offset into the \n record of the start of the field.\n\t\t if not given, then \"consecutive offsets\" \n\t\t will be assumed and placed in the dictionary.\n \n \"titles\" --- Allows the use of an additional key\n for the fields dictionary.\n \nAttribute-lookup-based field names merely has to query the fields \ndictionary of the data-descriptor. Any result present can be used\nto return the correct field.\n\nSo, the notion of what is a name and what is a title is really quite\narbitrary. \n\nWhat does distinguish a title, however, is that if it is not None, \nit will be placed at the end of the tuple inserted into the \nfields dictionary.\n\nIf the dictionary does not have \"names\" and \"formats\" entries,\nthen it will be checked for conformity and used directly. \n*/\n\nstatic PyArray_Descr *\n_use_fields_dict(PyObject *obj, int align)\n{\n return (PyArray_Descr *)PyObject_CallMethod(_numpy_internal, \n\t\t\t\t\t\t \"_usefields\", \n\t\t\t\t\t\t \"Oi\", obj, align);\n}\n\nstatic PyArray_Descr *\n_convert_from_dict(PyObject *obj, int align)\n{\n\tPyArray_Descr *new;\n\tPyObject *fields=NULL;\n\tPyObject *names, *offsets, *descrs, *titles, *key;\n\tint n, i;\n\tint totalsize;\n\tint maxalign=0;\n\t\n\tfields = PyDict_New();\n\tif (fields == NULL) return (PyArray_Descr *)PyErr_NoMemory();\n\t\n\tnames = PyDict_GetItemString(obj, \"names\");\n\tdescrs = PyDict_GetItemString(obj, \"formats\");\n\n\tif (!names || !descrs) {\n\t\tPy_DECREF(fields);\n\t\treturn _use_fields_dict(obj, align);\n\t}\n\tn = PyObject_Length(names);\n\toffsets = PyDict_GetItemString(obj, \"offsets\");\n\ttitles = PyDict_GetItemString(obj, \"titles\");\n\tif ((n > PyObject_Length(descrs)) ||\t\t\t\\\n\t (offsets && (n > PyObject_Length(offsets))) ||\t\\\n\t (titles && (n > PyObject_Length(titles)))) {\n\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\"all items in the dictionary must have\" \\\n\t\t\t\t\" the same length.\");\n\t\tgoto fail;\n\t}\n\n\ttotalsize = 0;\n\tfor(i=0; i totalsize) totalsize = offset;\n\t\t}\n\t\telse \n\t\t\tPyTuple_SET_ITEM(tup, 1, PyInt_FromLong(totalsize));\n\t\tif (len == 3) PyTuple_SET_ITEM(tup, 2, item);\n\t\tname = PyObject_GetItem(names, index);\n\t\tPy_DECREF(index);\n\n\t\t/* Insert into dictionary */\n\t\tPyDict_SetItem(fields, name, tup);\n\t\tPy_DECREF(name);\n\t\tif (len == 3) PyDict_SetItem(fields, item, tup);\n\t\tPy_DECREF(tup);\n\t\tif ((ret == PY_FAIL) || (newdescr->elsize == 0)) goto fail;\n\t\ttotalsize += newdescr->elsize;\n\t\tif (align) {\n\t\t\tint _align = newdescr->alignment;\n\t\t\tif (_align > 1) totalsize =\t\t\t\\\n\t\t\t\t((totalsize + _align - 1)/_align)*_align;\n\t\t\tmaxalign = MAX(maxalign,_align);\n\t\t}\n\t}\n\n\tnew = PyArray_DescrNewFromType(PyArray_VOID);\n\tif (new == NULL) goto fail;\n\tif (maxalign > 1)\n\t\ttotalsize = ((totalsize + maxalign - 1)/maxalign)*maxalign;\n\tif (align) new->alignment = maxalign;\n\tnew->elsize = totalsize;\n\tkey = PyInt_FromLong(-1);\n\tPyDict_SetItem(fields, key, names);\n\tPy_DECREF(key);\n\tnew->fields = fields;\n\treturn new;\n\n fail:\n\tPy_XDECREF(fields);\n\treturn NULL;\n}\n\n/* \n any object with \n the .fields attribute and/or .itemsize attribute \n (if the .fields attribute does not give\n the total size -- i.e. a partial record naming).\n If itemsize is given it must be >= size computed from fields\n \n The .fields attribute must return a convertible dictionary if \n present. Result inherits from PyArray_VOID.\n*/\n\n\n/*MULTIARRAY_API\n Get typenum from an object -- None goes to NULL\n*/\nstatic int\nPyArray_DescrConverter2(PyObject *obj, PyArray_Descr **at)\n{\n\tif (obj == Py_None) {\n\t\t*at = NULL;\n\t\treturn PY_SUCCEED;\n\t}\n\telse return PyArray_DescrConverter(obj, at);\n}\n\n/* This function takes a Python object representing a type and converts it \n to a the correct PyArray_Descr * structure to describe the type.\n \n Many objects can be used to represent a data-type which in SciPy is\n quite a flexible concept. \n\n This is the central code that converts Python objects to \n Type-descriptor objects that are used throughout numpy.\n */\n\n/* new reference in *at */\n/*MULTIARRAY_API\n Get typenum from an object -- None goes to &LONG_descr\n*/\nstatic int\nPyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)\n{\n char *type;\n int check_num=PyArray_NOTYPE+10;\n\tint len;\n\tPyObject *item;\n\tint elsize = 0;\n\tchar endian = '=';\n\n\t*at=NULL;\n\t\n\t/* default */\n if (obj == Py_None) {\n\t\t*at = PyArray_DescrFromType(PyArray_LONG);\n\t\treturn PY_SUCCEED;\n\t}\n\t\n\tif (PyArray_DescrCheck(obj)) {\n\t\t*at = (PyArray_Descr *)obj;\n\t\tPy_INCREF(*at);\n\t\treturn PY_SUCCEED;\n\t}\n\t\n if (PyType_Check(obj)) {\n\t\tif (PyType_IsSubtype((PyTypeObject *)obj, \n\t\t\t\t &PyGenericArrType_Type)) {\n\t\t\t*at = PyArray_DescrFromTypeObject(obj);\n\t\t\tif (*at) return PY_SUCCEED;\n\t\t\telse return PY_FAIL;\n\t\t}\n\t\tcheck_num = PyArray_OBJECT;\n\t\tif (obj == (PyObject *)(&PyInt_Type))\n\t\t\tcheck_num = PyArray_LONG;\n\t\telse if (obj == (PyObject *)(&PyLong_Type))\n\t\t\tcheck_num = PyArray_LONGLONG;\n\t\telse if (obj == (PyObject *)(&PyFloat_Type)) \n\t\t\tcheck_num = PyArray_DOUBLE;\n\t\telse if (obj == (PyObject *)(&PyComplex_Type)) \n\t\t\tcheck_num = PyArray_CDOUBLE;\n\t\telse if (obj == (PyObject *)(&PyBool_Type))\n\t\t\tcheck_num = PyArray_BOOL;\n else if (obj == (PyObject *)(&PyString_Type))\n check_num = PyArray_STRING;\n else if (obj == (PyObject *)(&PyUnicode_Type))\n check_num = PyArray_UNICODE;\n\t\telse if (obj == (PyObject *)(&PyBuffer_Type))\n\t\t\tcheck_num = PyArray_VOID;\n\t\telse {\n\t\t\t*at = _arraydescr_fromobj(obj);\n\t\t\tif (*at) return PY_SUCCEED;\n\t\t}\n\t\tgoto finish;\n\t}\n\n\t/* or a typecode string */\n\n\tif (PyString_Check(obj)) {\n\t\t/* Check for a string typecode. */\n\t\ttype = PyString_AS_STRING(obj);\n\t\tlen = PyString_GET_SIZE(obj);\n\t\tif (len <= 0) goto fail;\n\t\tcheck_num = (int) type[0];\n\t\tif ((char) check_num == '>' || (char) check_num == '<' || \\\n\t\t (char) check_num == '|') {\n\t\t\tif (len <= 1) goto fail;\n\t\t\tendian = (char) check_num;\n\t\t\ttype++; len--;\n\t\t\tcheck_num = (int) type[0];\n\t\t\tif (endian == '|') endian = '=';\n\t\t}\n\t\tif (len > 1) {\n\t\t\telsize = atoi(type+1);\n\t\t\tif (len > 2 && elsize < 10) {\n\t\t\t\t/* perhaps commas present */\n\t\t\t\tint i;\n\t\t\t\tfor (i=1;ielsize == 0) && (elsize != 0)) {\n\t\tPyArray_DESCR_REPLACE(*at);\n\t\t(*at)->elsize = elsize;\n\t}\n\tif (endian != '=' && PyArray_ISNBO(endian)) endian = '='; \n\t\n\tif (endian != '=' && (*at)->byteorder != '|' &&\t\\\n\t (*at)->byteorder != endian) {\n\t\tPyArray_DESCR_REPLACE(*at);\n\t\t(*at)->byteorder = endian;\n\t}\n\t\n return PY_SUCCEED;\n\n fail:\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"data type not understood\");\n\t*at=NULL;\n\treturn PY_FAIL;\n}\t\n\n/*MULTIARRAY_API\n Convert object to endian\n*/\nstatic int\nPyArray_ByteorderConverter(PyObject *obj, char *endian)\n{\n\tchar *str;\n\t*endian = PyArray_SWAP;\n\tstr = PyString_AsString(obj);\n\tif (!str) return PY_FAIL;\n\tif (strlen(str) < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Byteorder string must be at least length 1\");\n\t\treturn PY_FAIL;\n\t}\n\t*endian = str[0];\n\tif (str[0] != PyArray_BIG && str[0] != PyArray_LITTLE &&\t\\\n\t str[0] != PyArray_NATIVE) {\n\t\tif (str[0] == 'b' || str[0] == 'B')\n\t\t\t*endian = PyArray_BIG;\n\t\telse if (str[0] == 'l' || str[0] == 'L')\n\t\t\t*endian = PyArray_LITTLE;\n\t\telse if (str[0] == 'n' || str[0] == 'N')\n\t\t\t*endian = PyArray_NATIVE;\n\t\telse if (str[0] == 'i' || str[0] == 'I')\n\t\t\t*endian = PyArray_IGNORE;\n\t\telse if (str[0] == 's' || str[0] == 'S')\n\t\t\t*endian = PyArray_SWAP;\n\t\telse {\n\t\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t\t \"%s is an unrecognized byteorder\",\n\t\t\t\t str);\n\t\t\treturn PY_FAIL;\n\t\t}\n\t}\n\treturn PY_SUCCEED;\n}\n\n/*MULTIARRAY_API\n Convert object to sort kind \n*/\nstatic int\nPyArray_SortkindConverter(PyObject *obj, PyArray_SORTKIND *sortkind)\n{\n\tchar *str;\n\t*sortkind = PyArray_QUICKSORT;\n\tstr = PyString_AsString(obj);\n\tif (!str) return PY_FAIL;\n\tif (strlen(str) < 1) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Sort kind string must be at least length 1\");\n\t\treturn PY_FAIL;\n\t}\n\tif (str[0] == 'q' || str[0] == 'Q')\n\t\t*sortkind = PyArray_QUICKSORT;\n\telse if (str[0] == 'h' || str[0] == 'H')\n\t\t*sortkind = PyArray_HEAPSORT;\n\telse if (str[0] == 'm' || str[0] == 'M')\n\t\t*sortkind = PyArray_MERGESORT;\n\telse if (str[0] == 't' || str[0] == 'T')\n\t\t*sortkind = PyArray_TIMSORT;\n\telse {\n\t\tPyErr_Format(PyExc_ValueError, \n\t\t\t \"%s is an unrecognized kind of sort\",\n\t\t\t str);\n\t\treturn PY_FAIL;\n\t}\n\treturn PY_SUCCEED;\n}\n\n\n/* This function returns true if the two typecodes are \n equivalent (same basic kind and same itemsize).\n*/\n\n/*MULTIARRAY_API*/\nstatic Bool\nPyArray_EquivTypes(PyArray_Descr *typ1, PyArray_Descr *typ2)\n{\n\tregister int typenum1=typ1->type_num;\n\tregister int typenum2=typ2->type_num;\n\tregister int size1=typ1->elsize;\n\tregister int size2=typ2->elsize;\n\n\tif (size1 != size2) return FALSE;\n\tif (typ1->fields != typ2->fields) return FALSE;\n\tif (PyArray_ISNBO(typ1->byteorder) != PyArray_ISNBO(typ2->byteorder))\n\t\treturn FALSE;\n\n\tif (typenum1 == PyArray_VOID || \\\n\t typenum2 == PyArray_VOID) {\n\t\treturn ((typenum1 == typenum2) && \n\t\t\t(typ1->typeobj == typ2->typeobj) &&\n\t\t\t(typ1->fields == typ2->fields));\n\t}\n\treturn (typ1->kind == typ2->kind);\n}\n\n/*** END C-API FUNCTIONS **/\n\n\n#define _ARET(x) PyArray_Return((PyArrayObject *)(x))\n\nstatic char doc_fromobject[] = \"array(object, dtype=None, copy=1, fortran=0, \"\\\n \"subok=0)\\n\"\\\n \"will return a new array formed from the given object type given.\\n\"\\\n \"Object can anything with an __array__ method, or any object\\n\"\\\n \"exposing the array interface, or any (nested) sequence.\\n\"\\\n \"If no type is given, then the type will be determined as the\\n\"\\\n \"minimum type required to hold the objects in the sequence.\\n\"\\\n \"If copy is zero and sequence is already an array with the right \\n\"\\\n \"type, a reference will be returned. If the sequence is an array,\\n\"\\\n \"type can be used only to upcast the array. For downcasting \\n\"\\\n \"use .astype(t) method. If subok is true, then subclasses of the\\n\"\\\n \"array may be returned. Otherwise, a base-class ndarray is returned\";\n\nstatic PyObject *\n_array_fromobject(PyObject *ignored, PyObject *args, PyObject *kws)\n{\n\tPyObject *op, *ret=NULL;\n\tstatic char *kwd[]= {\"object\", \"dtype\", \"copy\", \"fortran\", \"subok\", \n NULL};\n Bool subok=FALSE;\n\tBool copy=TRUE;\n\tPyArray_Descr *type=NULL;\n\tPyArray_Descr *oldtype=NULL;\n\tBool fortran=FALSE;\n\tint flags=0;\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|O&O&O&O&\", kwd, &op, \n\t\t\t\t\tPyArray_DescrConverter2,\n &type, \n\t\t\t\t\tPyArray_BoolConverter, ©, \n\t\t\t\t\tPyArray_BoolConverter, &fortran,\n PyArray_BoolConverter, &subok)) \n\t\treturn NULL;\n\n\t/* fast exit if simple call */\n\tif ((PyArray_CheckExact(op) || PyBigArray_CheckExact(op))) {\n\t\tif (type==NULL) {\n\t\t\tif (!copy && fortran==PyArray_ISFORTRAN(op)) {\n\t\t\t\tPy_INCREF(op);\n\t\t\t\treturn op;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn PyArray_NewCopy((PyArrayObject*)op, \n\t\t\t\t\t\t fortran);\n\t\t\t}\n\t\t}\n\t\t/* One more chance */\n\t\toldtype = PyArray_DESCR(op);\n\t\tif (PyArray_EquivTypes(oldtype, type)) {\n\t\t\tif (!copy && fortran==PyArray_ISFORTRAN(op)) {\n\t\t\t\tPy_INCREF(op);\n\t\t\t\treturn op;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tret = PyArray_NewCopy((PyArrayObject*)op,\n\t\t\t\t\t\t fortran);\n\t\t\t\tif (oldtype == type) return ret;\n\t\t\t\tPy_INCREF(oldtype);\n\t\t\t\tPy_DECREF(PyArray_DESCR(ret));\n\t\t\t\tPyArray_DESCR(ret) = oldtype;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (copy) {\n\t\tflags = ENSURECOPY;\n\t}\n\tif (fortran) {\n\t\tflags |= FORTRAN;\n\t}\n if (!subok) {\n flags |= ENSUREARRAY;\n }\n\n\tif ((ret = PyArray_FromAny(op, type, 0, 0, flags)) == NULL) \n\t\treturn NULL;\n\n\treturn ret;\n}\n\n/* accepts NULL type */\n/* steals referenct to type */\n/*MULTIARRAY_API\n Empty\n*/\nstatic PyObject *\nPyArray_Empty(int nd, intp *dims, PyArray_Descr *type, int fortran)\n{\n\tPyArrayObject *ret;\n \n\tif (!type) type = PyArray_DescrFromType(PyArray_LONG);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t type, nd, dims, \n\t\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t\t fortran, NULL);\n\tif (ret == NULL) return NULL;\n \n\tif ((PyArray_TYPE(ret) == PyArray_OBJECT)) {\n PyArray_FillObjectArray(ret, Py_None);\n\t}\n\treturn (PyObject *)ret;\n}\n\n\nstatic char doc_empty[] = \"empty((d1,...,dn),dtype=int,fortran=0) will return a new array\\n of shape (d1,...,dn) and given type with all its entries uninitialized. This can be faster than zeros.\";\n\nstatic PyObject *\narray_empty(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n \n\tstatic char *kwlist[] = {\"shape\",\"dtype\",\"fortran\",NULL};\n\tPyArray_Descr *typecode=NULL;\n PyArray_Dims shape = {NULL, 0};\n\tBool fortran = FALSE;\t\n PyObject *ret=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &shape, \n PyArray_DescrConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter, &fortran)) \n\t\tgoto fail;\n\n\tret = PyArray_Empty(shape.len, shape.ptr, typecode, fortran); \n PyDimMem_FREE(shape.ptr);\n return ret;\n\n fail:\n\tPyDimMem_FREE(shape.ptr);\n\treturn ret;\n}\n\nstatic char doc_scalar[] = \"scalar(dtypedescr,obj) will return a new scalar array of the given type initialized with obj. Mainly for pickle support. The dtypedescr must be a valid data-type descriptor. If dtypedescr corresponds to an OBJECT descriptor, then obj can be any object, otherwise obj must be a string. If obj is not given it will be interpreted as None for object type and zeros for all other types.\";\n\nstatic PyObject *\narray_scalar(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n \n\tstatic char *kwlist[] = {\"dtypedescr\",\"obj\", NULL};\n\tPyArray_Descr *typecode;\n\tPyObject *obj=NULL;\n\tint alloc=0;\n\tvoid *dptr;\n\tPyObject *ret;\n\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O!|O\",\n\t\t\t\t\t kwlist, &PyArrayDescr_Type, \n\t\t\t\t\t &typecode,\n\t\t\t\t\t &obj)) \n\t\treturn NULL;\n\t\t\n\tif (typecode->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError,\t\t\\\n\t\t\t\t\"itemsize cannot be zero\");\n\t\treturn NULL;\n\t}\n\n\tif (typecode->type_num == PyArray_OBJECT) {\n\t\tif (obj == NULL) obj = Py_None;\n\t\tdptr = &obj;\n\t}\n\telse {\n\t\tif (obj == NULL) {\n\t\t\tdptr = _pya_malloc(typecode->elsize);\n\t\t\tif (dptr == NULL) {\n\t\t\t\treturn PyErr_NoMemory();\n\t\t\t}\n\t\t\tmemset(dptr, '\\0', typecode->elsize);\n\t\t\talloc = 1;\n\t\t}\n\t\telse {\n\t\t\tif (!PyString_Check(obj)) {\n\t\t\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\t\t\"initializing object must \"\\\n\t\t\t\t\t\t\"be a string\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tif (PyString_GET_SIZE(obj) < typecode->elsize) {\n\t\t\t\tPyErr_SetString(PyExc_ValueError,\n\t\t\t\t\t\t\"initialization string is too\"\\\n\t\t\t\t\t\t\" small\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tdptr = PyString_AS_STRING(obj);\n\t\t}\n\t}\n\n\tret = PyArray_Scalar(dptr, typecode, NULL);\n\t\n\t/* free dptr which contains zeros */\n\tif (alloc) _pya_free(dptr);\n\treturn ret;\n}\n\n\n/* steal a reference */\n/* accepts NULL type */\n/*MULTIARRAY_API\n Zeros\n*/\nstatic PyObject *\nPyArray_Zeros(int nd, intp *dims, PyArray_Descr *type, int fortran)\n{\n\tPyArrayObject *ret;\n\tintp n;\n\n\tif (!type) type = PyArray_DescrFromType(PyArray_LONG);\n\tret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t type,\n\t\t\t\t\t\t nd, dims, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t fortran, NULL);\n\tif (ret == NULL) return NULL;\n \n\tif ((PyArray_TYPE(ret) == PyArray_OBJECT)) {\n\t\tPyObject *zero = PyInt_FromLong(0);\n PyArray_FillObjectArray(ret, zero);\n Py_DECREF(zero);\n\t}\n\telse {\n\t\tn = PyArray_NBYTES(ret);\n\t\tmemset(ret->data, 0, n);\n\t}\n\treturn (PyObject *)ret;\n\n}\n\nstatic char doc_zeros[] = \"zeros((d1,...,dn),dtype=int,fortran=0) will return a new array of shape (d1,...,dn) and type typecode with all it's entries initialized to zero.\";\n\n\nstatic PyObject *\narray_zeros(PyObject *ignored, PyObject *args, PyObject *kwds) \n{\n\tstatic char *kwlist[] = {\"shape\",\"dtype\",\"fortran\",NULL};\n\tPyArray_Descr *typecode=NULL;\n PyArray_Dims shape = {NULL, 0};\n\tBool fortran = FALSE;\t\n PyObject *ret=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O&|O&O&\",\n\t\t\t\t\t kwlist, PyArray_IntpConverter,\n &shape, \n PyArray_DescrConverter,\n\t\t\t\t\t &typecode, \n\t\t\t\t\t PyArray_BoolConverter,\n\t\t\t\t\t &fortran)) \n\t\tgoto fail;\n\n\tret = PyArray_Zeros(shape.len, shape.ptr, typecode, (int) fortran);\n PyDimMem_FREE(shape.ptr);\n return ret;\n\n fail:\n\tPyDimMem_FREE(shape.ptr);\n\treturn ret;\n}\n\nstatic char doc_set_typeDict[] = \"set_typeDict(dict) set the internal \"\\\n\t\"dictionary that can look up an array type using a registered \"\\\n\t\"code\";\n\nstatic PyObject *\narray_set_typeDict(PyObject *ignored, PyObject *args)\n{\n\tPyObject *dict;\n\tif (!PyArg_ParseTuple(args, \"O\", &dict)) return NULL;\n\tPy_XDECREF(typeDict); /* Decrement old reference (if any)*/\n\ttypeDict = dict;\n\tPy_INCREF(dict); /* Create an internal reference to it */\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\n/* steals a reference to dtype -- accepts NULL */\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromString(char *data, intp slen, PyArray_Descr *dtype, intp n)\n{\n\tint itemsize;\n\tPyArrayObject *ret;\n\n\tif (dtype == NULL)\n\t\tdtype=PyArray_DescrFromType(PyArray_LONG);\n\t\n\tif (dtype == &OBJECT_Descr) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"Cannot create an object array from a\"\\\n\t\t\t\t\" string.\");\n\t\tPy_DECREF(dtype);\n\t\treturn NULL;\n\t}\n\t\n\titemsize = dtype->elsize;\n\tif (itemsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"zero-valued itemsize\");\n\t\tPy_DECREF(dtype);\n\t\treturn NULL;\n\t}\n\t\n\tif (n < 0 ) {\n\t\tif (slen % itemsize != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"string size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\n\t\t\tPy_DECREF(dtype);\n\t\t\treturn NULL;\n\t\t}\n\t\tn = slen/itemsize;\n\t} else {\n\t\tif (slen < n*itemsize) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"string is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\tPy_DECREF(dtype);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t dtype,\n\t\t\t\t\t\t\t 1, &n, \n\t\t\t\t\t\t\t NULL, NULL,\n\t\t\t\t\t\t\t 0, NULL)) == NULL)\n\t\treturn NULL;\n\t\t\n\tmemcpy(ret->data, data, n*dtype->elsize);\n\treturn (PyObject *)ret;\n}\n\nstatic char doc_fromString[] = \"fromstring(string, dtype=int, count=-1) returns a new 1d array initialized from the raw binary data in string. If count is positive, the new array will have count elements, otherwise it's size is determined by the size of string.\";\n\nstatic PyObject *\narray_fromString(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tchar *data;\n\tlonglong nin=-1;\n\tint s;\n\tstatic char *kwlist[] = {\"string\", \"dtype\", \"count\", NULL};\n\tPyArray_Descr *descr=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"s#|O&L\", kwlist, \n\t\t\t\t\t &data, &s, \n\t\t\t\t\t PyArray_DescrConverter, &descr,\n\t\t\t\t\t &nin)) {\n\t\treturn NULL;\n\t}\n\n\treturn PyArray_FromString(data, (intp)s, descr, (intp)nin);\n}\n\n/* This needs an open file object and reads it in directly. \n memory-mapped files handled differently through buffer interface.\n\nfile pointer number in resulting 1d array \n(can easily reshape later, -1 for to end of file)\ntype of array\nsep is a separator string for character-based data (or NULL for binary)\n \" \" means whitespace\n*/\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromFile(FILE *fp, PyArray_Descr *typecode, intp num, char *sep)\n{\n\tPyArrayObject *r;\n\tsize_t nread = 0;\n\tPyArray_ScanFunc *scan;\n\tBool binary;\n\n\tif (typecode->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \"0-sized elements.\");\n\t\treturn NULL;\n\t}\n\n\tbinary = ((sep == NULL) || (strlen(sep) == 0));\n\tif (num == -1 && binary) { /* Get size for binary file*/\n\t\tintp start, numbytes;\n\t\tstart = (intp )ftell(fp);\n\t\tfseek(fp, 0, SEEK_END);\n\t\tnumbytes = (intp )ftell(fp) - start;\n\t\trewind(fp);\n\t\tif (numbytes == -1) {\n\t\t\tPyErr_SetString(PyExc_IOError, \n\t\t\t\t\t\"could not seek in file\");\n\t\t\treturn NULL;\n\t\t}\n\t\tnum = numbytes / typecode->elsize;\n\t}\n\t\n\tif (binary) { /* binary data */\n\t\tr = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t typecode,\n\t\t\t\t\t\t\t 1, &num, \n\t\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t\t 0, NULL);\n\t\tif (r==NULL) return NULL;\n\t\tnread = fread(r->data, typecode->elsize, num, fp);\n\t}\n\telse { /* character reading */\n\t\tintp i;\n\t\tchar *dptr;\n\t\tint done=0;\n\n\t\tscan = typecode->f->scanfunc;\n\t\tif (scan == NULL) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"don't know how to read \"\t\\\n\t\t\t\t\t\"character files with that \"\t\\\n\t\t\t\t\t\"array type\");\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (num != -1) { /* number to read is known */\n\t\t\tr = (PyArrayObject *)\\\n\t\t\t\tPyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t typecode, \n\t\t\t\t\t\t 1, &num, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\tdptr = r->data;\n\t\t\tfor (i=0; i < num; i++) {\n\t\t\t\tif (done) break;\n\t\t\t\tdone = scan(fp, dptr, sep, NULL);\n\t\t\t\tif (done < -2) break;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->descr->elsize;\n\t\t\t}\n\t\t\tif (PyErr_Occurred()) {\n\t\t\t\tPy_DECREF(r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t\telse { /* we have to watch for the end of the file and \n\t\t\t reallocate at the end */\n#define _FILEBUFNUM 4096\n\t\t\tintp thisbuf=0;\n\t\t\tintp size = _FILEBUFNUM;\n\t\t\tintp bytes;\n\t\t\tintp totalbytes;\n\n\t\t\tr = (PyArrayObject *)\\\n\t\t\t\tPyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t typecode,\n\t\t\t\t\t\t 1, &size, \n\t\t\t\t\t\t NULL, NULL, \n\t\t\t\t\t\t 0, NULL);\n\t\t\tif (r==NULL) return NULL;\n\t\t\ttotalbytes = bytes = size * typecode->elsize;\n\t\t\tdptr = r->data;\n\t\t\twhile (!done) {\n\t\t\t\tdone = scan(fp, dptr, sep, NULL);\n\n\t\t\t\t/* end of file reached trying to \n\t\t\t\t scan value. done is 1 or 2\n\t\t\t\t if end of file reached trying to\n\t\t\t\t scan separator. Still good value.\n\t\t\t\t*/\n\t\t\t\tif (done < -2) break;\n\t\t\t\tthisbuf += 1;\n\t\t\t\tnread += 1;\n\t\t\t\tdptr += r->descr->elsize;\n\t\t\t\tif (!done && thisbuf == size) {\n\t\t\t\t\ttotalbytes += bytes;\n\t\t\t\t\tr->data = PyDataMem_RENEW(r->data, \n\t\t\t\t\t\t\t\t totalbytes);\n\t\t\t\t\tdptr = r->data + (totalbytes - bytes);\n\t\t\t\t\tthisbuf = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (PyErr_Occurred()) {\n\t\t\t\tPy_DECREF(r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tr->data = PyDataMem_RENEW(r->data, nread*r->descr->elsize);\n\t\t\tPyArray_DIM(r,0) = nread;\n\t\t\tnum = nread;\n#undef _FILEBUFNUM\n\t\t}\n\t}\n\tif (nread < num) {\n\t\tfprintf(stderr, \"%ld items requested but only %ld read\\n\", \n\t\t\t(long) num, (long) nread);\n\t\tr->data = PyDataMem_RENEW(r->data, nread * r->descr->elsize);\n\t\tPyArray_DIM(r,0) = nread;\n\t}\n\treturn (PyObject *)r;\n}\n\nstatic char doc_fromfile[] = \\\n\t\"fromfile(file=, dtype=int, count=-1, sep='')\\n\"\t\\\n\t\"\\n\"\\\n\t\" Return an array of the given data type from a \\n\"\\\n\t\" (text or binary) file. The file argument can be an open file\\n\"\\\n\t\" or a string with the name of a file to read from. If\\n\"\\\n\t\" count==-1, then the entire file is read, otherwise count is\\n\"\\\n\t\" the number of items of the given type read in. If sep is ''\\n\"\\\n\t\" then read a binary file, otherwise it gives the separator\\n\"\\\n\t\" between elements in a text file.\\n\"\\\n\t\"\\n\"\\\n\t\" WARNING: This function should be used sparingly, as it is not\\n\"\\\n\t\" a robust method of persistence. But it can be useful to\\n\"\\\n\t\" read in simply-formatted or binary data quickly.\";\n\nstatic PyObject *\narray_fromfile(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tPyObject *file=NULL, *ret;\n\tFILE *fp;\n\tchar *sep=\"\";\n\tchar *mode=NULL;\n\tlonglong nin=-1;\n\tstatic char *kwlist[] = {\"file\", \"dtype\", \"count\", \"sep\", NULL};\n\tPyArray_Descr *type=NULL;\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&Ls\", kwlist, \n\t\t\t\t\t &file,\n\t\t\t\t\t PyArray_DescrConverter, &type,\n\t\t\t\t\t &nin, &sep)) {\n\t\treturn NULL;\n\t}\n\n\tif (type == NULL) type = PyArray_DescrFromType(PyArray_LONG);\n\n\tif (PyString_Check(file)) {\n\t\tif (sep == \"\") mode=\"rb\";\n\t\telse mode=\"r\";\n\t\tfile = PyFile_FromString(PyString_AS_STRING(file), mode);\n\t\tif (file==NULL) return NULL;\n\t}\n\telse {\n\t\tPy_INCREF(file);\n\t}\n\tfp = PyFile_AsFile(file);\n\tif (fp == NULL) {\n\t\tPyErr_SetString(PyExc_IOError, \n\t\t\t\t\"first argument must be an open file\");\n\t\tPy_DECREF(file);\n\t\treturn NULL;\n\t}\n\tret = PyArray_FromFile(fp, type, (intp) nin, sep);\n\tPy_DECREF(file);\n\treturn ret;\n}\n\n/*OBJECT_API*/\nstatic PyObject *\nPyArray_FromBuffer(PyObject *buf, PyArray_Descr *type, \n\t\t intp count, intp offset) \n{\n\tPyArrayObject *ret;\n\tchar *data;\n\tint ts;\n\tintp s, n;\n\tint itemsize;\n\tint write=1;\n\n\n\tif (type->type_num == PyArray_OBJECT) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"cannot create an OBJECT array from memory\"\\\n\t\t\t\t\" buffer\");\n\t\tPy_DECREF(type);\n\t\treturn NULL;\n\t}\n\tif (type->elsize == 0) {\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"itemsize cannot be zero in type\");\n\t\tPy_DECREF(type);\n\t\treturn NULL; \t\t\n\t}\n\n\tif (buf->ob_type->tp_as_buffer == NULL || \\\n\t (buf->ob_type->tp_as_buffer->bf_getwritebuffer == NULL &&\t\\\n\t buf->ob_type->tp_as_buffer->bf_getreadbuffer == NULL)) {\n\t\tPyObject *newbuf;\n\t\tnewbuf = PyObject_GetAttrString(buf, \"__buffer__\");\n\t\tif (newbuf == NULL) {Py_DECREF(type); return NULL;}\n\t\tbuf = newbuf;\n\t}\n\telse {Py_INCREF(buf);}\n\n\tif (PyObject_AsWriteBuffer(buf, (void *)&data, &ts)==-1) {\n\t\twrite = 0;\n\t\tPyErr_Clear();\n\t\tif (PyObject_AsReadBuffer(buf, (void *)&data, &ts)==-1) {\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((offset < 0) || (offset >= ts)) {\n\t\tPyErr_Format(PyExc_ValueError,\n\t\t\t \"offset must be positive and smaller than %\"\n\t\t\t INTP_FMT, (intp)ts);\n\t}\n\n\tdata += offset;\n\ts = (intp)ts - offset;\n\tn = (intp)count;\n\titemsize = type->elsize;\n\t\n\tif (n < 0 ) {\n\t\tif (s % itemsize != 0) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"buffer size must be a multiple\"\\\n\t\t\t\t\t\" of element size\");\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t\tn = s/itemsize;\n\t} else {\n\t\tif (s < n*itemsize) {\n\t\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\t\"buffer is smaller than requested\"\\\n\t\t\t\t\t\" size\");\n\t\t\tPy_DECREF(buf);\n\t\t\tPy_DECREF(type);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t\n\tif ((ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, \n\t\t\t\t\t\t\t type, \n\t\t\t\t\t\t\t 1, &n, \n\t\t\t\t\t\t\t NULL, data, \n\t\t\t\t\t\t\t DEFAULT_FLAGS,\n\t\t\t\t\t\t\t NULL)) == NULL) {\n\t\tPy_DECREF(buf);\n\t\treturn NULL;\n\t}\n\t\n\tif (!write) ret->flags &= ~WRITEABLE;\n\n\t/* Store a reference for decref on deallocation */\n\tret->base = buf;\n\tPyArray_UpdateFlags(ret, ALIGNED);\n\treturn (PyObject *)ret;\n}\n\nstatic char doc_frombuffer[] = \\\n\t\"frombuffer(buffer=, dtype=int, count=-1, offset=0)\\n\"\\\n\t\"\\n\"\t\t\t\t\t\t\t\t\\\n\t\" Returns a 1-d array of data type dtype from buffer. The buffer\\n\"\\\n\t\" argument must be an object that exposes the buffer interface.\\n\"\\\n\t\" If count is -1 then the entire buffer is used, otherwise, count\\n\"\\\n\t\" is the size of the output. If offset is given then jump that\\n\"\\\n\t\" far into the buffer. If the buffer has data that is out\\n\" \\\n\t\" not in machine byte-order, than use a propert data type\\n\"\\\n\t\" descriptor. The data will not\\n\" \\\n\t\" be byteswapped, but the array will manage it in future\\n\"\\\n\t\" operations.\\n\";\n\nstatic PyObject *\narray_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)\n{\n\tPyObject *obj=NULL;\n\tlonglong nin=-1, offset=0;\n\tstatic char *kwlist[] = {\"buffer\", \"dtype\", \"count\", NULL};\n\tPyArray_Descr *type=NULL;\n\n\tif (!PyArg_ParseTupleAndKeywords(args, keywds, \"O|O&LL\", kwlist, \n\t\t\t\t\t &obj,\n\t\t\t\t\t PyArray_DescrConverter, &type,\n\t\t\t\t\t &nin, &offset)) {\n\t\treturn NULL;\n\t}\n\tif (type==NULL)\n\t\ttype = PyArray_DescrFromType(PyArray_LONG);\n\t\n\treturn PyArray_FromBuffer(obj, type, (intp)nin, (intp)offset);\n}\n\n\nstatic char doc_concatenate[] = \"concatenate((a1,a2,...),axis=None).\";\n\nstatic PyObject *\narray_concatenate(PyObject *dummy, PyObject *args, PyObject *kwds) \n{\n\tPyObject *a0;\n\tint axis=0;\n\tstatic char *kwlist[] = {\"seq\", \"axis\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O|O&\", kwlist,\n\t\t\t\t\t &a0,\n\t\t\t\t\t PyArray_AxisConverter, &axis))\n\t\treturn NULL;\n\treturn PyArray_Concatenate(a0, axis);\n}\n\nstatic char doc_innerproduct[] = \\\n\t\"inner(a,b) returns the dot product of two arrays, which has\\n\"\\\n\t\"shape a.shape[:-1] + b.shape[:-1] with elements computed by\\n\" \\\n\t\"the product of the elements from the last dimensions of a and b.\";\n\nstatic PyObject *array_innerproduct(PyObject *dummy, PyObject *args) {\n\tPyObject *b0, *a0;\n\t\n\tif (!PyArg_ParseTuple(args, \"OO\", &a0, &b0)) return NULL;\n\t\n\treturn _ARET(PyArray_InnerProduct(a0, b0));\n}\n\nstatic char doc_matrixproduct[] = \\\n\t\"dot(a,v) returns matrix-multiplication between a and b. \\n\"\\\n\t\"The product-sum is over the last dimension of a and the \\n\"\\\n\t\"second-to-last dimension of b.\";\n\nstatic PyObject *array_matrixproduct(PyObject *dummy, PyObject *args) {\n\tPyObject *v, *a;\n\t\n\tif (!PyArg_ParseTuple(args, \"OO\", &a, &v)) return NULL;\n\t\n\treturn _ARET(PyArray_MatrixProduct(a, v));\n}\n\nstatic char doc_fastCopyAndTranspose[] = \"_fastCopyAndTranspose(a)\";\n\nstatic PyObject *array_fastCopyAndTranspose(PyObject *dummy, PyObject *args) {\n\tPyObject *a0;\n\t\n\tif (!PyArg_ParseTuple(args, \"O\", &a0)) return NULL;\n\t\n\treturn _ARET(PyArray_CopyAndTranspose(a0));\n}\n\nstatic char doc_correlate[] = \"cross_correlate(a,v, mode=0)\";\n\nstatic PyObject *array_correlate(PyObject *dummy, PyObject *args, PyObject *kwds) {\n\tPyObject *shape, *a0;\n\tint mode=0;\n\tstatic char *kwlist[] = {\"a\", \"v\", \"mode\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"OO|i\", kwlist, \n\t\t\t\t\t &a0, &shape, &mode)) return NULL;\n\t\n\treturn PyArray_Correlate(a0, shape, mode);\n}\n\n\n/*MULTIARRAY_API\n Arange, \n*/\nstatic PyObject *\nPyArray_Arange(double start, double stop, double step, int type_num)\n{\n\tintp length;\n\tPyObject *range;\n\tPyArray_ArrFuncs *funcs;\n\tPyObject *obj;\n\tint ret;\n\n\tlength = (intp ) ceil((stop - start)/step);\n \n\tif (length <= 0) {\n\t\tlength = 0;\n\t\treturn PyArray_New(&PyArray_Type, 1, &length, type_num,\n\t\t\t\t NULL, NULL, 0, 0, NULL);\n\t}\n\n\trange = PyArray_New(&PyArray_Type, 1, &length, type_num, \n\t\t\t NULL, NULL, 0, 0, NULL);\n\tif (range == NULL) return NULL;\n\n\tfuncs = PyArray_DESCR(range)->f; \n\n\t/* place start in the buffer and the next value in the second position */\n\t/* if length > 2, then call the inner loop, otherwise stop */\n\n\tobj = PyFloat_FromDouble(start);\n\tret = funcs->setitem(obj, PyArray_DATA(range), (PyArrayObject *)range);\n\tPy_DECREF(obj);\n\tif (ret < 0) goto fail;\n\tif (length == 1) return range;\n\n\tobj = PyFloat_FromDouble(start + step);\n\tret = funcs->setitem(obj, PyArray_DATA(range)+PyArray_ITEMSIZE(range), \n\t\t\t (PyArrayObject *)range);\n\tPy_DECREF(obj);\n\tif (ret < 0) goto fail;\n\tif (length == 2) return range;\n\n\tif (!funcs->fill) {\n\t\tPyErr_SetString(PyExc_ValueError, \"no fill-function for data-type.\");\n\t\tPy_DECREF(range);\n\t\treturn NULL;\n\t}\n\tfuncs->fill(PyArray_DATA(range), length, (PyArrayObject *)range);\n\tif (PyErr_Occurred()) goto fail;\n\t\n\treturn range;\n\n fail:\n\tPy_DECREF(range);\n\treturn NULL;\n}\n\n/* the formula is \n len = (intp) ceil((start - stop) / step);\n*/\nstatic intp\n_calc_length(PyObject *start, PyObject *stop, PyObject *step, PyObject **next, int cmplx)\n{\n\tintp len;\n\tPyObject *val;\n\tdouble value;\n\t\n\t*next = PyNumber_Subtract(stop, start);\n\tif (!(*next)) return -1;\n\tval = PyNumber_TrueDivide(*next, step);\n\tPy_DECREF(*next); *next=NULL;\n\tif (!val) return -1;\n\tif (cmplx && PyComplex_Check(val)) {\n\t\tvalue = PyComplex_RealAsDouble(val);\n\t\tif (error_converting(value)) {Py_DECREF(val); return -1;}\n\t\tlen = (intp) ceil(value);\n\t\tvalue = PyComplex_ImagAsDouble(val);\n\t\tPy_DECREF(val);\n\t\tif (error_converting(value)) return -1;\n\t\tlen = MIN(len, (intp) ceil(value));\n\t}\n\telse {\n\t\tvalue = PyFloat_AsDouble(val);\n\t\tPy_DECREF(val);\n\t\tif (error_converting(value)) return -1;\n\t\tlen = (intp) ceil(value);\n\t}\n\t\n\tif (len > 0) {\n\t\t*next = PyNumber_Add(start, step);\n\t\tif (!next) return -1;\n\t}\n\treturn len;\n}\n\n/* this doesn't change the references */\n/*MULTIARRAY_API\n ArangeObj,\n*/\nstatic PyObject *\nPyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr *dtype) \n{\n\tPyObject *range;\n\tPyArray_ArrFuncs *funcs;\n\tPyObject *next;\n\tintp length;\n\n\tif (!dtype) {\n\t\tPyArray_Descr *deftype;\n\t\tPyArray_Descr *newtype;\n\t\tdeftype = PyArray_DescrFromType(PyArray_LONG);\n\t\tnewtype = PyArray_DescrFromObject(start, deftype);\n\t\tPy_DECREF(deftype);\n\t\tdeftype = newtype;\n\t\tif (stop && stop != Py_None) {\n\t\t\tnewtype = PyArray_DescrFromObject(stop, deftype);\n\t\t\tPy_DECREF(deftype);\n\t\t\tdeftype = newtype;\n\t\t}\n\t\tif (step && step != Py_None) {\n\t\t\tnewtype = PyArray_DescrFromObject(step, deftype);\n\t\t\tPy_DECREF(deftype);\n\t\t\tdeftype = newtype;\n\t\t}\n\t\tdtype = deftype;\n\t}\n\telse Py_INCREF(dtype);\n\n\tif (!step || step == Py_None) {\n\t\tstep = PyInt_FromLong(1);\n\t}\n\telse Py_XINCREF(step);\n\n\tif (!stop || stop == Py_None) {\n\t\tstop = start;\n\t\tstart = PyInt_FromLong(0);\n\t}\n\telse Py_INCREF(start);\n\n\t/* calculate the length and next = start + step*/\n\tlength = _calc_length(start, stop, step, &next, \n\t\t\t PyTypeNum_ISCOMPLEX(dtype->type_num));\n\n\tif (PyErr_Occurred()) {Py_DECREF(dtype); goto fail;}\n\tif (length <= 0) {\n\t\tlength = 0;\n\t\trange = PyArray_SimpleNewFromDescr(1, &length, dtype);\n\t\tPy_DECREF(step); Py_DECREF(start); return range;\n\t}\n\n\trange = PyArray_SimpleNewFromDescr(1, &length, dtype);\n\tif (range == NULL) goto fail;\n\n\tfuncs = PyArray_DESCR(range)->f;\n\n\t/* place start in the buffer and the next value in the second position */\n\t/* if length > 2, then call the inner loop, otherwise stop */\n\n\tif (funcs->setitem(start, PyArray_DATA(range), (PyArrayObject *)range) < 0)\n\t\tgoto fail;\n\tif (length == 1) goto finish;\n\tif (funcs->setitem(next, PyArray_DATA(range)+PyArray_ITEMSIZE(range), \n\t\t\t (PyArrayObject *)range) < 0) goto fail;\n\tif (length == 2) goto finish;\n\n\tif (!funcs->fill) {\n\t\tPyErr_SetString(PyExc_ValueError, \"no fill-function for data-type.\");\n\t\tPy_DECREF(range);\n\t\tgoto fail;\n\t}\n\tfuncs->fill(PyArray_DATA(range), length, (PyArrayObject *)range);\n\tif (PyErr_Occurred()) goto fail;\n\n finish:\n\tPy_DECREF(start);\n\tPy_DECREF(step);\n\tPy_DECREF(next);\n\treturn range;\n\t\n fail:\n\tPy_DECREF(start);\n\tPy_DECREF(step);\n\tPy_XDECREF(next);\n\treturn NULL;\n}\n\n\nstatic char doc_arange[] = \"arange(start, stop=None, step=1, dtype=int)\\n\\n Just like range() except it returns an array whose type can be\\n specified by the keyword argument typecode.\";\n\nstatic PyObject *\narray_arange(PyObject *ignored, PyObject *args, PyObject *kws) {\n\tPyObject *o_start=NULL, *o_stop=NULL, *o_step=NULL;\n\tstatic char *kwd[]= {\"start\", \"stop\", \"step\", \"dtype\", NULL};\n\tPyArray_Descr *typecode=NULL;\n\t\n\tif(!PyArg_ParseTupleAndKeywords(args, kws, \"O|OOO&\", kwd, &o_start,\n\t\t\t\t\t&o_stop, &o_step, \n\t\t\t\t\tPyArray_DescrConverter, \n\t\t\t\t\t&typecode)) \n\t\treturn NULL;\n\n\treturn PyArray_ArangeObj(o_start, o_stop, o_step, typecode);\n}\n\n\nstatic char \ndoc_set_string_function[] = \"set_string_function(f, repr=1) sets the python function f to be the function used to obtain a pretty printable string version of a array whenever a array is printed. f(M) should expect a array argument M, and should return a string consisting of the desired representation of M for printing.\";\n\nstatic PyObject *\narray_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds) \n{\n\tPyObject *op;\n\tint repr=1;\n\tstatic char *kwlist[] = {\"f\", \"repr\", NULL};\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kwds, \"O|i\", kwlist, \n\t\t\t\t\t&op, &repr)) return NULL; \n\tif (!PyCallable_Check(op)) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Argument must be callable.\");\n\t\treturn NULL;\n\t}\n\tPyArray_SetStringFunction(op, repr);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic char \ndoc_set_ops_function[] = \"set_numeric_ops(op=func, ...) sets some or all of the number methods for all array objects. Don't forget **dict can be used as the argument list. Returns the functions that were replaced -- can be stored and set later.\";\n\nstatic PyObject *\narray_set_ops_function(PyObject *self, PyObject *args, PyObject *kwds) \n{\n\tPyObject *oldops=NULL;\n\t\n\tif ((oldops = PyArray_GetNumericOps())==NULL) return NULL;\n\n\t/* Should probably ensure that objects are at least callable */\n\t/* Leave this to the caller for now --- error will be raised\n\t later when use is attempted \n\t*/\n\tif (kwds && PyArray_SetNumericOps(kwds) == -1) {\n\t\tPy_DECREF(oldops);\n\t\tPyErr_SetString(PyExc_ValueError, \n\t\t\t\t\"one or more objects not callable\");\n\t\treturn NULL;\n\t}\n\treturn oldops;\n}\n\n\n/*MULTIARRAY_API\n Where\n*/\nstatic PyObject *\nPyArray_Where(PyObject *condition, PyObject *x, PyObject *y)\n{\n\tPyArrayObject *arr;\n\tPyObject *tup=NULL, *obj=NULL;\n\tPyObject *ret=NULL, *zero=NULL;\n\n\n\tarr = (PyArrayObject *)PyArray_FromAny(condition, NULL, 0, 0, 0);\n\tif (arr == NULL) return NULL;\n\n\tif ((x==NULL) && (y==NULL)) {\n\t\tret = PyArray_Nonzero(arr);\n\t\tPy_DECREF(arr);\n\t\treturn ret;\n\t}\n\n\tif ((x==NULL) || (y==NULL)) {\n\t\tPy_DECREF(arr);\n\t\tPyErr_SetString(PyExc_ValueError, \"either both or neither \"\n\t\t\t\t\"of x and y should be given\");\n\t\treturn NULL;\n\t}\n\n\n\tzero = PyInt_FromLong((long) 0);\n\n\tobj = PyArray_EnsureArray(PyArray_GenericBinaryFunction(arr, zero, \n\t\t\t\t\t\t\t\tn_ops.not_equal));\n\tPy_DECREF(zero);\n\tPy_DECREF(arr);\n\tif (obj == NULL) return NULL;\n\n\ttup = Py_BuildValue(\"(OO)\", y, x);\n\tif (tup == NULL) {Py_DECREF(obj); return NULL;}\n\n\tret = PyArray_Choose((PyAO *)obj, tup);\n\n\tPy_DECREF(obj);\n\tPy_DECREF(tup);\n\treturn ret;\n}\n\nstatic char doc_where[] = \"where(condition, | x, y) is shaped like condition\"\\\n\t\" and has elements of x and y where condition is respectively true or\"\\\n\t\" false. If x or y are not given, then it is equivalent to\"\\\n\t\" nonzero(condition).\";\n\nstatic PyObject *\narray_where(PyObject *ignored, PyObject *args)\n{\n\tPyObject *obj=NULL, *x=NULL, *y=NULL;\n\t\n\tif (!PyArg_ParseTuple(args, \"O|OO\", &obj, &x, &y)) return NULL;\n\n\treturn PyArray_Where(obj, x, y);\n\n}\n\nstatic char doc_lexsort[] = \"lexsort(keys=, axis=-1) returns an array of indexes\"\\\n\t\" similar to argsort except the sorting is done using the provided sorting\"\\\n\t\" keys. First the sort is done using key[0], then the resulting list of\"\\\n\t\" indexes is further manipulated by sorting on key[0]. And so forth\"\\\n\t\" The result is a sort on multiple keys. If the keys represented columns\" \\\n\t\" of a spread-sheet, for example, this would sort using multiple columns.\"\\\n\t\" The keys argument must be a tuple of things that can be converted to \"\\\n\t\" arrays of the same shape.\";\n\nstatic PyObject *\narray_lexsort(PyObject *ignored, PyObject *args, PyObject *kwds)\n{\n\tint axis=-1;\n\tPyObject *obj;\n\tstatic char *kwlist[] = {\"keys\", \"axis\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O!|i\", kwlist, \n\t\t\t\t\t &PyTuple_Type, &obj, &axis)) return NULL;\n\t\n\treturn _ARET(PyArray_LexSort(obj, axis));\n}\n\n#undef _ARET\n\n\nstatic char doc_register_dtype[] = \\\n\t\"register_dtype(a) registers a new type object -- gives it a typenum\";\n\nstatic PyObject *\narray_register_dtype(PyObject *dummy, PyObject *args)\n{\n\tPyObject *dtype;\n\tint ret;\n\t\n\tif (!PyArg_ParseTuple(args, \"O\", &dtype)) return NULL;\n\t\n\tret = PyArray_RegisterDataType((PyTypeObject *)dtype);\n\tif (ret < 0)\n\t\treturn NULL;\n\treturn PyInt_FromLong((long) ret);\n}\n\nstatic char doc_can_cast_safely[] = \\\n\t\"can_cast_safely(from=d1, to=d2) returns True if data type d1 \"\\\n\t\"can be cast to data type d2 without losing precision.\";\n\nstatic PyObject *\narray_can_cast_safely(PyObject *dummy, PyObject *args, PyObject *kwds)\n{\n\tPyArray_Descr *d1=NULL;\n\tPyArray_Descr *d2=NULL;\n\tBool ret;\n\tPyObject *retobj;\n\tstatic char *kwlist[] = {\"from\", \"to\", NULL};\n\n\tif(!PyArg_ParseTupleAndKeywords(args, kwds, \"O&O&\", kwlist, \n\t\t\t\t\tPyArray_DescrConverter, &d1,\n\t\t\t\t\tPyArray_DescrConverter, &d2))\n\t\treturn NULL;\n\tif (d1 == NULL || d2 == NULL) {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"did not understand one of the types; \"\t\\\n\t\t\t\t\"'None' not accepted\");\n\t\treturn NULL;\n\t}\n\t\t\n\tret = PyArray_CanCastTo(d1, d2);\n\tretobj = (ret ? Py_True : Py_False);\n\tPy_INCREF(retobj);\n\treturn retobj;\n}\n\nstatic char doc_new_buffer[] = \\\n\t\"newbuffer(size) return a new uninitialized buffer object of size \"\n\t\"bytes\";\n\nstatic PyObject *\nnew_buffer(PyObject *dummy, PyObject *args)\n{\n\tint size;\n\n\tif(!PyArg_ParseTuple(args, \"i\", &size))\n\t\treturn NULL;\n\t\n\treturn PyBuffer_New(size);\n}\n\nstatic char doc_buffer_buffer[] = \\\n\t\"getbuffer(obj [,offset[, size]]) create a buffer object from the \"\\\n\t\"given object\\n referencing a slice of length size starting at \"\\\n\t\"offset. Default\\n is the entire buffer. A read-write buffer is \"\\\n\t\"attempted followed by a read-only buffer.\";\n\nstatic PyObject *\nbuffer_buffer(PyObject *dummy, PyObject *args, PyObject *kwds)\n{\n\tPyObject *obj;\n\tint offset=0, size=Py_END_OF_BUFFER, n;\n\tvoid *unused;\n\tstatic char *kwlist[] = {\"object\", \"offset\", \"size\", NULL};\n\t\n\tif (!PyArg_ParseTupleAndKeywords(args, kwds, \"O|ii\", kwlist, \n\t\t\t\t\t &obj, &offset, &size))\n\t\treturn NULL;\n\n\n\tif (PyObject_AsWriteBuffer(obj, &unused, &n) < 0) {\n\t\tPyErr_Clear();\n\t\treturn PyBuffer_FromObject(obj, offset, size);\t\t\n\t}\n\telse\n\t\treturn PyBuffer_FromReadWriteObject(obj, offset, size);\n}\n\n\nstatic struct PyMethodDef array_module_methods[] = {\n\t{\"set_string_function\", (PyCFunction)array_set_string_function, \n\t METH_VARARGS|METH_KEYWORDS, doc_set_string_function},\n\t{\"set_numeric_ops\", (PyCFunction)array_set_ops_function,\n\t METH_VARARGS|METH_KEYWORDS, doc_set_ops_function},\n\t{\"set_typeDict\", (PyCFunction)array_set_typeDict,\n\t METH_VARARGS, doc_set_typeDict},\n\n\t{\"array\",\t(PyCFunction)_array_fromobject, \n\t METH_VARARGS|METH_KEYWORDS, doc_fromobject},\n\t{\"arange\", (PyCFunction)array_arange, \n\t METH_VARARGS|METH_KEYWORDS, doc_arange},\n\t{\"zeros\",\t(PyCFunction)array_zeros, \n\t METH_VARARGS|METH_KEYWORDS, doc_zeros},\n\t{\"empty\",\t(PyCFunction)array_empty, \n\t METH_VARARGS|METH_KEYWORDS, doc_empty},\n\t{\"scalar\", (PyCFunction)array_scalar,\n\t METH_VARARGS|METH_KEYWORDS, doc_scalar},\n\t{\"where\", (PyCFunction)array_where,\n\t METH_VARARGS, doc_where},\n\t{\"lexsort\", (PyCFunction)array_lexsort,\n\t METH_VARARGS | METH_KEYWORDS, doc_lexsort},\n\t{\"fromstring\",(PyCFunction)array_fromString,\n\t METH_VARARGS|METH_KEYWORDS, doc_fromString},\n\t{\"concatenate\", (PyCFunction)array_concatenate, \n\t METH_VARARGS|METH_KEYWORDS, doc_concatenate},\n\t{\"inner\", (PyCFunction)array_innerproduct, \n\t METH_VARARGS, doc_innerproduct}, \n\t{\"dot\", (PyCFunction)array_matrixproduct, \n\t METH_VARARGS, doc_matrixproduct}, \n\t{\"_fastCopyAndTranspose\", (PyCFunction)array_fastCopyAndTranspose, \n\t METH_VARARGS, doc_fastCopyAndTranspose},\n\t{\"correlate\", (PyCFunction)array_correlate, \n\t METH_VARARGS | METH_KEYWORDS, doc_correlate},\n\t{\"frombuffer\", (PyCFunction)array_frombuffer,\n\t METH_VARARGS | METH_KEYWORDS, doc_frombuffer},\n\t{\"fromfile\", (PyCFunction)array_fromfile,\n\t METH_VARARGS | METH_KEYWORDS, doc_fromfile},\n\t{\"register_dtype\", (PyCFunction)array_register_dtype,\n\t METH_VARARGS, doc_register_dtype},\n\t{\"can_cast\", (PyCFunction)array_can_cast_safely,\n\t METH_VARARGS | METH_KEYWORDS, doc_can_cast_safely},\t\t\n\t{\"newbuffer\", (PyCFunction)new_buffer,\n\t METH_VARARGS, doc_new_buffer},\t\n\t{\"getbuffer\", (PyCFunction)buffer_buffer,\n\t METH_VARARGS | METH_KEYWORDS, doc_buffer_buffer},\t\n\t{NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\n#include \"__multiarray_api.c\"\n\n/* Establish scalar-type hierarchy */\n\n/* For dual inheritance we need to make sure that the objects being\n inherited from have the tp->mro object initialized. This is\n not necessarily true for the basic type objects of Python (it is \n checked for single inheritance but not dual in PyType_Ready).\n\n Thus, we call PyType_Ready on the standard Python Types, here.\n*/ \nstatic int\nsetup_scalartypes(PyObject *dict)\n{\n\n\tinitialize_numeric_types();\n\n if (PyType_Ready(&PyBool_Type) < 0) return -1;\n if (PyType_Ready(&PyInt_Type) < 0) return -1;\n if (PyType_Ready(&PyFloat_Type) < 0) return -1;\n if (PyType_Ready(&PyComplex_Type) < 0) return -1;\n if (PyType_Ready(&PyString_Type) < 0) return -1;\n if (PyType_Ready(&PyUnicode_Type) < 0) return -1;\n\n#define SINGLE_INHERIT(child, parent) \\\n Py##child##ArrType_Type.tp_base = &Py##parent##ArrType_Type;\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) {\t\t\\\n PyErr_Print(); \\\n PyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1;\t\t\t\t\t\t\\\n }\n \n if (PyType_Ready(&PyGenericArrType_Type) < 0)\n return -1;\n\n SINGLE_INHERIT(Number, Generic);\n SINGLE_INHERIT(Integer, Number);\n SINGLE_INHERIT(Inexact, Number);\n SINGLE_INHERIT(SignedInteger, Integer);\n SINGLE_INHERIT(UnsignedInteger, Integer);\n SINGLE_INHERIT(Floating, Inexact);\n SINGLE_INHERIT(ComplexFloating, Inexact);\n SINGLE_INHERIT(Flexible, Generic);\n SINGLE_INHERIT(Character, Flexible);\n\t\n#define DUAL_INHERIT(child, parent1, parent2) \\\n Py##child##ArrType_Type.tp_base = &Py##parent2##ArrType_Type;\t\\\n Py##child##ArrType_Type.tp_bases = \\\n Py_BuildValue(\"(OO)\", &Py##parent2##ArrType_Type,\t\\\n\t\t\t &Py##parent1##_Type);\t\t\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) { \\\n PyErr_Print(); \\\n\t\tPyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1; \\\n }\\\n Py##child##ArrType_Type.tp_hash = Py##parent1##_Type.tp_hash;\n\n#define DUAL_INHERIT2(child, parent1, parent2)\t\t\t\t\\\n Py##child##ArrType_Type.tp_base = &Py##parent1##_Type;\t\t\\\n Py##child##ArrType_Type.tp_bases = \\\n Py_BuildValue(\"(OO)\", &Py##parent1##_Type,\t\t\\\n\t\t\t &Py##parent2##ArrType_Type);\t\t\\\n\tPy##child##ArrType_Type.tp_richcompare =\t\t\t\\\n\t\tPy##parent1##_Type.tp_richcompare;\t\t\t\\\n\tPy##child##ArrType_Type.tp_compare =\t\t\t\t\\\n\t\tPy##parent1##_Type.tp_compare;\t\t\t\t\\\n Py##child##ArrType_Type.tp_hash = Py##parent1##_Type.tp_hash;\t\\\n if (PyType_Ready(&Py##child##ArrType_Type) < 0) { \\\n PyErr_Print(); \\\n\t\tPyErr_Format(PyExc_SystemError, \\\n\t\t\t \"could not initialize Py%sArrType_Type\", \\\n #child); \\\n return -1; \\\n }\n\n SINGLE_INHERIT(Bool, Generic);\n SINGLE_INHERIT(Byte, SignedInteger);\n SINGLE_INHERIT(Short, SignedInteger);\n#if SIZEOF_INT == SIZEOF_LONG\n DUAL_INHERIT(Int, Int, SignedInteger);\n#else\n SINGLE_INHERIT(Int, SignedInteger);\n#endif\n DUAL_INHERIT(Long, Int, SignedInteger);\n#if SIZEOF_LONGLONG == SIZEOF_LONG\n DUAL_INHERIT(LongLong, Int, SignedInteger);\n#else\n SINGLE_INHERIT(LongLong, SignedInteger);\n#endif\n\n /* fprintf(stderr, \"tp_free = %p, PyObject_Del = %p, int_tp_free = %p, base.tp_free = %p\\n\", PyIntArrType_Type.tp_free, PyObject_Del, PyInt_Type.tp_free, PySignedIntegerArrType_Type.tp_free);\n\t */\n\tSINGLE_INHERIT(UByte, UnsignedInteger);\n SINGLE_INHERIT(UShort, UnsignedInteger);\n SINGLE_INHERIT(UInt, UnsignedInteger);\n SINGLE_INHERIT(ULong, UnsignedInteger);\n SINGLE_INHERIT(ULongLong, UnsignedInteger);\n\n SINGLE_INHERIT(Float, Floating);\n DUAL_INHERIT(Double, Float, Floating);\n SINGLE_INHERIT(LongDouble, Floating);\n\n SINGLE_INHERIT(CFloat, ComplexFloating);\n DUAL_INHERIT(CDouble, Complex, ComplexFloating);\n SINGLE_INHERIT(CLongDouble, ComplexFloating);\n\n DUAL_INHERIT2(String, String, Character);\n DUAL_INHERIT2(Unicode, Unicode, Character);\n\t\n SINGLE_INHERIT(Void, Flexible);\n \n SINGLE_INHERIT(Object, Generic);\n\n return 0;\n\n#undef SINGLE_INHERIT\n#undef DUAL_INHERIT\n\n\t/* Clean up string and unicode array types so they act more like\n\t strings -- get their tables from the standard types.\n\t*/\n}\n\n/* place a flag dictionary in d */\n\nstatic void\nset_flaginfo(PyObject *d)\n{\n PyObject *s;\n PyObject *newd;\n \n newd = PyDict_New();\n\n PyDict_SetItemString(newd, \"OWNDATA\", s=PyInt_FromLong(OWNDATA));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"FORTRAN\", s=PyInt_FromLong(FORTRAN));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"CONTIGUOUS\", s=PyInt_FromLong(CONTIGUOUS));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"ALIGNED\", s=PyInt_FromLong(ALIGNED));\n Py_DECREF(s);\n\n PyDict_SetItemString(newd, \"UPDATEIFCOPY\", s=PyInt_FromLong(UPDATEIFCOPY));\n Py_DECREF(s);\n PyDict_SetItemString(newd, \"WRITEABLE\", s=PyInt_FromLong(WRITEABLE));\n Py_DECREF(s);\n \n PyDict_SetItemString(d, \"_flagdict\", newd);\n Py_DECREF(newd);\n return;\n}\n\n\n/* Initialization function for the module */\n\nDL_EXPORT(void) initmultiarray(void) {\n\tPyObject *m, *d, *s;\n\tPyObject *c_api;\n\t\n\t/* Create the module and add the functions */\n\tm = Py_InitModule(\"multiarray\", array_module_methods);\n\tif (!m) goto err;\n\n\t/* Add some symbolic constants to the module */\n\td = PyModule_GetDict(m);\n\tif (!d) goto err; \n\n\t/* Create the module and add the functions */\n\tif (PyType_Ready(&PyBigArray_Type) < 0) \n\t\treturn;\n\n PyArray_Type.tp_base = &PyBigArray_Type;\n\n PyArray_Type.tp_as_mapping = &array_as_mapping;\n\t/* Even though, this would be inherited, it needs to be set now\n\t so that the __getitem__ will map to the as_mapping descriptor\n\t*/\n PyArray_Type.tp_as_number = &array_as_number; \n\t/* For good measure */\n\tPyArray_Type.tp_as_sequence = &array_as_sequence;\n\tPyArray_Type.tp_as_buffer = &array_as_buffer;\t\n PyArray_Type.tp_flags = (Py_TPFLAGS_DEFAULT \n\t\t\t\t | Py_TPFLAGS_BASETYPE\n\t\t\t\t | Py_TPFLAGS_CHECKTYPES);\n PyArray_Type.tp_doc = Arraytype__doc__;\n\n\tif (PyType_Ready(&PyArray_Type) < 0)\n return;\n\n if (setup_scalartypes(d) < 0) goto err;\n\n\tPyArrayIter_Type.tp_iter = PyObject_SelfIter;\n\tPyArrayMultiIter_Type.tp_iter = PyObject_SelfIter;\n\tif (PyType_Ready(&PyArrayIter_Type) < 0)\n\t\treturn; \n \n\tif (PyType_Ready(&PyArrayMapIter_Type) < 0)\n return; \n\n\tif (PyType_Ready(&PyArrayMultiIter_Type) < 0)\n\t\treturn;\n\n\tif (PyType_Ready(&PyArrayDescr_Type) < 0)\n\t\treturn;\n\n\tc_api = PyCObject_FromVoidPtr((void *)PyArray_API, NULL);\n\tif (PyErr_Occurred()) goto err;\n\tPyDict_SetItemString(d, \"_ARRAY_API\", c_api);\n\tPy_DECREF(c_api);\n\tif (PyErr_Occurred()) goto err;\n\n\tMultiArrayError = PyString_FromString (\"multiarray.error\");\n\tPyDict_SetItemString (d, \"error\", MultiArrayError);\n\t\n\ts = PyString_FromString(\"3.0\");\n\tPyDict_SetItemString(d, \"__version__\", s);\n\tPy_DECREF(s);\n Py_INCREF(&PyBigArray_Type);\n\tPyDict_SetItemString(d, \"bigndarray\", (PyObject *)&PyBigArray_Type);\n Py_INCREF(&PyArray_Type);\n\tPyDict_SetItemString(d, \"ndarray\", (PyObject *)&PyArray_Type);\n Py_INCREF(&PyArrayIter_Type);\n\tPyDict_SetItemString(d, \"flatiter\", (PyObject *)&PyArrayIter_Type);\n Py_INCREF(&PyArrayMultiIter_Type);\n\tPyDict_SetItemString(d, \"broadcast\", \n\t\t\t (PyObject *)&PyArrayMultiIter_Type);\n\tPy_INCREF(&PyArrayDescr_Type);\n\tPyDict_SetItemString(d, \"dtypedescr\", (PyObject *)&PyArrayDescr_Type);\n\n\t/* Doesn't need to be exposed to Python \n Py_INCREF(&PyArrayMapIter_Type);\n\tPyDict_SetItemString(d, \"mapiter\", (PyObject *)&PyArrayMapIter_Type);\n\t*/\n set_flaginfo(d);\n\n\tif (set_typeinfo(d) != 0) goto err;\n\n\t_numpy_internal =\t\t\t\t\t\t\\\n\t\tPyImport_ImportModule(\"numpy.core._internal\");\n\tif (_numpy_internal != NULL) return;\n\n err:\t\n\t/* Check for errors */\n\tif (PyErr_Occurred())\n PyErr_Print();\n\t\tPy_FatalError(\"can't initialize module multiarray\");\n\n\treturn;\n}\n\n", + "methods": [ + { + "name": "_arraydescr_fromobj", + "long_name": "_arraydescr_fromobj( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 15, + "complexity": 3, + "token_count": 67, + "parameters": [ + "obj" + ], + "start_line": 34, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiplyIntList", + "long_name": "PyArray_MultiplyIntList( register int * l1 , register int n)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 36, + "parameters": [ + "l1", + "n" + ], + "start_line": 74, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiplyList", + "long_name": "PyArray_MultiplyList( register intp * l1 , register int n)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 36, + "parameters": [ + "l1", + "n" + ], + "start_line": 85, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetPtr", + "long_name": "PyArray_GetPtr( PyArrayObject * obj , register intp * ind)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 61, + "parameters": [ + "obj", + "ind" + ], + "start_line": 96, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_AxisConverter", + "long_name": "PyArray_AxisConverter( PyObject * obj , int * axis)", + "filename": "multiarraymodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 53, + "parameters": [ + "obj", + "axis" + ], + "start_line": 110, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CompareLists", + "long_name": "PyArray_CompareLists( intp * l1 , intp * l2 , int n)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 3, + "token_count": 51, + "parameters": [ + "l1", + "l2", + "n" + ], + "start_line": 128, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_View", + "long_name": "PyArray_View( PyArrayObject * self , PyArray_Descr * type)", + "filename": "multiarraymodule.c", + "nloc": 24, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self", + "type" + ], + "start_line": 142, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Ravel", + "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 5, + "token_count": 102, + "parameters": [ + "a", + "fortran" + ], + "start_line": 174, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Flatten", + "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 6, + "token_count": 176, + "parameters": [ + "a", + "fortran" + ], + "start_line": 197, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Reshape", + "long_name": "PyArray_Reshape( PyArrayObject * self , PyObject * shape)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self", + "shape" + ], + "start_line": 243, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_check_ones", + "long_name": "_check_ones( PyArrayObject * self , int newnd , intp * newdims , intp * strides)", + "filename": "multiarraymodule.c", + "nloc": 25, + "complexity": 12, + "token_count": 189, + "parameters": [ + "self", + "newnd", + "newdims", + "strides" + ], + "start_line": 255, + "end_line": 281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Newshape", + "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)", + "filename": "multiarraymodule.c", + "nloc": 72, + "complexity": 17, + "token_count": 407, + "parameters": [ + "self", + "newdims" + ], + "start_line": 292, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 88, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Squeeze", + "long_name": "PyArray_Squeeze( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 34, + "complexity": 5, + "token_count": 204, + "parameters": [ + "self" + ], + "start_line": 388, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Mean", + "long_name": "PyArray_Mean( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 19, + "complexity": 4, + "token_count": 139, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 430, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Std", + "long_name": "PyArray_Std( PyArrayObject * self , int axis , int rtype , int variance)", + "filename": "multiarraymodule.c", + "nloc": 45, + "complexity": 13, + "token_count": 450, + "parameters": [ + "self", + "axis", + "rtype", + "variance" + ], + "start_line": 458, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Sum", + "long_name": "PyArray_Sum( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 524, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Prod", + "long_name": "PyArray_Prod( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 540, + "end_line": 550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CumSum", + "long_name": "PyArray_CumSum( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 556, + "end_line": 566, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CumProd", + "long_name": "PyArray_CumProd( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 572, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Any", + "long_name": "PyArray_Any( PyArrayObject * self , int axis)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "axis" + ], + "start_line": 589, + "end_line": 600, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_All", + "long_name": "PyArray_All( PyArrayObject * self , int axis)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "axis" + ], + "start_line": 606, + "end_line": 617, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Compress", + "long_name": "PyArray_Compress( PyArrayObject * self , PyObject * condition , int axis)", + "filename": "multiarraymodule.c", + "nloc": 18, + "complexity": 3, + "token_count": 110, + "parameters": [ + "self", + "condition", + "axis" + ], + "start_line": 624, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Nonzero", + "long_name": "PyArray_Nonzero( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 51, + "complexity": 13, + "token_count": 414, + "parameters": [ + "self" + ], + "start_line": 650, + "end_line": 709, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Clip", + "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)", + "filename": "multiarraymodule.c", + "nloc": 28, + "complexity": 6, + "token_count": 237, + "parameters": [ + "self", + "min", + "max" + ], + "start_line": 715, + "end_line": 745, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Conjugate", + "long_name": "PyArray_Conjugate( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 9, + "token_count": 228, + "parameters": [ + "self" + ], + "start_line": 751, + "end_line": 787, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Trace", + "long_name": "PyArray_Trace( PyArrayObject * self , int offset , int axis1 , int axis2 , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 81, + "parameters": [ + "self", + "offset", + "axis1", + "axis2", + "rtype" + ], + "start_line": 793, + "end_line": 803, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Diagonal", + "long_name": "PyArray_Diagonal( PyArrayObject * self , int offset , int axis1 , int axis2)", + "filename": "multiarraymodule.c", + "nloc": 104, + "complexity": 23, + "token_count": 774, + "parameters": [ + "self", + "offset", + "axis1", + "axis2" + ], + "start_line": 809, + "end_line": 928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 120, + "top_nesting_level": 0 + }, + { + "name": "PyArray_AsCArray", + "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , PyArray_Descr * typedescr)", + "filename": "multiarraymodule.c", + "nloc": 50, + "complexity": 12, + "token_count": 400, + "parameters": [ + "op", + "ptr", + "dims", + "nd", + "typedescr" + ], + "start_line": 944, + "end_line": 995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "PyArray_As1D", + "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 71, + "parameters": [ + "op", + "ptr", + "d1", + "typecode" + ], + "start_line": 1003, + "end_line": 1013, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_As2D", + "long_name": "PyArray_As2D( PyObject ** op , char ** * ptr , int * d1 , int * d2 , int typecode)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 92, + "parameters": [ + "op", + "ptr", + "d1", + "d2", + "typecode" + ], + "start_line": 1019, + "end_line": 1031, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Free", + "long_name": "PyArray_Free( PyObject * op , * ptr)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 4, + "token_count": 67, + "parameters": [ + "op", + "ptr" + ], + "start_line": 1039, + "end_line": 1050, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "_swap_and_concat", + "long_name": "_swap_and_concat( PyObject * op , int axis , int n)", + "filename": "multiarraymodule.c", + "nloc": 27, + "complexity": 6, + "token_count": 185, + "parameters": [ + "op", + "axis", + "n" + ], + "start_line": 1054, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Concatenate", + "long_name": "PyArray_Concatenate( PyObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 92, + "complexity": 20, + "token_count": 617, + "parameters": [ + "op", + "axis" + ], + "start_line": 1094, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SwapAxes", + "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)", + "filename": "multiarraymodule.c", + "nloc": 38, + "complexity": 12, + "token_count": 227, + "parameters": [ + "ap", + "a1", + "a2" + ], + "start_line": 1204, + "end_line": 1245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Transpose", + "long_name": "PyArray_Transpose( PyArrayObject * ap , PyArray_Dims * permute)", + "filename": "multiarraymodule.c", + "nloc": 46, + "complexity": 10, + "token_count": 309, + "parameters": [ + "ap", + "permute" + ], + "start_line": 1251, + "end_line": 1304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Repeat", + "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 78, + "complexity": 15, + "token_count": 523, + "parameters": [ + "aop", + "op", + "axis" + ], + "start_line": 1310, + "end_line": 1405, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 96, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ConvertToCommonType", + "long_name": "PyArray_ConvertToCommonType( PyObject * op , int * retn)", + "filename": "multiarraymodule.c", + "nloc": 62, + "complexity": 12, + "token_count": 415, + "parameters": [ + "op", + "retn" + ], + "start_line": 1409, + "end_line": 1477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Choose", + "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)", + "filename": "multiarraymodule.c", + "nloc": 70, + "complexity": 15, + "token_count": 518, + "parameters": [ + "ip", + "op" + ], + "start_line": 1484, + "end_line": 1565, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 82, + "top_nesting_level": 0 + }, + { + "name": "_strided_copy", + "long_name": "_strided_copy( char * dst , intp dststride , char * src , intp srcstride , intp num , int elsize)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 48, + "parameters": [ + "dst", + "dststride", + "src", + "srcstride", + "num", + "elsize" + ], + "start_line": 1568, + "end_line": 1575, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "_new_sort", + "long_name": "_new_sort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 8, + "token_count": 284, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1586, + "end_line": 1640, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "_new_argsort", + "long_name": "_new_argsort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 67, + "complexity": 13, + "token_count": 498, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1643, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "qsortCompare", + "long_name": "qsortCompare( const * a , const * b)", + "filename": "multiarraymodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "a", + "b" + ], + "start_line": 1729, + "end_line": 1732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Sort", + "long_name": "PyArray_Sort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 52, + "complexity": 14, + "token_count": 353, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1787, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "argsort_static_compare", + "long_name": "argsort_static_compare( const * ip1 , const * ip2)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 1, + "token_count": 67, + "parameters": [ + "ip1", + "ip2" + ], + "start_line": 1859, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgSort", + "long_name": "PyArray_ArgSort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 66, + "complexity": 15, + "token_count": 493, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1873, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 81, + "top_nesting_level": 0 + }, + { + "name": "PyArray_LexSort", + "long_name": "PyArray_LexSort( PyObject * sort_keys , int axis)", + "filename": "multiarraymodule.c", + "nloc": 132, + "complexity": 36, + "token_count": 1162, + "parameters": [ + "sort_keys", + "axis" + ], + "start_line": 1965, + "end_line": 2109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 145, + "top_nesting_level": 0 + }, + { + "name": "local_where", + "long_name": "local_where( PyArrayObject * ap1 , PyArrayObject * ap2 , PyArrayObject * ret)", + "filename": "multiarraymodule.c", + "nloc": 35, + "complexity": 7, + "token_count": 243, + "parameters": [ + "ap1", + "ap2", + "ret" + ], + "start_line": 2113, + "end_line": 2148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SearchSorted", + "long_name": "PyArray_SearchSorted( PyArrayObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 5, + "token_count": 231, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2154, + "end_line": 2199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "PyArray_InnerProduct", + "long_name": "PyArray_InnerProduct( PyObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 82, + "complexity": 17, + "token_count": 659, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2210, + "end_line": 2312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 103, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MatrixProduct", + "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 101, + "complexity": 20, + "token_count": 789, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2320, + "end_line": 2443, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 124, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyAndTranspose", + "long_name": "PyArray_CopyAndTranspose( PyObject * op)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 6, + "token_count": 284, + "parameters": [ + "op" + ], + "start_line": 2449, + "end_line": 2503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Correlate", + "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)", + "filename": "multiarraymodule.c", + "nloc": 95, + "complexity": 15, + "token_count": 674, + "parameters": [ + "op1", + "op2", + "mode" + ], + "start_line": 2509, + "end_line": 2616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgMin", + "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 5, + "token_count": 141, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2623, + "end_line": 2647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Max", + "long_name": "PyArray_Max( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 71, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2653, + "end_line": 2664, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Min", + "long_name": "PyArray_Min( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 71, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2670, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Ptp", + "long_name": "PyArray_Ptp( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 4, + "token_count": 138, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2687, + "end_line": 2710, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgMax", + "long_name": "PyArray_ArgMax( PyArrayObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 7, + "token_count": 326, + "parameters": [ + "op", + "axis" + ], + "start_line": 2717, + "end_line": 2774, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 58, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Take", + "long_name": "PyArray_Take( PyArrayObject * self0 , PyObject * indices0 , int axis)", + "filename": "multiarraymodule.c", + "nloc": 65, + "complexity": 12, + "token_count": 473, + "parameters": [ + "self0", + "indices0", + "axis" + ], + "start_line": 2781, + "end_line": 2856, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 76, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Put", + "long_name": "PyArray_Put( PyArrayObject * self , PyObject * values0 , PyObject * indices0)", + "filename": "multiarraymodule.c", + "nloc": 63, + "complexity": 15, + "token_count": 465, + "parameters": [ + "self", + "values0", + "indices0" + ], + "start_line": 2862, + "end_line": 2931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "PyArray_PutMask", + "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * values0 , PyObject * mask0)", + "filename": "multiarraymodule.c", + "nloc": 65, + "complexity": 12, + "token_count": 422, + "parameters": [ + "self", + "values0", + "mask0" + ], + "start_line": 2937, + "end_line": 3008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Converter", + "long_name": "PyArray_Converter( PyObject * object , PyObject ** address)", + "filename": "multiarraymodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 66, + "parameters": [ + "object", + "address" + ], + "start_line": 3024, + "end_line": 3036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_BoolConverter", + "long_name": "PyArray_BoolConverter( PyObject * object , Bool * val)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 3, + "token_count": 42, + "parameters": [ + "object", + "val" + ], + "start_line": 3042, + "end_line": 3050, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_TypestrConvert", + "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)", + "filename": "multiarraymodule.c", + "nloc": 96, + "complexity": 35, + "token_count": 308, + "parameters": [ + "itemsize", + "gentype" + ], + "start_line": 3057, + "end_line": 3172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 116, + "top_nesting_level": 0 + }, + { + "name": "PyArray_BufferConverter", + "long_name": "PyArray_BufferConverter( PyObject * obj , PyArray_Chunk * buf)", + "filename": "multiarraymodule.c", + "nloc": 20, + "complexity": 6, + "token_count": 147, + "parameters": [ + "obj", + "buf" + ], + "start_line": 3190, + "end_line": 3215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntpConverter", + "long_name": "PyArray_IntpConverter( PyObject * obj , PyArray_Dims * seq)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 10, + "token_count": 189, + "parameters": [ + "obj", + "seq" + ], + "start_line": 3230, + "end_line": 3266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "_use_inherit", + "long_name": "_use_inherit( PyArray_Descr * type , PyObject * newobj , int * errflag)", + "filename": "multiarraymodule.c", + "nloc": 32, + "complexity": 7, + "token_count": 161, + "parameters": [ + "type", + "newobj", + "errflag" + ], + "start_line": 3284, + "end_line": 3317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_tuple", + "long_name": "_convert_from_tuple( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 57, + "complexity": 11, + "token_count": 335, + "parameters": [ + "obj" + ], + "start_line": 3320, + "end_line": 3388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_array_descr", + "long_name": "_convert_from_array_descr( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 60, + "complexity": 11, + "token_count": 395, + "parameters": [ + "obj" + ], + "start_line": 3396, + "end_line": 3458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_list", + "long_name": "_convert_from_list( PyObject * obj , int align , int try_descr)", + "filename": "multiarraymodule.c", + "nloc": 62, + "complexity": 11, + "token_count": 392, + "parameters": [ + "obj", + "align", + "try_descr" + ], + "start_line": 3469, + "end_line": 3532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_commastring", + "long_name": "_convert_from_commastring( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 5, + "token_count": 92, + "parameters": [ + "obj", + "align" + ], + "start_line": 3545, + "end_line": 3561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_use_fields_dict", + "long_name": "_use_fields_dict( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "obj", + "align" + ], + "start_line": 3598, + "end_line": 3603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_dict", + "long_name": "_convert_from_dict( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 92, + "complexity": 25, + "token_count": 639, + "parameters": [ + "obj", + "align" + ], + "start_line": 3606, + "end_line": 3707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrConverter2", + "long_name": "PyArray_DescrConverter2( PyObject * obj , PyArray_Descr ** at)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 37, + "parameters": [ + "obj", + "at" + ], + "start_line": 3725, + "end_line": 3732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrConverter", + "long_name": "PyArray_DescrConverter( PyObject * obj , PyArray_Descr ** at)", + "filename": "multiarraymodule.c", + "nloc": 148, + "complexity": 58, + "token_count": 921, + "parameters": [ + "obj", + "at" + ], + "start_line": 3749, + "end_line": 3931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 183, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ByteorderConverter", + "long_name": "PyArray_ByteorderConverter( PyObject * obj , char * endian)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 16, + "token_count": 218, + "parameters": [ + "obj", + "endian" + ], + "start_line": 3937, + "end_line": 3969, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SortkindConverter", + "long_name": "PyArray_SortkindConverter( PyObject * obj , PyArray_SORTKIND * sortkind)", + "filename": "multiarraymodule.c", + "nloc": 27, + "complexity": 11, + "token_count": 162, + "parameters": [ + "obj", + "sortkind" + ], + "start_line": 3975, + "end_line": 4001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_EquivTypes", + "long_name": "PyArray_EquivTypes( PyArray_Descr * typ1 , PyArray_Descr * typ2)", + "filename": "multiarraymodule.c", + "nloc": 18, + "complexity": 8, + "token_count": 138, + "parameters": [ + "typ1", + "typ2" + ], + "start_line": 4010, + "end_line": 4029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "_array_fromobject", + "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)", + "filename": "multiarraymodule.c", + "nloc": 59, + "complexity": 15, + "token_count": 325, + "parameters": [ + "ignored", + "args", + "kws" + ], + "start_line": 4050, + "end_line": 4115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Empty", + "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Descr * type , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 14, + "complexity": 4, + "token_count": 96, + "parameters": [ + "nd", + "dims", + "type", + "fortran" + ], + "start_line": 4123, + "end_line": 4138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_empty", + "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 2, + "token_count": 130, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4144, + "end_line": 4168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_scalar", + "long_name": "array_scalar( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 51, + "complexity": 10, + "token_count": 254, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4173, + "end_line": 4231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 59, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Zeros", + "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Descr * type , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 4, + "token_count": 134, + "parameters": [ + "nd", + "dims", + "type", + "fortran" + ], + "start_line": 4240, + "end_line": 4264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_zeros", + "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 2, + "token_count": 133, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4270, + "end_line": 4294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_set_typeDict", + "long_name": "array_set_typeDict( PyObject * ignored , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 54, + "parameters": [ + "ignored", + "args" + ], + "start_line": 4301, + "end_line": 4310, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromString", + "long_name": "PyArray_FromString( char * data , intp slen , PyArray_Descr * dtype , intp n)", + "filename": "multiarraymodule.c", + "nloc": 46, + "complexity": 8, + "token_count": 222, + "parameters": [ + "data", + "slen", + "dtype", + "n" + ], + "start_line": 4315, + "end_line": 4366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "array_fromString", + "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 15, + "complexity": 2, + "token_count": 103, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4371, + "end_line": 4387, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromFile", + "long_name": "PyArray_FromFile( FILE * fp , PyArray_Descr * typecode , intp num , char * sep)", + "filename": "multiarraymodule.c", + "nloc": 111, + "complexity": 22, + "token_count": 649, + "parameters": [ + "fp", + "typecode", + "num", + "sep" + ], + "start_line": 4401, + "end_line": 4526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 126, + "top_nesting_level": 0 + }, + { + "name": "array_fromfile", + "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 7, + "token_count": 225, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4544, + "end_line": 4582, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromBuffer", + "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Descr * type , intp count , intp offset)", + "filename": "multiarraymodule.c", + "nloc": 83, + "complexity": 16, + "token_count": 446, + "parameters": [ + "buf", + "type", + "count", + "offset" + ], + "start_line": 4586, + "end_line": 4679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + }, + { + "name": "array_frombuffer", + "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 119, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4695, + "end_line": 4712, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_concatenate", + "long_name": "array_concatenate( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 73, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4718, + "end_line": 4729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_innerproduct", + "long_name": "array_innerproduct( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4736, + "end_line": 4742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_matrixproduct", + "long_name": "array_matrixproduct( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4749, + "end_line": 4755, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_fastCopyAndTranspose", + "long_name": "array_fastCopyAndTranspose( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 41, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4759, + "end_line": 4765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_correlate", + "long_name": "array_correlate( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 81, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4769, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Arange", + "long_name": "PyArray_Arange( double start , double stop , double step , int type_num)", + "filename": "multiarraymodule.c", + "nloc": 40, + "complexity": 9, + "token_count": 300, + "parameters": [ + "start", + "stop", + "step", + "type_num" + ], + "start_line": 4785, + "end_line": 4836, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "_calc_length", + "long_name": "_calc_length( PyObject * start , PyObject * stop , PyObject * step , PyObject ** next , int cmplx)", + "filename": "multiarraymodule.c", + "nloc": 31, + "complexity": 10, + "token_count": 235, + "parameters": [ + "start", + "stop", + "step", + "next", + "cmplx" + ], + "start_line": 4842, + "end_line": 4874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArangeObj", + "long_name": "PyArray_ArangeObj( PyObject * start , PyObject * stop , PyObject * step , PyArray_Descr * dtype)", + "filename": "multiarraymodule.c", + "nloc": 70, + "complexity": 19, + "token_count": 461, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 4881, + "end_line": 4965, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "array_arange", + "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 100, + "parameters": [ + "ignored", + "args", + "kws" + ], + "start_line": 4971, + "end_line": 4983, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_set_string_function", + "long_name": "array_set_string_function( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 98, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4990, + "end_line": 5006, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "array_set_ops_function", + "long_name": "array_set_ops_function( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 12, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 5012, + "end_line": 5029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Where", + "long_name": "PyArray_Where( PyObject * condition , PyObject * x , PyObject * y)", + "filename": "multiarraymodule.c", + "nloc": 31, + "complexity": 8, + "token_count": 231, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 5036, + "end_line": 5076, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "array_where", + "long_name": "array_where( PyObject * ignored , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 60, + "parameters": [ + "ignored", + "args" + ], + "start_line": 5084, + "end_line": 5092, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_lexsort", + "long_name": "array_lexsort( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 5104, + "end_line": 5114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "array_register_dtype", + "long_name": "array_register_dtype( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "dummy", + "args" + ], + "start_line": 5123, + "end_line": 5134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_can_cast_safely", + "long_name": "array_can_cast_safely( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 5, + "token_count": 128, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 5141, + "end_line": 5164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "new_buffer", + "long_name": "new_buffer( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "dummy", + "args" + ], + "start_line": 5171, + "end_line": 5179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "buffer_buffer", + "long_name": "buffer_buffer( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 120, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 5188, + "end_line": 5206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "setup_scalartypes", + "long_name": "setup_scalartypes( PyObject * dict)", + "filename": "multiarraymodule.c", + "nloc": 45, + "complexity": 10, + "token_count": 351, + "parameters": [ + "dict" + ], + "start_line": 5270, + "end_line": 5383, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 114, + "top_nesting_level": 0 + }, + { + "name": "set_flaginfo", + "long_name": "set_flaginfo( PyObject * d)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 1, + "token_count": 152, + "parameters": [ + "d" + ], + "start_line": 5388, + "end_line": 5412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "initmultiarray", + "long_name": "initmultiarray()", + "filename": "multiarraymodule.c", + "nloc": 63, + "complexity": 15, + "token_count": 434, + "parameters": [], + "start_line": 5417, + "end_line": 5510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_arraydescr_fromobj", + "long_name": "_arraydescr_fromobj( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 15, + "complexity": 3, + "token_count": 67, + "parameters": [ + "obj" + ], + "start_line": 34, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiplyIntList", + "long_name": "PyArray_MultiplyIntList( register int * l1 , register int n)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 36, + "parameters": [ + "l1", + "n" + ], + "start_line": 74, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MultiplyList", + "long_name": "PyArray_MultiplyList( register intp * l1 , register int n)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 36, + "parameters": [ + "l1", + "n" + ], + "start_line": 85, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "PyArray_GetPtr", + "long_name": "PyArray_GetPtr( PyArrayObject * obj , register intp * ind)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 61, + "parameters": [ + "obj", + "ind" + ], + "start_line": 96, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_AxisConverter", + "long_name": "PyArray_AxisConverter( PyObject * obj , int * axis)", + "filename": "multiarraymodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 53, + "parameters": [ + "obj", + "axis" + ], + "start_line": 110, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CompareLists", + "long_name": "PyArray_CompareLists( intp * l1 , intp * l2 , int n)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 3, + "token_count": 51, + "parameters": [ + "l1", + "l2", + "n" + ], + "start_line": 128, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_View", + "long_name": "PyArray_View( PyArrayObject * self , PyArray_Descr * type)", + "filename": "multiarraymodule.c", + "nloc": 24, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self", + "type" + ], + "start_line": 142, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Ravel", + "long_name": "PyArray_Ravel( PyArrayObject * a , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 5, + "token_count": 102, + "parameters": [ + "a", + "fortran" + ], + "start_line": 174, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Flatten", + "long_name": "PyArray_Flatten( PyArrayObject * a , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 6, + "token_count": 176, + "parameters": [ + "a", + "fortran" + ], + "start_line": 197, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Reshape", + "long_name": "PyArray_Reshape( PyArrayObject * self , PyObject * shape)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self", + "shape" + ], + "start_line": 243, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_check_ones", + "long_name": "_check_ones( PyArrayObject * self , int newnd , intp * newdims , intp * strides)", + "filename": "multiarraymodule.c", + "nloc": 25, + "complexity": 12, + "token_count": 189, + "parameters": [ + "self", + "newnd", + "newdims", + "strides" + ], + "start_line": 255, + "end_line": 281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Newshape", + "long_name": "PyArray_Newshape( PyArrayObject * self , PyArray_Dims * newdims)", + "filename": "multiarraymodule.c", + "nloc": 72, + "complexity": 17, + "token_count": 407, + "parameters": [ + "self", + "newdims" + ], + "start_line": 292, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 88, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Squeeze", + "long_name": "PyArray_Squeeze( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 34, + "complexity": 5, + "token_count": 204, + "parameters": [ + "self" + ], + "start_line": 388, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Mean", + "long_name": "PyArray_Mean( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 19, + "complexity": 4, + "token_count": 139, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 430, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Std", + "long_name": "PyArray_Std( PyArrayObject * self , int axis , int rtype , int variance)", + "filename": "multiarraymodule.c", + "nloc": 45, + "complexity": 13, + "token_count": 450, + "parameters": [ + "self", + "axis", + "rtype", + "variance" + ], + "start_line": 458, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Sum", + "long_name": "PyArray_Sum( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 524, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Prod", + "long_name": "PyArray_Prod( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 540, + "end_line": 550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CumSum", + "long_name": "PyArray_CumSum( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 556, + "end_line": 566, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CumProd", + "long_name": "PyArray_CumProd( PyArrayObject * self , int axis , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 69, + "parameters": [ + "self", + "axis", + "rtype" + ], + "start_line": 572, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Any", + "long_name": "PyArray_Any( PyArrayObject * self , int axis)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "axis" + ], + "start_line": 589, + "end_line": 600, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_All", + "long_name": "PyArray_All( PyArrayObject * self , int axis)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self", + "axis" + ], + "start_line": 606, + "end_line": 617, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Compress", + "long_name": "PyArray_Compress( PyArrayObject * self , PyObject * condition , int axis)", + "filename": "multiarraymodule.c", + "nloc": 18, + "complexity": 3, + "token_count": 110, + "parameters": [ + "self", + "condition", + "axis" + ], + "start_line": 624, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Nonzero", + "long_name": "PyArray_Nonzero( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 51, + "complexity": 13, + "token_count": 414, + "parameters": [ + "self" + ], + "start_line": 650, + "end_line": 709, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Clip", + "long_name": "PyArray_Clip( PyArrayObject * self , PyObject * min , PyObject * max)", + "filename": "multiarraymodule.c", + "nloc": 28, + "complexity": 6, + "token_count": 237, + "parameters": [ + "self", + "min", + "max" + ], + "start_line": 715, + "end_line": 745, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Conjugate", + "long_name": "PyArray_Conjugate( PyArrayObject * self)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 9, + "token_count": 228, + "parameters": [ + "self" + ], + "start_line": 751, + "end_line": 787, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Trace", + "long_name": "PyArray_Trace( PyArrayObject * self , int offset , int axis1 , int axis2 , int rtype)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 81, + "parameters": [ + "self", + "offset", + "axis1", + "axis2", + "rtype" + ], + "start_line": 793, + "end_line": 803, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Diagonal", + "long_name": "PyArray_Diagonal( PyArrayObject * self , int offset , int axis1 , int axis2)", + "filename": "multiarraymodule.c", + "nloc": 104, + "complexity": 23, + "token_count": 774, + "parameters": [ + "self", + "offset", + "axis1", + "axis2" + ], + "start_line": 809, + "end_line": 928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 120, + "top_nesting_level": 0 + }, + { + "name": "PyArray_AsCArray", + "long_name": "PyArray_AsCArray( PyObject ** op , * ptr , intp * dims , int nd , PyArray_Descr * typedescr)", + "filename": "multiarraymodule.c", + "nloc": 50, + "complexity": 12, + "token_count": 400, + "parameters": [ + "op", + "ptr", + "dims", + "nd", + "typedescr" + ], + "start_line": 944, + "end_line": 995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "PyArray_As1D", + "long_name": "PyArray_As1D( PyObject ** op , char ** ptr , int * d1 , int typecode)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 71, + "parameters": [ + "op", + "ptr", + "d1", + "typecode" + ], + "start_line": 1003, + "end_line": 1013, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "PyArray_As2D", + "long_name": "PyArray_As2D( PyObject ** op , char ** * ptr , int * d1 , int * d2 , int typecode)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 92, + "parameters": [ + "op", + "ptr", + "d1", + "d2", + "typecode" + ], + "start_line": 1019, + "end_line": 1031, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Free", + "long_name": "PyArray_Free( PyObject * op , * ptr)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 4, + "token_count": 67, + "parameters": [ + "op", + "ptr" + ], + "start_line": 1039, + "end_line": 1050, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "_swap_and_concat", + "long_name": "_swap_and_concat( PyObject * op , int axis , int n)", + "filename": "multiarraymodule.c", + "nloc": 27, + "complexity": 6, + "token_count": 185, + "parameters": [ + "op", + "axis", + "n" + ], + "start_line": 1054, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Concatenate", + "long_name": "PyArray_Concatenate( PyObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 92, + "complexity": 20, + "token_count": 617, + "parameters": [ + "op", + "axis" + ], + "start_line": 1094, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SwapAxes", + "long_name": "PyArray_SwapAxes( PyArrayObject * ap , int a1 , int a2)", + "filename": "multiarraymodule.c", + "nloc": 38, + "complexity": 12, + "token_count": 227, + "parameters": [ + "ap", + "a1", + "a2" + ], + "start_line": 1204, + "end_line": 1245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Transpose", + "long_name": "PyArray_Transpose( PyArrayObject * ap , PyArray_Dims * permute)", + "filename": "multiarraymodule.c", + "nloc": 46, + "complexity": 10, + "token_count": 309, + "parameters": [ + "ap", + "permute" + ], + "start_line": 1251, + "end_line": 1304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Repeat", + "long_name": "PyArray_Repeat( PyArrayObject * aop , PyObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 78, + "complexity": 15, + "token_count": 523, + "parameters": [ + "aop", + "op", + "axis" + ], + "start_line": 1310, + "end_line": 1405, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 96, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ConvertToCommonType", + "long_name": "PyArray_ConvertToCommonType( PyObject * op , int * retn)", + "filename": "multiarraymodule.c", + "nloc": 62, + "complexity": 12, + "token_count": 415, + "parameters": [ + "op", + "retn" + ], + "start_line": 1409, + "end_line": 1477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Choose", + "long_name": "PyArray_Choose( PyArrayObject * ip , PyObject * op)", + "filename": "multiarraymodule.c", + "nloc": 70, + "complexity": 15, + "token_count": 518, + "parameters": [ + "ip", + "op" + ], + "start_line": 1484, + "end_line": 1565, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 82, + "top_nesting_level": 0 + }, + { + "name": "_strided_copy", + "long_name": "_strided_copy( char * dst , intp dststride , char * src , intp srcstride , intp num , int elsize)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 48, + "parameters": [ + "dst", + "dststride", + "src", + "srcstride", + "num", + "elsize" + ], + "start_line": 1568, + "end_line": 1575, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "_new_sort", + "long_name": "_new_sort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 8, + "token_count": 284, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1586, + "end_line": 1640, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "_new_argsort", + "long_name": "_new_argsort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 67, + "complexity": 13, + "token_count": 498, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1643, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "qsortCompare", + "long_name": "qsortCompare( const * a , const * b)", + "filename": "multiarraymodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "a", + "b" + ], + "start_line": 1729, + "end_line": 1732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Sort", + "long_name": "PyArray_Sort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 52, + "complexity": 14, + "token_count": 353, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1787, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "argsort_static_compare", + "long_name": "argsort_static_compare( const * ip1 , const * ip2)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 1, + "token_count": 67, + "parameters": [ + "ip1", + "ip2" + ], + "start_line": 1859, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgSort", + "long_name": "PyArray_ArgSort( PyArrayObject * op , int axis , PyArray_SORTKIND which)", + "filename": "multiarraymodule.c", + "nloc": 66, + "complexity": 15, + "token_count": 493, + "parameters": [ + "op", + "axis", + "which" + ], + "start_line": 1873, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 81, + "top_nesting_level": 0 + }, + { + "name": "PyArray_LexSort", + "long_name": "PyArray_LexSort( PyObject * sort_keys , int axis)", + "filename": "multiarraymodule.c", + "nloc": 132, + "complexity": 36, + "token_count": 1162, + "parameters": [ + "sort_keys", + "axis" + ], + "start_line": 1965, + "end_line": 2109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 145, + "top_nesting_level": 0 + }, + { + "name": "local_where", + "long_name": "local_where( PyArrayObject * ap1 , PyArrayObject * ap2 , PyArrayObject * ret)", + "filename": "multiarraymodule.c", + "nloc": 35, + "complexity": 7, + "token_count": 243, + "parameters": [ + "ap1", + "ap2", + "ret" + ], + "start_line": 2113, + "end_line": 2148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SearchSorted", + "long_name": "PyArray_SearchSorted( PyArrayObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 5, + "token_count": 231, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2154, + "end_line": 2199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + }, + { + "name": "PyArray_InnerProduct", + "long_name": "PyArray_InnerProduct( PyObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 82, + "complexity": 17, + "token_count": 659, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2210, + "end_line": 2312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 103, + "top_nesting_level": 0 + }, + { + "name": "PyArray_MatrixProduct", + "long_name": "PyArray_MatrixProduct( PyObject * op1 , PyObject * op2)", + "filename": "multiarraymodule.c", + "nloc": 101, + "complexity": 20, + "token_count": 789, + "parameters": [ + "op1", + "op2" + ], + "start_line": 2320, + "end_line": 2443, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 124, + "top_nesting_level": 0 + }, + { + "name": "PyArray_CopyAndTranspose", + "long_name": "PyArray_CopyAndTranspose( PyObject * op)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 6, + "token_count": 284, + "parameters": [ + "op" + ], + "start_line": 2449, + "end_line": 2503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Correlate", + "long_name": "PyArray_Correlate( PyObject * op1 , PyObject * op2 , int mode)", + "filename": "multiarraymodule.c", + "nloc": 95, + "complexity": 15, + "token_count": 674, + "parameters": [ + "op1", + "op2", + "mode" + ], + "start_line": 2509, + "end_line": 2616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgMin", + "long_name": "PyArray_ArgMin( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 5, + "token_count": 141, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2623, + "end_line": 2647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Max", + "long_name": "PyArray_Max( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 71, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2653, + "end_line": 2664, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Min", + "long_name": "PyArray_Min( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 71, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2670, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Ptp", + "long_name": "PyArray_Ptp( PyArrayObject * ap , int axis)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 4, + "token_count": 138, + "parameters": [ + "ap", + "axis" + ], + "start_line": 2687, + "end_line": 2710, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArgMax", + "long_name": "PyArray_ArgMax( PyArrayObject * op , int axis)", + "filename": "multiarraymodule.c", + "nloc": 47, + "complexity": 7, + "token_count": 326, + "parameters": [ + "op", + "axis" + ], + "start_line": 2717, + "end_line": 2774, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 58, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Take", + "long_name": "PyArray_Take( PyArrayObject * self0 , PyObject * indices0 , int axis)", + "filename": "multiarraymodule.c", + "nloc": 65, + "complexity": 12, + "token_count": 473, + "parameters": [ + "self0", + "indices0", + "axis" + ], + "start_line": 2781, + "end_line": 2856, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 76, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Put", + "long_name": "PyArray_Put( PyArrayObject * self , PyObject * values0 , PyObject * indices0)", + "filename": "multiarraymodule.c", + "nloc": 63, + "complexity": 15, + "token_count": 465, + "parameters": [ + "self", + "values0", + "indices0" + ], + "start_line": 2862, + "end_line": 2931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "PyArray_PutMask", + "long_name": "PyArray_PutMask( PyArrayObject * self , PyObject * values0 , PyObject * mask0)", + "filename": "multiarraymodule.c", + "nloc": 65, + "complexity": 12, + "token_count": 422, + "parameters": [ + "self", + "values0", + "mask0" + ], + "start_line": 2937, + "end_line": 3008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Converter", + "long_name": "PyArray_Converter( PyObject * object , PyObject ** address)", + "filename": "multiarraymodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 66, + "parameters": [ + "object", + "address" + ], + "start_line": 3024, + "end_line": 3036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "PyArray_BoolConverter", + "long_name": "PyArray_BoolConverter( PyObject * object , Bool * val)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 3, + "token_count": 42, + "parameters": [ + "object", + "val" + ], + "start_line": 3042, + "end_line": 3050, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "PyArray_TypestrConvert", + "long_name": "PyArray_TypestrConvert( int itemsize , int gentype)", + "filename": "multiarraymodule.c", + "nloc": 96, + "complexity": 35, + "token_count": 308, + "parameters": [ + "itemsize", + "gentype" + ], + "start_line": 3057, + "end_line": 3172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 116, + "top_nesting_level": 0 + }, + { + "name": "PyArray_BufferConverter", + "long_name": "PyArray_BufferConverter( PyObject * obj , PyArray_Chunk * buf)", + "filename": "multiarraymodule.c", + "nloc": 20, + "complexity": 6, + "token_count": 147, + "parameters": [ + "obj", + "buf" + ], + "start_line": 3190, + "end_line": 3215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "PyArray_IntpConverter", + "long_name": "PyArray_IntpConverter( PyObject * obj , PyArray_Dims * seq)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 10, + "token_count": 189, + "parameters": [ + "obj", + "seq" + ], + "start_line": 3230, + "end_line": 3266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "_use_inherit", + "long_name": "_use_inherit( PyArray_Descr * type , PyObject * newobj , int * errflag)", + "filename": "multiarraymodule.c", + "nloc": 32, + "complexity": 7, + "token_count": 161, + "parameters": [ + "type", + "newobj", + "errflag" + ], + "start_line": 3284, + "end_line": 3317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_tuple", + "long_name": "_convert_from_tuple( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 57, + "complexity": 11, + "token_count": 335, + "parameters": [ + "obj" + ], + "start_line": 3320, + "end_line": 3388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_array_descr", + "long_name": "_convert_from_array_descr( PyObject * obj)", + "filename": "multiarraymodule.c", + "nloc": 60, + "complexity": 11, + "token_count": 395, + "parameters": [ + "obj" + ], + "start_line": 3396, + "end_line": 3458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_list", + "long_name": "_convert_from_list( PyObject * obj , int align , int try_descr)", + "filename": "multiarraymodule.c", + "nloc": 62, + "complexity": 11, + "token_count": 392, + "parameters": [ + "obj", + "align", + "try_descr" + ], + "start_line": 3469, + "end_line": 3532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_commastring", + "long_name": "_convert_from_commastring( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 5, + "token_count": 92, + "parameters": [ + "obj", + "align" + ], + "start_line": 3545, + "end_line": 3561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_use_fields_dict", + "long_name": "_use_fields_dict( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "obj", + "align" + ], + "start_line": 3598, + "end_line": 3603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_dict", + "long_name": "_convert_from_dict( PyObject * obj , int align)", + "filename": "multiarraymodule.c", + "nloc": 92, + "complexity": 25, + "token_count": 639, + "parameters": [ + "obj", + "align" + ], + "start_line": 3606, + "end_line": 3707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrConverter2", + "long_name": "PyArray_DescrConverter2( PyObject * obj , PyArray_Descr ** at)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 37, + "parameters": [ + "obj", + "at" + ], + "start_line": 3725, + "end_line": 3732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "PyArray_DescrConverter", + "long_name": "PyArray_DescrConverter( PyObject * obj , PyArray_Descr ** at)", + "filename": "multiarraymodule.c", + "nloc": 148, + "complexity": 58, + "token_count": 921, + "parameters": [ + "obj", + "at" + ], + "start_line": 3749, + "end_line": 3931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 183, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ByteorderConverter", + "long_name": "PyArray_ByteorderConverter( PyObject * obj , char * endian)", + "filename": "multiarraymodule.c", + "nloc": 33, + "complexity": 16, + "token_count": 218, + "parameters": [ + "obj", + "endian" + ], + "start_line": 3937, + "end_line": 3969, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "PyArray_SortkindConverter", + "long_name": "PyArray_SortkindConverter( PyObject * obj , PyArray_SORTKIND * sortkind)", + "filename": "multiarraymodule.c", + "nloc": 27, + "complexity": 11, + "token_count": 162, + "parameters": [ + "obj", + "sortkind" + ], + "start_line": 3975, + "end_line": 4001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "PyArray_EquivTypes", + "long_name": "PyArray_EquivTypes( PyArray_Descr * typ1 , PyArray_Descr * typ2)", + "filename": "multiarraymodule.c", + "nloc": 18, + "complexity": 8, + "token_count": 138, + "parameters": [ + "typ1", + "typ2" + ], + "start_line": 4010, + "end_line": 4029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "_array_fromobject", + "long_name": "_array_fromobject( PyObject * ignored , PyObject * args , PyObject * kws)", + "filename": "multiarraymodule.c", + "nloc": 59, + "complexity": 15, + "token_count": 325, + "parameters": [ + "ignored", + "args", + "kws" + ], + "start_line": 4050, + "end_line": 4115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Empty", + "long_name": "PyArray_Empty( int nd , intp * dims , PyArray_Descr * type , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 14, + "complexity": 4, + "token_count": 96, + "parameters": [ + "nd", + "dims", + "type", + "fortran" + ], + "start_line": 4123, + "end_line": 4138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "array_empty", + "long_name": "array_empty( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 2, + "token_count": 130, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4144, + "end_line": 4168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_scalar", + "long_name": "array_scalar( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 51, + "complexity": 10, + "token_count": 254, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4173, + "end_line": 4231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 59, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Zeros", + "long_name": "PyArray_Zeros( int nd , intp * dims , PyArray_Descr * type , int fortran)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 4, + "token_count": 134, + "parameters": [ + "nd", + "dims", + "type", + "fortran" + ], + "start_line": 4240, + "end_line": 4264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_zeros", + "long_name": "array_zeros( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 2, + "token_count": 133, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 4270, + "end_line": 4294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "array_set_typeDict", + "long_name": "array_set_typeDict( PyObject * ignored , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 54, + "parameters": [ + "ignored", + "args" + ], + "start_line": 4301, + "end_line": 4310, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromString", + "long_name": "PyArray_FromString( char * data , intp slen , PyArray_Descr * dtype , intp n)", + "filename": "multiarraymodule.c", + "nloc": 46, + "complexity": 8, + "token_count": 222, + "parameters": [ + "data", + "slen", + "dtype", + "n" + ], + "start_line": 4315, + "end_line": 4366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "array_fromString", + "long_name": "array_fromString( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 15, + "complexity": 2, + "token_count": 103, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4371, + "end_line": 4387, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromFile", + "long_name": "PyArray_FromFile( FILE * fp , PyArray_Descr * typecode , intp num , char * sep)", + "filename": "multiarraymodule.c", + "nloc": 111, + "complexity": 22, + "token_count": 649, + "parameters": [ + "fp", + "typecode", + "num", + "sep" + ], + "start_line": 4401, + "end_line": 4526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 126, + "top_nesting_level": 0 + }, + { + "name": "array_fromfile", + "long_name": "array_fromfile( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 36, + "complexity": 7, + "token_count": 225, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4544, + "end_line": 4582, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "PyArray_FromBuffer", + "long_name": "PyArray_FromBuffer( PyObject * buf , PyArray_Descr * type , intp count , intp offset)", + "filename": "multiarraymodule.c", + "nloc": 83, + "complexity": 16, + "token_count": 446, + "parameters": [ + "buf", + "type", + "count", + "offset" + ], + "start_line": 4586, + "end_line": 4679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + }, + { + "name": "array_frombuffer", + "long_name": "array_frombuffer( PyObject * ignored , PyObject * args , PyObject * keywds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 119, + "parameters": [ + "ignored", + "args", + "keywds" + ], + "start_line": 4695, + "end_line": 4712, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "array_concatenate", + "long_name": "array_concatenate( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 73, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4718, + "end_line": 4729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_innerproduct", + "long_name": "array_innerproduct( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4736, + "end_line": 4742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_matrixproduct", + "long_name": "array_matrixproduct( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4749, + "end_line": 4755, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_fastCopyAndTranspose", + "long_name": "array_fastCopyAndTranspose( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 5, + "complexity": 2, + "token_count": 41, + "parameters": [ + "dummy", + "args" + ], + "start_line": 4759, + "end_line": 4765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_correlate", + "long_name": "array_correlate( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 8, + "complexity": 2, + "token_count": 81, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4769, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Arange", + "long_name": "PyArray_Arange( double start , double stop , double step , int type_num)", + "filename": "multiarraymodule.c", + "nloc": 40, + "complexity": 9, + "token_count": 300, + "parameters": [ + "start", + "stop", + "step", + "type_num" + ], + "start_line": 4785, + "end_line": 4836, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "_calc_length", + "long_name": "_calc_length( PyObject * start , PyObject * stop , PyObject * step , PyObject ** next , int cmplx)", + "filename": "multiarraymodule.c", + "nloc": 31, + "complexity": 10, + "token_count": 235, + "parameters": [ + "start", + "stop", + "step", + "next", + "cmplx" + ], + "start_line": 4842, + "end_line": 4874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 0 + }, + { + "name": "PyArray_ArangeObj", + "long_name": "PyArray_ArangeObj( PyObject * start , PyObject * stop , PyObject * step , PyArray_Descr * dtype)", + "filename": "multiarraymodule.c", + "nloc": 70, + "complexity": 19, + "token_count": 461, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 4881, + "end_line": 4965, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "array_arange", + "long_name": "array_arange( PyObject * ignored , PyObject * args , PyObject * kws)", + "filename": "multiarraymodule.c", + "nloc": 11, + "complexity": 2, + "token_count": 100, + "parameters": [ + "ignored", + "args", + "kws" + ], + "start_line": 4971, + "end_line": 4983, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "array_set_string_function", + "long_name": "array_set_string_function( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 98, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 4990, + "end_line": 5006, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "array_set_ops_function", + "long_name": "array_set_ops_function( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 12, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 5012, + "end_line": 5029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "PyArray_Where", + "long_name": "PyArray_Where( PyObject * condition , PyObject * x , PyObject * y)", + "filename": "multiarraymodule.c", + "nloc": 31, + "complexity": 8, + "token_count": 231, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 5036, + "end_line": 5076, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "array_where", + "long_name": "array_where( PyObject * ignored , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 6, + "complexity": 2, + "token_count": 60, + "parameters": [ + "ignored", + "args" + ], + "start_line": 5084, + "end_line": 5092, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "array_lexsort", + "long_name": "array_lexsort( PyObject * ignored , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "ignored", + "args", + "kwds" + ], + "start_line": 5104, + "end_line": 5114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "array_register_dtype", + "long_name": "array_register_dtype( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "dummy", + "args" + ], + "start_line": 5123, + "end_line": 5134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "array_can_cast_safely", + "long_name": "array_can_cast_safely( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 22, + "complexity": 5, + "token_count": 128, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 5141, + "end_line": 5164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "new_buffer", + "long_name": "new_buffer( PyObject * dummy , PyObject * args)", + "filename": "multiarraymodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "dummy", + "args" + ], + "start_line": 5171, + "end_line": 5179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "buffer_buffer", + "long_name": "buffer_buffer( PyObject * dummy , PyObject * args , PyObject * kwds)", + "filename": "multiarraymodule.c", + "nloc": 16, + "complexity": 3, + "token_count": 120, + "parameters": [ + "dummy", + "args", + "kwds" + ], + "start_line": 5188, + "end_line": 5206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "setup_scalartypes", + "long_name": "setup_scalartypes( PyObject * dict)", + "filename": "multiarraymodule.c", + "nloc": 45, + "complexity": 10, + "token_count": 351, + "parameters": [ + "dict" + ], + "start_line": 5270, + "end_line": 5383, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 114, + "top_nesting_level": 0 + }, + { + "name": "set_flaginfo", + "long_name": "set_flaginfo( PyObject * d)", + "filename": "multiarraymodule.c", + "nloc": 21, + "complexity": 1, + "token_count": 152, + "parameters": [ + "d" + ], + "start_line": 5388, + "end_line": 5412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "initmultiarray", + "long_name": "initmultiarray()", + "filename": "multiarraymodule.c", + "nloc": 63, + "complexity": 15, + "token_count": 434, + "parameters": [], + "start_line": 5417, + "end_line": 5510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 94, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 4147, + "complexity": 908, + "token_count": 27101, + "diff_parsed": { + "added": [ + " Many objects can be used to represent a data-type which in NumPy is" + ], + "deleted": [ + " Many objects can be used to represent a data-type which in SciPy is" + ] + } + }, + { + "old_path": "numpy/doc/DISTUTILS.txt", + "new_path": "numpy/doc/DISTUTILS.txt", + "filename": "DISTUTILS.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -1,6 +1,6 @@\n .. -*- rest -*-\n \n-Scipy Distutils - Users Guide\n+SciPy Distutils - Users Guide\n =============================\n \n :Author: Pearu Peterson \n@@ -9,12 +9,12 @@ Scipy Distutils - Users Guide\n :Revision: $LastChangedRevision$\n :SVN source: $HeadURL$\n \n-Scipy structure\n+SciPy structure\n '''''''''''''''\n \n-Currently Scipy project consists of two packages:\n+Currently SciPy project consists of two packages:\n \n-- Scipy core --- it provides packages like:\n+- NumPy (previously called SciPy core) --- it provides packages like:\n \n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n@@ -23,22 +23,22 @@ Currently Scipy project consists of two packages:\n + numpy.testing - numpy-style tools for unit testing\n + etc\n \n-- Scipy --- a collection of Scientific tools for Python.\n+- SciPy --- a collection of scientific tools for Python.\n \n-The aim of this document is to describe how to add new tools to Scipy.\n+The aim of this document is to describe how to add new tools to SciPy.\n \n \n Requirements for SciPy packages\n '''''''''''''''''''''''''''''''\n \n-Scipy consists of Python packages, called Scipy packages, that are\n-available to Python users via ``numpy`` name space. Each Scipy package\n-may contain other Scipy packages. And so on. So, Scipy directory tree\n-is a tree of packages with arbitrary depth and width. Any Scipy\n-package may depend on Scipy core packages but the dependence on other\n-Scipy packages should be kept minimal or zero.\n+SciPy consists of Python packages, called SciPy packages, that are\n+available to Python users via ``scipy`` name space. Each SciPy package\n+may contain other SciPy packages. And so on. So, SciPy directory tree\n+is a tree of packages with arbitrary depth and width. Any SciPy\n+package may depend on NumPy packages but the dependence on other\n+SciPy packages should be kept minimal or zero.\n \n-A Scipy package contains in addition to its sources, the following\n+A SciPy package contains in addition to its sources, the following\n files and directories:\n \n ``setup.py`` --- building script\n@@ -51,7 +51,7 @@ Their contents will be described below.\n The ``setup.py`` file\n '''''''''''''''''''''\n \n-In order to add a Python package to Scipy, its building script (the\n+In order to add a Python package to SciPy, its building script (the\n ``setup.py`` file) must meet certain requirements. The minimal and the\n most important one is that it must define a function\n ``configuration(parent_package='',top_path=None)`` that returns a\n@@ -60,10 +60,10 @@ function. In order to simplify the construction of such an distionary,\n ``numpy.distutils.misc_util`` provides a class ``Configuration``, the\n usage of will be described below.\n \n-Scipy pure Python package example\n+SciPy pure Python package example\n ---------------------------------\n \n-Here follows a minimal example for a pure Python Scipy package\n+Here follows a minimal example for a pure Python SciPy package\n ``setup.py`` file that will be explained in detail below::\n \n #!/usr/bin/env python\n@@ -77,7 +77,7 @@ Here follows a minimal example for a pure Python Scipy package\n setup(**configuration(top_path='').todict())\n \n The first argument ``parent_package`` of the main configuration\n-function will contain a name of the parent Scipy package and the\n+function will contain a name of the parent SciPy package and the\n second argument ``top_path`` contains the name of the directory where\n the main ``setup.py`` script is located. Both arguments should be\n passed to the ``Configuration`` constructor after the name of the\n@@ -95,7 +95,7 @@ instance. Usually, these keywords are the same as the ones that\n ``headers``, ``scripts``, ``package_dir``, etc. However, the direct\n specification of these keywords is not recommended as the content of\n these keyword arguments will not be processed or checked for the\n-consistency of Scipy building system.\n+consistency of SciPy building system.\n \n Finally, ``Configuration`` has ``.todict()`` method that returns all\n the configuration data as a dictionary suitable for passing on to the\n@@ -127,14 +127,14 @@ in writing setup scripts:\n ``config.local_path``.\n \n + ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---\n- returns Scipy subpackage configuration. Subpackage is looked in the\n+ returns SciPy subpackage configuration. Subpackage is looked in the\n current directory under the name ``subpackage_name`` but the path\n can be specified also via optional ``subpackage_path`` argument.\n If ``subpackage_name`` is specified as ``None`` then the subpackage\n name will be taken the basename of ``subpackage_path``.\n \n + ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---\n- add Scipy subpackage configuration to the current one. The meaning\n+ add SciPy subpackage configuration to the current one. The meaning\n and usage of arguments is explained above, see\n ``config.get_subpackage()`` method.\n \n@@ -302,11 +302,11 @@ XXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,\n Useful functions in ``numpy.distutils.misc_util``\n -------------------------------------------------\n \n-+ ``get_numpy_include_dirs()`` --- return a list of Scipy base\n- include directories. Scipy base include directories contain\n++ ``get_numpy_include_dirs()`` --- return a list of NumPy base\n+ include directories. NumPy base include directories contain\n header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``\n- etc. For installed Scipy core the returned list has length 1\n- but when building Scipy core the list may contain more directories,\n+ etc. For installed NumPy the returned list has length 1\n+ but when building NumPy the list may contain more directories,\n for example, a path to ``config.h`` file that\n ``numpy/base/setup.py`` file generates and is used by ``numpy``\n header files.\n", + "added_lines": 24, + "deleted_lines": 24, + "source_code": ".. -*- rest -*-\n\nSciPy Distutils - Users Guide\n=============================\n\n:Author: Pearu Peterson \n:Discussions to: scipy-dev@scipy.org\n:Created: October 2005\n:Revision: $LastChangedRevision$\n:SVN source: $HeadURL$\n\nSciPy structure\n'''''''''''''''\n\nCurrently SciPy project consists of two packages:\n\n- NumPy (previously called SciPy core) --- it provides packages like:\n\n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n + numpy.weave - a tool to bind C++ codes to Python\n + numpy.base - future replacement of Numeric and numarray packages\n + numpy.testing - numpy-style tools for unit testing\n + etc\n\n- SciPy --- a collection of scientific tools for Python.\n\nThe aim of this document is to describe how to add new tools to SciPy.\n\n\nRequirements for SciPy packages\n'''''''''''''''''''''''''''''''\n\nSciPy consists of Python packages, called SciPy packages, that are\navailable to Python users via ``scipy`` name space. Each SciPy package\nmay contain other SciPy packages. And so on. So, SciPy directory tree\nis a tree of packages with arbitrary depth and width. Any SciPy\npackage may depend on NumPy packages but the dependence on other\nSciPy packages should be kept minimal or zero.\n\nA SciPy package contains in addition to its sources, the following\nfiles and directories:\n\n ``setup.py`` --- building script\n ``info.py`` --- contains documentation and import flags\n ``__init__.py`` --- package initializer\n ``tests/`` --- directory of unittests\n\nTheir contents will be described below.\n\nThe ``setup.py`` file\n'''''''''''''''''''''\n\nIn order to add a Python package to SciPy, its building script (the\n``setup.py`` file) must meet certain requirements. The minimal and the\nmost important one is that it must define a function\n``configuration(parent_package='',top_path=None)`` that returns a\ndictionary suitable for passing to ``numpy.distutils.core.setup(..)``\nfunction. In order to simplify the construction of such an distionary,\n``numpy.distutils.misc_util`` provides a class ``Configuration``, the\nusage of will be described below.\n\nSciPy pure Python package example\n---------------------------------\n\nHere follows a minimal example for a pure Python SciPy package\n``setup.py`` file that will be explained in detail below::\n\n #!/usr/bin/env python\n def configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('mypackage',parent_package,top_path)\n return config\n\n if __name__ == \"__main__\":\n from numpy.distutils.core import setup\n setup(**configuration(top_path='').todict())\n\nThe first argument ``parent_package`` of the main configuration\nfunction will contain a name of the parent SciPy package and the\nsecond argument ``top_path`` contains the name of the directory where\nthe main ``setup.py`` script is located. Both arguments should be\npassed to the ``Configuration`` constructor after the name of the\ncurrent package.\n\nThe ``Configuration`` constructor has also fourth optional argument,\n``package_path``, that can be used when package files are located in\nsome other location than the directory of the ``setup.py`` file. \n\nRemaining ``Configuration`` arguments are all keyword arguments that will\nbe used to initialize attributes of ``Configuration``\ninstance. Usually, these keywords are the same as the ones that\n``setup(..)`` function would expect, for example, ``packages``,\n``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``,\n``headers``, ``scripts``, ``package_dir``, etc. However, the direct\nspecification of these keywords is not recommended as the content of\nthese keyword arguments will not be processed or checked for the\nconsistency of SciPy building system.\n\nFinally, ``Configuration`` has ``.todict()`` method that returns all\nthe configuration data as a dictionary suitable for passing on to the\n``setup(..)`` function.\n\n``Configuration`` instance attributes\n-------------------------------------\n\nIn addition to attributes that can be specified via keyword arguments\nto ``Configuration`` constructor, ``Configuration`` instance (let us\ndenote as ``config``) has the following attributes that can be useful\nin writing setup scripts:\n\n+ ``config.name`` - full name of the current package. The names of parent\n packages can be extracted as ``config.name.split('.')``.\n\n+ ``config.local_path`` - path to the location of current ``setup.py`` file.\n\n+ ``config.top_path`` - path to the location of main ``setup.py`` file.\n\n``Configuration`` instance methods\n----------------------------------\n\n+ ``config.todict()`` --- returns configuration distionary suitable for\n passing to ``numpy.distutils.core.setup(..)`` function.\n\n+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of\n ``paths`` if necessary. Fixes ``paths`` item that is relative to\n ``config.local_path``.\n\n+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---\n returns SciPy subpackage configuration. Subpackage is looked in the\n current directory under the name ``subpackage_name`` but the path\n can be specified also via optional ``subpackage_path`` argument.\n If ``subpackage_name`` is specified as ``None`` then the subpackage\n name will be taken the basename of ``subpackage_path``.\n\n+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---\n add SciPy subpackage configuration to the current one. The meaning\n and usage of arguments is explained above, see\n ``config.get_subpackage()`` method.\n\n+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files``\n list. If ``files`` item is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data\n files. By default data files are copied under package installation\n directory. For example,\n\n ::\n\n config.add_data_files('foo.dat',\n ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']),\n 'bar/car.dat'.\n '/full/path/to/can.dat',\n )\n\n will install data files to the following locations::\n\n /\n foo.dat\n fun/\n gun.dat\n nun/\n pun.dat\n sun.dat\n bar/\n car.dat\n can.dat \n\n Path to data files can be a function taking no arguments and\n returning path(s) to data files -- this is a useful when data files\n are generated while building the package. (XXX: explain the step\n when this function are called exactly) \n\n+ ``config.add_data_dir(data_path)`` --- add directory ``data_path``\n recursively to ``data_files``. The whole directory tree starting at\n ``data_path`` will be copied under package installation directory.\n If ``data_path`` is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data directory.\n By default data directory are copied under package installation\n directory. For example,\n \n ::\n\n config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat\n config.add_data_dir(('sun','fun'))\n config.add_data_dir(('gun','/full/path/to/fun'))\n\n will install data files to the following locations \n\n /\n fun/\n foo.dat\n bar/\n car.dat\n sun/\n foo.dat\n bar/\n car.dat\n gun/\n foo.dat\n car.dat\n\n+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to\n ``include_dirs`` list. This list will be visible to all extension\n modules of the current package.\n\n+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers``\n list. By default, headers will be installed under \n ``/include/pythonX.X//``\n directory. If ``files`` item is a tuple then it's first argument\n specifies the installation suffix relative to\n ``/include/pythonX.X/`` path.\n\n+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts``\n list. Scripts will be installed under ``/bin/`` directory.\n\n+ ``config.add_extension(name,sources,*kw)`` --- create and add an\n ``Extension`` instance to ``ext_modules`` list. The first argument \n ``name`` defines the name of the extension module that will be\n installed under ``config.name`` package. The second argument is\n a list of sources. ``add_extension`` method takes also keyword\n arguments that are passed on to the ``Extension`` constructor.\n The list of allowed keywords is the following: ``include_dirs``,\n ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``,\n ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``,\n ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``,\n ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``.\n\n Note that ``config.paths`` method is applied to all lists that\n may contain paths. ``extra_info`` is a dictionary or a list\n of dictionaries that content will be appended to keyword arguments.\n The list ``depends`` contains paths to files or directories\n that the sources of the extension module depend on. If any path\n in the ``depends`` list is newer than the extension module, then\n the module will be rebuilt.\n\n The list of sources may contain functions ('source generators')\n with a pattern ``def (ext, build_dir): return\n ``. If ``funcname`` returns ``None``, no sources\n are generated. And if the ``Extension`` instance has no sources\n after processing all source generators, no extension module will\n be built. This is the recommended way to conditionally define\n extension modules. Source generator functions are called by the\n ``build_src`` command of ``numpy.distutils``.\n\n For example, here is a typical source generator function::\n\n def generate_source(ext,build_dir):\n import os\n from distutils.dep_util import newer\n target = os.path.join(build_dir,'somesource.c')\n if newer(target,__file__):\n # create target file\n return target\n\n The first argument contains the Extension instance that can be\n useful to access its attributes like ``depends``, ``sources``,\n etc. lists and modify them during the building process.\n The second argument gives a path to a build directory that must\n be used when creating files to a disk.\n\n+ ``config.add_library(name, sources, **build_info)`` --- add\n a library to ``libraries`` list. Allowed keywords arguments\n are ``depends``, ``macros``, ``include_dirs``,\n ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()``\n method for more information on arguments.\n\n+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is\n available (read: a simple Fortran 77 code compiled succesfully). \n\n+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is\n available (read: a simple Fortran 90 code compiled succesfully). \n\n+ ``config.get_version()`` --- return version string of the current package,\n ``None`` if version information could not be detected. This methods\n scans files ``__version__.py``, ``_version.py``,\n ``version.py``, ``__svn_version__.py`` for string variables\n ``version``, ``__version__``, ``_version``.\n\n+ ``config.make_svn_version_py()`` --- appends a data function to\n ``data_files`` list that will generate ``__svn_version__.py`` file\n to the current package directory. The file will be removed from\n the source directory when Python exits.\n\n+ ``config.get_build_temp_dir()`` --- return a path to a temporary\n directory. This is the place where one should build temporary\n files.\n\n+ ``config.get_distribution()`` --- return distutils ``Distribution``\n instance.\n\n+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config\n command instance.\n\nTemplate files\n--------------\n\nXXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,\n``.c.src``, etc. are pre-processed by the ``build_src`` command.\n\nUseful functions in ``numpy.distutils.misc_util``\n-------------------------------------------------\n\n+ ``get_numpy_include_dirs()`` --- return a list of NumPy base\n include directories. NumPy base include directories contain\n header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``\n etc. For installed NumPy the returned list has length 1\n but when building NumPy the list may contain more directories,\n for example, a path to ``config.h`` file that\n ``numpy/base/setup.py`` file generates and is used by ``numpy``\n header files.\n\n+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``.\n\n+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils``\n command instance.\n\n+ ``all_strings(lst)``\n\n+ ``has_f_sources(sources)``\n\n+ ``has_cxx_sources(sources)``\n\n+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources,\n f_sources, fmodule_sources``\n\n+ ``get_dependencies(sources)``\n\n+ ``is_local_src_dir(directory)``\n\n+ ``get_ext_source_files(ext)``\n\n+ ``get_script_files(scripts)``\n\n+ ``get_lib_source_files(lib)``\n\n+ ``get_data_files(data)``\n\n+ ``dot_join(*args)``\n\n+ ``get_frame(level=0)``\n\n+ ``cyg2win32(path)``\n\n+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``,\n ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)``\n\n+ ``get_path(mod_name,parent_path=None)``\n\n+ ``allpath(name)``\n\n+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``,\n ``f90_module_name_match``\n\n``numpy.distutils.system_info`` module\n--------------------------------------\n\n+ ``get_info(name,notfound_action=0)``\n+ ``combine_paths(*args,**kws)``\n+ ``show_all()``\n\n``numpy.distutils.cpuinfo`` module\n----------------------------------\n\n+ ``cpuinfo``\n\n``numpy.distutils.log`` module\n------------------------------\n\n+ ``set_verbosity(v)``\n\n\n``numpy.distutils.exec_command`` module\n---------------------------------------\n\n+ ``get_pythonexe()``\n+ ``splitcmdline(line)``\n+ ``find_executable(exe, path=None)``\n+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )``\n\nThe ``info.py`` file\n''''''''''''''''''''\n\nScipy package import hooks assume that each Scipy package contains\n``info.py`` file that contains overall documentation about the package\nand some variables defining the order of package imports, dependence\nrelations between packages, etc.\n\nThe following information will be looked in the ``info.py`` file:\n\n__doc__\n The documentation string of the package.\n\n__doc_title__\n The title of the package. If not defined then the first non-empty \n line of ``__doc__`` will be used.\n\n__all__\n List of symbols that package exports. Optional.\n\nglobal_symbols\n List of names that should be imported to numpy name space. To import\n all symbols to ``numpy`` namespace, define ``global_symbols=['*']``.\n\ndepends\n List of names that the package depends on. Prefix ``numpy.``\n will be automatically added to package names. For example,\n use ``testing`` to indicate dependence on ``numpy.testing``\n package. Default value is ``[]``.\n\npostpone_import\n Boolean variable indicating that importing the package should be\n postponed until the first attempt of its usage. Default value is ``False``.\n Depreciated.\n\nThe ``__init__.py`` file\n''''''''''''''''''''''''\n\nTo speed up the import time as well as to minimize memory usage, numpy\nuses ppimport hooks to transparently postpone importing large modules\nthat might not be used during the Scipy usage session. But in order to\nhave an access to the documentation of all Scipy packages, including \nof the postponed packages, the documentation string of a package (that would\nusually reside in ``__init__.py`` file) should be copied also\nto ``info.py`` file.\n\nSo, the header a typical ``__init__.py`` file is::\n\n #\n # Package ... - ...\n #\n\n from info import __doc__\n ...\n\n from numpy.testing import ScipyTest\n test = ScipyTest().test\n\nThe ``tests/`` directory\n''''''''''''''''''''''''\n\nIdeally, every Python code, extension module, or subpackage in Scipy\npackage directory should have the corresponding ``test_.py``\nfile in ``tests/`` directory. This file should define classes\nderived from ``ScipyTestCase`` (or from ``unittest.TestCase``) class\nand have names starting with ``test``. The methods of these classes\nwhich names start with ``bench``, ``check``, or ``test``, are passed\non to unittest machinery. In addition, the value of the first optional\nargument of these methods determine the level of the corresponding\ntest. Default level is 1.\n\nA minimal example of a ``test_yyy.py`` file that implements tests for\na Scipy package module ``numpy.xxx.yyy`` containing a function\n``zzz()``, is shown below::\n\n import sys\n from numpy.testing import *\n\n set_package_path()\n # import xxx symbols\n from xxx.yyy import zzz\n restore_path()\n\n #Optional:\n set_local_path()\n # import modules that are located in the same directory as this file.\n restore_path()\n\n class test_zzz(ScipyTestCase):\n def check_simple(self, level=1):\n assert zzz()=='Hello from zzz'\n #...\n\n if __name__ == \"__main__\":\n ScipyTest().run()\n\n``ScipyTestCase`` is derived from ``unittest.TestCase`` and it\nbasically only implements an additional method ``measure(self,\ncode_str, times=1)``.\n\n``numpy.testing`` module provides also the following convenience\nfunctions::\n\n assert_equal(actual,desired,err_msg='',verbose=1)\n assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)\n assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)\n assert_array_equal(x,y,err_msg='')\n assert_array_almost_equal(x,y,decimal=6,err_msg='')\n rand(*shape) # returns random array with a given shape\n\n``ScipyTest`` can be used for running ``tests/test_*.py`` scripts.\nFor instance, to run all test scripts of the module ``xxx``, execute\nin Python:\n\n >>> ScipyTest('xxx').test(level=1,verbosity=1)\n\nor equivalently,\n\n >>> import xxx\n >>> ScipyTest(xxx).test(level=1,verbosity=1)\n\nTo run only tests for ``xxx.yyy`` module, execute:\n\n >>> ScipyTest('xxx.yyy').test(level=1,verbosity=1)\n\nTo take the level and verbosity parameters for tests from\n``sys.argv``, use ``ScipyTest.run()`` method (this is supported only\nwhen ``optparse`` is installed).\n", + "source_code_before": ".. -*- rest -*-\n\nScipy Distutils - Users Guide\n=============================\n\n:Author: Pearu Peterson \n:Discussions to: scipy-dev@scipy.org\n:Created: October 2005\n:Revision: $LastChangedRevision$\n:SVN source: $HeadURL$\n\nScipy structure\n'''''''''''''''\n\nCurrently Scipy project consists of two packages:\n\n- Scipy core --- it provides packages like:\n\n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n + numpy.weave - a tool to bind C++ codes to Python\n + numpy.base - future replacement of Numeric and numarray packages\n + numpy.testing - numpy-style tools for unit testing\n + etc\n\n- Scipy --- a collection of Scientific tools for Python.\n\nThe aim of this document is to describe how to add new tools to Scipy.\n\n\nRequirements for SciPy packages\n'''''''''''''''''''''''''''''''\n\nScipy consists of Python packages, called Scipy packages, that are\navailable to Python users via ``numpy`` name space. Each Scipy package\nmay contain other Scipy packages. And so on. So, Scipy directory tree\nis a tree of packages with arbitrary depth and width. Any Scipy\npackage may depend on Scipy core packages but the dependence on other\nScipy packages should be kept minimal or zero.\n\nA Scipy package contains in addition to its sources, the following\nfiles and directories:\n\n ``setup.py`` --- building script\n ``info.py`` --- contains documentation and import flags\n ``__init__.py`` --- package initializer\n ``tests/`` --- directory of unittests\n\nTheir contents will be described below.\n\nThe ``setup.py`` file\n'''''''''''''''''''''\n\nIn order to add a Python package to Scipy, its building script (the\n``setup.py`` file) must meet certain requirements. The minimal and the\nmost important one is that it must define a function\n``configuration(parent_package='',top_path=None)`` that returns a\ndictionary suitable for passing to ``numpy.distutils.core.setup(..)``\nfunction. In order to simplify the construction of such an distionary,\n``numpy.distutils.misc_util`` provides a class ``Configuration``, the\nusage of will be described below.\n\nScipy pure Python package example\n---------------------------------\n\nHere follows a minimal example for a pure Python Scipy package\n``setup.py`` file that will be explained in detail below::\n\n #!/usr/bin/env python\n def configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('mypackage',parent_package,top_path)\n return config\n\n if __name__ == \"__main__\":\n from numpy.distutils.core import setup\n setup(**configuration(top_path='').todict())\n\nThe first argument ``parent_package`` of the main configuration\nfunction will contain a name of the parent Scipy package and the\nsecond argument ``top_path`` contains the name of the directory where\nthe main ``setup.py`` script is located. Both arguments should be\npassed to the ``Configuration`` constructor after the name of the\ncurrent package.\n\nThe ``Configuration`` constructor has also fourth optional argument,\n``package_path``, that can be used when package files are located in\nsome other location than the directory of the ``setup.py`` file. \n\nRemaining ``Configuration`` arguments are all keyword arguments that will\nbe used to initialize attributes of ``Configuration``\ninstance. Usually, these keywords are the same as the ones that\n``setup(..)`` function would expect, for example, ``packages``,\n``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``,\n``headers``, ``scripts``, ``package_dir``, etc. However, the direct\nspecification of these keywords is not recommended as the content of\nthese keyword arguments will not be processed or checked for the\nconsistency of Scipy building system.\n\nFinally, ``Configuration`` has ``.todict()`` method that returns all\nthe configuration data as a dictionary suitable for passing on to the\n``setup(..)`` function.\n\n``Configuration`` instance attributes\n-------------------------------------\n\nIn addition to attributes that can be specified via keyword arguments\nto ``Configuration`` constructor, ``Configuration`` instance (let us\ndenote as ``config``) has the following attributes that can be useful\nin writing setup scripts:\n\n+ ``config.name`` - full name of the current package. The names of parent\n packages can be extracted as ``config.name.split('.')``.\n\n+ ``config.local_path`` - path to the location of current ``setup.py`` file.\n\n+ ``config.top_path`` - path to the location of main ``setup.py`` file.\n\n``Configuration`` instance methods\n----------------------------------\n\n+ ``config.todict()`` --- returns configuration distionary suitable for\n passing to ``numpy.distutils.core.setup(..)`` function.\n\n+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of\n ``paths`` if necessary. Fixes ``paths`` item that is relative to\n ``config.local_path``.\n\n+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---\n returns Scipy subpackage configuration. Subpackage is looked in the\n current directory under the name ``subpackage_name`` but the path\n can be specified also via optional ``subpackage_path`` argument.\n If ``subpackage_name`` is specified as ``None`` then the subpackage\n name will be taken the basename of ``subpackage_path``.\n\n+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---\n add Scipy subpackage configuration to the current one. The meaning\n and usage of arguments is explained above, see\n ``config.get_subpackage()`` method.\n\n+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files``\n list. If ``files`` item is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data\n files. By default data files are copied under package installation\n directory. For example,\n\n ::\n\n config.add_data_files('foo.dat',\n ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']),\n 'bar/car.dat'.\n '/full/path/to/can.dat',\n )\n\n will install data files to the following locations::\n\n /\n foo.dat\n fun/\n gun.dat\n nun/\n pun.dat\n sun.dat\n bar/\n car.dat\n can.dat \n\n Path to data files can be a function taking no arguments and\n returning path(s) to data files -- this is a useful when data files\n are generated while building the package. (XXX: explain the step\n when this function are called exactly) \n\n+ ``config.add_data_dir(data_path)`` --- add directory ``data_path``\n recursively to ``data_files``. The whole directory tree starting at\n ``data_path`` will be copied under package installation directory.\n If ``data_path`` is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data directory.\n By default data directory are copied under package installation\n directory. For example,\n \n ::\n\n config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat\n config.add_data_dir(('sun','fun'))\n config.add_data_dir(('gun','/full/path/to/fun'))\n\n will install data files to the following locations \n\n /\n fun/\n foo.dat\n bar/\n car.dat\n sun/\n foo.dat\n bar/\n car.dat\n gun/\n foo.dat\n car.dat\n\n+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to\n ``include_dirs`` list. This list will be visible to all extension\n modules of the current package.\n\n+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers``\n list. By default, headers will be installed under \n ``/include/pythonX.X//``\n directory. If ``files`` item is a tuple then it's first argument\n specifies the installation suffix relative to\n ``/include/pythonX.X/`` path.\n\n+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts``\n list. Scripts will be installed under ``/bin/`` directory.\n\n+ ``config.add_extension(name,sources,*kw)`` --- create and add an\n ``Extension`` instance to ``ext_modules`` list. The first argument \n ``name`` defines the name of the extension module that will be\n installed under ``config.name`` package. The second argument is\n a list of sources. ``add_extension`` method takes also keyword\n arguments that are passed on to the ``Extension`` constructor.\n The list of allowed keywords is the following: ``include_dirs``,\n ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``,\n ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``,\n ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``,\n ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``.\n\n Note that ``config.paths`` method is applied to all lists that\n may contain paths. ``extra_info`` is a dictionary or a list\n of dictionaries that content will be appended to keyword arguments.\n The list ``depends`` contains paths to files or directories\n that the sources of the extension module depend on. If any path\n in the ``depends`` list is newer than the extension module, then\n the module will be rebuilt.\n\n The list of sources may contain functions ('source generators')\n with a pattern ``def (ext, build_dir): return\n ``. If ``funcname`` returns ``None``, no sources\n are generated. And if the ``Extension`` instance has no sources\n after processing all source generators, no extension module will\n be built. This is the recommended way to conditionally define\n extension modules. Source generator functions are called by the\n ``build_src`` command of ``numpy.distutils``.\n\n For example, here is a typical source generator function::\n\n def generate_source(ext,build_dir):\n import os\n from distutils.dep_util import newer\n target = os.path.join(build_dir,'somesource.c')\n if newer(target,__file__):\n # create target file\n return target\n\n The first argument contains the Extension instance that can be\n useful to access its attributes like ``depends``, ``sources``,\n etc. lists and modify them during the building process.\n The second argument gives a path to a build directory that must\n be used when creating files to a disk.\n\n+ ``config.add_library(name, sources, **build_info)`` --- add\n a library to ``libraries`` list. Allowed keywords arguments\n are ``depends``, ``macros``, ``include_dirs``,\n ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()``\n method for more information on arguments.\n\n+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is\n available (read: a simple Fortran 77 code compiled succesfully). \n\n+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is\n available (read: a simple Fortran 90 code compiled succesfully). \n\n+ ``config.get_version()`` --- return version string of the current package,\n ``None`` if version information could not be detected. This methods\n scans files ``__version__.py``, ``_version.py``,\n ``version.py``, ``__svn_version__.py`` for string variables\n ``version``, ``__version__``, ``_version``.\n\n+ ``config.make_svn_version_py()`` --- appends a data function to\n ``data_files`` list that will generate ``__svn_version__.py`` file\n to the current package directory. The file will be removed from\n the source directory when Python exits.\n\n+ ``config.get_build_temp_dir()`` --- return a path to a temporary\n directory. This is the place where one should build temporary\n files.\n\n+ ``config.get_distribution()`` --- return distutils ``Distribution``\n instance.\n\n+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config\n command instance.\n\nTemplate files\n--------------\n\nXXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,\n``.c.src``, etc. are pre-processed by the ``build_src`` command.\n\nUseful functions in ``numpy.distutils.misc_util``\n-------------------------------------------------\n\n+ ``get_numpy_include_dirs()`` --- return a list of Scipy base\n include directories. Scipy base include directories contain\n header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``\n etc. For installed Scipy core the returned list has length 1\n but when building Scipy core the list may contain more directories,\n for example, a path to ``config.h`` file that\n ``numpy/base/setup.py`` file generates and is used by ``numpy``\n header files.\n\n+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``.\n\n+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils``\n command instance.\n\n+ ``all_strings(lst)``\n\n+ ``has_f_sources(sources)``\n\n+ ``has_cxx_sources(sources)``\n\n+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources,\n f_sources, fmodule_sources``\n\n+ ``get_dependencies(sources)``\n\n+ ``is_local_src_dir(directory)``\n\n+ ``get_ext_source_files(ext)``\n\n+ ``get_script_files(scripts)``\n\n+ ``get_lib_source_files(lib)``\n\n+ ``get_data_files(data)``\n\n+ ``dot_join(*args)``\n\n+ ``get_frame(level=0)``\n\n+ ``cyg2win32(path)``\n\n+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``,\n ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)``\n\n+ ``get_path(mod_name,parent_path=None)``\n\n+ ``allpath(name)``\n\n+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``,\n ``f90_module_name_match``\n\n``numpy.distutils.system_info`` module\n--------------------------------------\n\n+ ``get_info(name,notfound_action=0)``\n+ ``combine_paths(*args,**kws)``\n+ ``show_all()``\n\n``numpy.distutils.cpuinfo`` module\n----------------------------------\n\n+ ``cpuinfo``\n\n``numpy.distutils.log`` module\n------------------------------\n\n+ ``set_verbosity(v)``\n\n\n``numpy.distutils.exec_command`` module\n---------------------------------------\n\n+ ``get_pythonexe()``\n+ ``splitcmdline(line)``\n+ ``find_executable(exe, path=None)``\n+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )``\n\nThe ``info.py`` file\n''''''''''''''''''''\n\nScipy package import hooks assume that each Scipy package contains\n``info.py`` file that contains overall documentation about the package\nand some variables defining the order of package imports, dependence\nrelations between packages, etc.\n\nThe following information will be looked in the ``info.py`` file:\n\n__doc__\n The documentation string of the package.\n\n__doc_title__\n The title of the package. If not defined then the first non-empty \n line of ``__doc__`` will be used.\n\n__all__\n List of symbols that package exports. Optional.\n\nglobal_symbols\n List of names that should be imported to numpy name space. To import\n all symbols to ``numpy`` namespace, define ``global_symbols=['*']``.\n\ndepends\n List of names that the package depends on. Prefix ``numpy.``\n will be automatically added to package names. For example,\n use ``testing`` to indicate dependence on ``numpy.testing``\n package. Default value is ``[]``.\n\npostpone_import\n Boolean variable indicating that importing the package should be\n postponed until the first attempt of its usage. Default value is ``False``.\n Depreciated.\n\nThe ``__init__.py`` file\n''''''''''''''''''''''''\n\nTo speed up the import time as well as to minimize memory usage, numpy\nuses ppimport hooks to transparently postpone importing large modules\nthat might not be used during the Scipy usage session. But in order to\nhave an access to the documentation of all Scipy packages, including \nof the postponed packages, the documentation string of a package (that would\nusually reside in ``__init__.py`` file) should be copied also\nto ``info.py`` file.\n\nSo, the header a typical ``__init__.py`` file is::\n\n #\n # Package ... - ...\n #\n\n from info import __doc__\n ...\n\n from numpy.testing import ScipyTest\n test = ScipyTest().test\n\nThe ``tests/`` directory\n''''''''''''''''''''''''\n\nIdeally, every Python code, extension module, or subpackage in Scipy\npackage directory should have the corresponding ``test_.py``\nfile in ``tests/`` directory. This file should define classes\nderived from ``ScipyTestCase`` (or from ``unittest.TestCase``) class\nand have names starting with ``test``. The methods of these classes\nwhich names start with ``bench``, ``check``, or ``test``, are passed\non to unittest machinery. In addition, the value of the first optional\nargument of these methods determine the level of the corresponding\ntest. Default level is 1.\n\nA minimal example of a ``test_yyy.py`` file that implements tests for\na Scipy package module ``numpy.xxx.yyy`` containing a function\n``zzz()``, is shown below::\n\n import sys\n from numpy.testing import *\n\n set_package_path()\n # import xxx symbols\n from xxx.yyy import zzz\n restore_path()\n\n #Optional:\n set_local_path()\n # import modules that are located in the same directory as this file.\n restore_path()\n\n class test_zzz(ScipyTestCase):\n def check_simple(self, level=1):\n assert zzz()=='Hello from zzz'\n #...\n\n if __name__ == \"__main__\":\n ScipyTest().run()\n\n``ScipyTestCase`` is derived from ``unittest.TestCase`` and it\nbasically only implements an additional method ``measure(self,\ncode_str, times=1)``.\n\n``numpy.testing`` module provides also the following convenience\nfunctions::\n\n assert_equal(actual,desired,err_msg='',verbose=1)\n assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)\n assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)\n assert_array_equal(x,y,err_msg='')\n assert_array_almost_equal(x,y,decimal=6,err_msg='')\n rand(*shape) # returns random array with a given shape\n\n``ScipyTest`` can be used for running ``tests/test_*.py`` scripts.\nFor instance, to run all test scripts of the module ``xxx``, execute\nin Python:\n\n >>> ScipyTest('xxx').test(level=1,verbosity=1)\n\nor equivalently,\n\n >>> import xxx\n >>> ScipyTest(xxx).test(level=1,verbosity=1)\n\nTo run only tests for ``xxx.yyy`` module, execute:\n\n >>> ScipyTest('xxx.yyy').test(level=1,verbosity=1)\n\nTo take the level and verbosity parameters for tests from\n``sys.argv``, use ``ScipyTest.run()`` method (this is supported only\nwhen ``optparse`` is installed).\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "SciPy Distutils - Users Guide", + "SciPy structure", + "Currently SciPy project consists of two packages:", + "- NumPy (previously called SciPy core) --- it provides packages like:", + "- SciPy --- a collection of scientific tools for Python.", + "The aim of this document is to describe how to add new tools to SciPy.", + "SciPy consists of Python packages, called SciPy packages, that are", + "available to Python users via ``scipy`` name space. Each SciPy package", + "may contain other SciPy packages. And so on. So, SciPy directory tree", + "is a tree of packages with arbitrary depth and width. Any SciPy", + "package may depend on NumPy packages but the dependence on other", + "SciPy packages should be kept minimal or zero.", + "A SciPy package contains in addition to its sources, the following", + "In order to add a Python package to SciPy, its building script (the", + "SciPy pure Python package example", + "Here follows a minimal example for a pure Python SciPy package", + "function will contain a name of the parent SciPy package and the", + "consistency of SciPy building system.", + " returns SciPy subpackage configuration. Subpackage is looked in the", + " add SciPy subpackage configuration to the current one. The meaning", + "+ ``get_numpy_include_dirs()`` --- return a list of NumPy base", + " include directories. NumPy base include directories contain", + " etc. For installed NumPy the returned list has length 1", + " but when building NumPy the list may contain more directories," + ], + "deleted": [ + "Scipy Distutils - Users Guide", + "Scipy structure", + "Currently Scipy project consists of two packages:", + "- Scipy core --- it provides packages like:", + "- Scipy --- a collection of Scientific tools for Python.", + "The aim of this document is to describe how to add new tools to Scipy.", + "Scipy consists of Python packages, called Scipy packages, that are", + "available to Python users via ``numpy`` name space. Each Scipy package", + "may contain other Scipy packages. And so on. So, Scipy directory tree", + "is a tree of packages with arbitrary depth and width. Any Scipy", + "package may depend on Scipy core packages but the dependence on other", + "Scipy packages should be kept minimal or zero.", + "A Scipy package contains in addition to its sources, the following", + "In order to add a Python package to Scipy, its building script (the", + "Scipy pure Python package example", + "Here follows a minimal example for a pure Python Scipy package", + "function will contain a name of the parent Scipy package and the", + "consistency of Scipy building system.", + " returns Scipy subpackage configuration. Subpackage is looked in the", + " add Scipy subpackage configuration to the current one. The meaning", + "+ ``get_numpy_include_dirs()`` --- return a list of Scipy base", + " include directories. Scipy base include directories contain", + " etc. For installed Scipy core the returned list has length 1", + " but when building Scipy core the list may contain more directories," + ] + } + }, + { + "old_path": "numpy/f2py/docs/README.txt", + "new_path": "numpy/f2py/docs/README.txt", + "filename": "README.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -20,6 +20,11 @@ __ FAQ.html\n \n .. topic:: NEWS!!!\n \n+ January 5, 2006\n+ \n+ WARNING -- these notes are out of date! The package structure for NumPy and\n+ SciPy has changed considerably. Much of this information is now incorrect.\n+ \n January 30, 2005\n \n Latest F2PY release (version 2.45.241_1926).\n", + "added_lines": 5, + "deleted_lines": 0, + "source_code": ".. -*- rest -*-\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n F2PY: Fortran to Python interface generator\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Author: Pearu Peterson \n:License: LGPL_.\n:Web-site: http://cens.ioc.ee/projects/f2py2e/\n:Discussions to: `f2py-users mailing list`_\n:Documentation: `User's Guide`__, FAQ__\n:Platforms: All\n:Date: $Date: 2005/01/30 18:54:53 $\n\n.. _f2py-users mailing list: http://cens.ioc.ee/mailman/listinfo/f2py-users/\n__ usersguide/index.html\n__ FAQ.html\n\n-------------------------------\n\n.. topic:: NEWS!!!\n\n January 5, 2006\n \n WARNING -- these notes are out of date! The package structure for NumPy and\n SciPy has changed considerably. Much of this information is now incorrect.\n \n January 30, 2005\n\n Latest F2PY release (version 2.45.241_1926).\n New features: wrapping unsigned integers, support for ``.pyf.src`` template files,\n callback arguments can now be CObjects, fortran objects, built-in functions.\n Introduced ``intent(aux)`` attribute. Wrapped objects have ``_cpointer``\n attribute holding C pointer to wrapped functions or variables.\n Many bug fixes and improvements, updated documentation.\n `Differences with the previous release (version 2.43.239_1831)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.163&r2=1.137&f=h\n\n October 4, 2004\n F2PY bug fix release (version 2.43.239_1831).\n Better support for 64-bit platforms.\n Introduced ``--help-link`` and ``--link-`` options.\n Bug fixes.\n `Differences with the previous release (version 2.43.239_1806)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.137&r2=1.131&f=h\n\n September 25, 2004\n Latest F2PY release (version 2.43.239_1806). \n Support for ``ENTRY`` statement. New attributes:\n ``intent(inplace)``, ``intent(callback)``. Supports Numarray 1.1.\n Introduced ``-*- fix -*-`` header content. Improved ``PARAMETER`` support.\n Documentation updates. `Differences with the previous release\n (version 2.39.235-1693)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.131&r2=1.98&f=h\n\n `History of NEWS`__\n\n __ OLDNEWS.html\n\n-------------------------------\n\n.. Contents::\n\n==============\n Introduction\n==============\n\nThe purpose of the F2PY --*Fortran to Python interface generator*--\nproject is to provide connection between Python_ and Fortran\nlanguages. F2PY is a Python extension tool for creating Python C/API\nmodules from (handwritten or F2PY generated) signature files (or\ndirectly from Fortran sources). The generated extension modules\nfacilitate:\n\n* Calling Fortran 77/90/95, Fortran 90/95 module, and C functions from\n Python.\n\n* Accessing Fortran 77 ``COMMON`` blocks and Fortran 90/95 module\n data (including allocatable arrays) from Python.\n\n* Calling Python functions from Fortran or C (call-backs).\n\n* Automatically handling the difference in the data storage order of\n multi-dimensional Fortran and Numerical Python (i.e. C) arrays.\n\nIn addition, F2PY can build the generated extension modules to shared\nlibraries with one command. F2PY uses the ``numpy_distutils`` module\nfrom SciPy_ that supports number of major Fortran compilers.\n\n..\n (see `COMPILERS.txt`_ for more information).\n\nF2PY generated extension modules depend on NumPy_ package that\nprovides fast multi-dimensional array language facility to Python.\n\n\n---------------\n Main features\n---------------\n\nHere follows a more detailed list of F2PY features:\n\n* F2PY scans real Fortran codes to produce the so-called signature\n files (.pyf files). The signature files contain all the information\n (function names, arguments and their types, etc.) that is needed to\n construct Python bindings to Fortran (or C) functions.\n\n The syntax of signature files is borrowed from the\n Fortran 90/95 language specification and has some F2PY specific\n extensions. The signature files can be modified to dictate how\n Fortran (or C) programs are called from Python:\n\n + F2PY solves dependencies between arguments (this is relevant for\n the order of initializing variables in extension modules).\n\n + Arguments can be specified to be optional or hidden that\n simplifies calling Fortran programs from Python considerably.\n\n + In principle, one can design any Python signature for a given\n Fortran function, e.g. change the order arguments, introduce\n auxiliary arguments, hide the arguments, process the arguments\n before passing to Fortran, return arguments as output of F2PY\n generated functions, etc.\n\n* F2PY automatically generates __doc__ strings (and optionally LaTeX\n documentation) for extension modules.\n\n* F2PY generated functions accept arbitrary (but sensible) Python\n objects as arguments. The F2PY interface automatically takes care of\n type-casting and handling of non-contiguous arrays.\n\n* The following Fortran constructs are recognized by F2PY:\n\n + All basic Fortran types::\n\n integer[ | *1 | *2 | *4 | *8 ], logical[ | *1 | *2 | *4 | *8 ]\n integer*([ -1 | -2 | -4 | -8 ])\n character[ | *(*) | *1 | *2 | *3 | ... ]\n real[ | *4 | *8 | *16 ], double precision\n complex[ | *8 | *16 | *32 ]\n\n Negative ``integer`` kinds are used to wrap unsigned integers.\n\n + Multi-dimensional arrays of all basic types with the following\n dimension specifications::\n\n | : | * | :\n\n + Attributes and statements::\n \n intent([ in | inout | out | hide | in,out | inout,out | c |\n copy | cache | callback | inplace | aux ])\n dimension()\n common, parameter\n allocatable\n optional, required, external\n depend([])\n check([])\n note()\n usercode, callstatement, callprotoargument, threadsafe, fortranname\n pymethoddef\n entry\n\n* Because there are only little (and easily handleable) differences\n between calling C and Fortran functions from F2PY generated\n extension modules, then F2PY is also well suited for wrapping C\n libraries to Python.\n\n* Practice has shown that F2PY generated interfaces (to C or Fortran\n functions) are less error prone and even more efficient than\n handwritten extension modules. The F2PY generated interfaces are\n easy to maintain and any future optimization of F2PY generated\n interfaces transparently apply to extension modules by just\n regenerating them with the latest version of F2PY.\n\n* `F2PY Users Guide and Reference Manual`_\n\n\n===============\n Prerequisites\n===============\n\nF2PY requires the following software installed:\n\n* Python_ (versions 1.5.2 or later; 2.1 and up are recommended).\n You must have python-dev package installed.\n* NumPy_ (versions 13 or later; 20.x, 21.x, 22.x, 23.x are recommended)\n* Numarray_ (version 0.9 and up), optional, partial support.\n* Scipy_distutils (version 0.2.2 and up are recommended) from SciPy_\n project. Get it from Scipy CVS or download it below.\n\nPython 1.x users also need distutils_.\n\nOf course, to build extension modules, you'll need also working C\nand/or Fortran compilers installed.\n\n==========\n Download\n==========\n\nYou can download the sources for the latest F2PY and numpy_distutils\nreleases as:\n\n* `2.x`__/`F2PY-2-latest.tar.gz`__\n* `2.x`__/`numpy_distutils-latest.tar.gz`__\n\nWindows users might be interested in Win32 installer for F2PY and\nScipy_distutils (these installers are built using Python 2.3):\n\n* `2.x`__/`F2PY-2-latest.win32.exe`__\n* `2.x`__/`numpy_distutils-latest.win32.exe`__\n\nOlder releases are also available in the directories\n`rel-0.x`__, `rel-1.x`__, `rel-2.x`__, `rel-3.x`__, `rel-4.x`__, `rel-5.x`__,\nif you need them.\n\n.. __: 2.x/\n.. __: 2.x/F2PY-2-latest.tar.gz\n.. __: 2.x/\n.. __: 2.x/numpy_distutils-latest.tar.gz\n.. __: 2.x/\n.. __: 2.x/F2PY-2-latest.win32.exe\n.. __: 2.x/\n.. __: 2.x/numpy_distutils-latest.win32.exe\n.. __: rel-0.x\n.. __: rel-1.x\n.. __: rel-2.x\n.. __: rel-3.x\n.. __: rel-4.x\n.. __: rel-5.x\n\nDevelopment version of F2PY from CVS is available as `f2py2e.tar.gz`__.\n\n__ http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/f2py2e/f2py2e.tar.gz?tarball=1\n\nDebian Sid users can simply install ``python-f2py`` package.\n\n==============\n Installation\n==============\n\nUnpack the source file, change to directrory ``F2PY-?-???/`` and run\n(you may need to become a root)::\n\n python setup.py install\n\nThe F2PY installation installs a Python package ``f2py2e`` to your\nPython ``site-packages`` directory and a script ``f2py`` to your\nPython executable path. \n\nSee also Installation__ section in `F2PY FAQ`_.\n\n.. __: FAQ.html#installation\n\nSimilarly, to install ``numpy_distutils``, unpack its tar-ball and run::\n\n python setup.py install\n\n=======\n Usage\n=======\n\nTo check if F2PY is installed correctly, run\n::\n\n f2py\n\nwithout any arguments. This should print out the usage information of\nthe ``f2py`` program.\n\nNext, try out the following three steps:\n\n1) Create a Fortran file `hello.f`__ that contains::\n\n C File hello.f\n subroutine foo (a)\n integer a\n print*, \"Hello from Fortran!\"\n print*, \"a=\",a\n end\n\n__ hello.f\n\n2) Run\n\n ::\n \n f2py -c -m hello hello.f\n\n This will build an extension module ``hello.so`` (or ``hello.sl``,\n or ``hello.pyd``, etc. depending on your platform) into the current\n directory.\n\n3) Now in Python try::\n\n >>> import hello\n >>> print hello.__doc__\n >>> print hello.foo.__doc__\n >>> hello.foo(4) \n Hello from Fortran!\n a= 4\n >>> \n\nIf the above works, then you can try out more thorough \n`F2PY unit tests`__ and read the `F2PY Users Guide and Reference Manual`_.\n\n__ FAQ.html#q-how-to-test-if-f2py-is-working-correctly\n\n===============\n Documentation\n===============\n\nThe documentation of the F2PY project is collected in ``f2py2e/docs/``\ndirectory. It contains the following documents:\n\n`README.txt`_ (in CVS__)\n The first thing to read about F2PY -- this document.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/README.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`usersguide/index.txt`_, `usersguide/f2py_usersguide.pdf`_\n F2PY Users Guide and Reference Manual. Contains lots of examples.\n\n`FAQ.txt`_ (in CVS__)\n F2PY Frequently Asked Questions.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/FAQ.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`TESTING.txt`_ (in CVS__)\n About F2PY testing site. What tests are available and how to run them.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/TESTING.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`HISTORY.txt`_ (in CVS__)\n A list of latest changes in F2PY. This is the most up-to-date\n document on F2PY.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`THANKS.txt`_\n Acknowledgments.\n\n..\n `COMPILERS.txt`_\n Compiler and platform specific notes.\n\n===============\n Mailing list\n===============\n\nA mailing list f2py-users@cens.ioc.ee is open for F2PY releated\ndiscussion/questions/etc.\n\n* `Subscribe..`__ \n* `Archives..`__\n\n__ http://cens.ioc.ee/mailman/listinfo/f2py-users\n__ http://cens.ioc.ee/pipermail/f2py-users\n\n\n=====\n CVS\n=====\n\nF2PY is being developed under CVS_. The CVS version of F2PY can be\nobtained as follows:\n\n1) First you need to login (the password is ``guest``)::\n\n cvs -d :pserver:anonymous@cens.ioc.ee:/home/cvs login\n\n2) and then do the checkout::\n\n cvs -z6 -d :pserver:anonymous@cens.ioc.ee:/home/cvs checkout f2py2e\n\n3) You can update your local F2PY tree ``f2py2e/`` by executing::\n\n cvs -z6 update -P -d\n\nYou can browse the `F2PY CVS`_ repository.\n\n===============\n Contributions\n===============\n\n* `A short introduction to F2PY`__ by Pierre Schnizer.\n\n* `F2PY notes`__ by Fernando Perez.\n\n* `Debian packages of F2PY`__ by Jos Fonseca. [OBSOLETE, Debian Sid\n ships python-f2py package]\n\n__ http://fubphpc.tu-graz.ac.at/~pierre/f2py_tutorial.tar.gz\n__ http://cens.ioc.ee/pipermail/f2py-users/2003-April/000472.html\n__ http://jrfonseca.dyndns.org/debian/\n\n\n===============\n Related sites\n===============\n\n* `Numerical Python`_ -- adds a fast array facility to the Python language.\n* Pyfort_ -- A Python-Fortran connection tool.\n* SciPy_ -- An open source library of scientific tools for Python.\n* `Scientific Python`_ -- A collection of Python modules that are\n useful for scientific computing.\n* `The Fortran Company`_ -- A place to find products, services, and general\n information related to the Fortran programming language.\n* `American National Standard Programming Language FORTRAN ANSI(R) X3.9-1978`__\n* `J3`_ -- The US Fortran standards committee.\n* SWIG_ -- A software development tool that connects programs written\n in C and C++ with a variety of high-level programming languages. \n* `Mathtools.net`_ -- A technical computing portal for all scientific\n and engineering needs. \n\n.. __: http://www.fortran.com/fortran/F77_std/rjcnf.html\n\n.. References\n ==========\n\n\n.. _F2PY Users Guide and Reference Manual: usersguide/index.html\n.. _usersguide/index.txt: usersguide/index.html\n.. _usersguide/f2py_usersguide.pdf: usersguide/f2py_usersguide.pdf\n.. _README.txt: README.html\n.. _COMPILERS.txt: COMPILERS.html\n.. _F2PY FAQ:\n.. _FAQ.txt: FAQ.html\n.. _HISTORY.txt: HISTORY.html\n.. _HISTORY.txt from CVS: http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n.. _THANKS.txt: THANKS.html\n.. _TESTING.txt: TESTING.html\n.. _F2PY CVS2: http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/\n.. _F2PY CVS: http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/f2py2e/\n\n.. _CVS: http://www.cvshome.org/\n.. _Python: http://www.python.org/\n.. _SciPy: http://www.numpy.org/\n.. _NumPy: http://www.numpy.org/\n.. _Numarray: http://www.stsci.edu/resources/software_hardware/numarray\n.. _docutils: http://docutils.sourceforge.net/\n.. _distutils: http://www.python.org/sigs/distutils-sig/\n.. _LGPL: http://www.fsf.org/copyleft/lesser.html\n.. _Numerical Python: http://www.numpy.org/\n.. _Pyfort: http://pyfortran.sourceforge.net/\n.. _Scientific Python: \n http://starship.python.net/crew/hinsen/scientific.html\n.. _The Fortran Company: http://www.fortran.com/fortran/\n.. _J3: http://www.j3-fortran.org/\n.. _Mathtools.net: http://www.mathtools.net/\n.. _SWIG: http://www.swig.org/\n\n..\n Local Variables:\n mode: indented-text\n indent-tabs-mode: nil\n sentence-end-double-space: t\n fill-column: 70\n End:\n", + "source_code_before": ".. -*- rest -*-\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n F2PY: Fortran to Python interface generator\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:Author: Pearu Peterson \n:License: LGPL_.\n:Web-site: http://cens.ioc.ee/projects/f2py2e/\n:Discussions to: `f2py-users mailing list`_\n:Documentation: `User's Guide`__, FAQ__\n:Platforms: All\n:Date: $Date: 2005/01/30 18:54:53 $\n\n.. _f2py-users mailing list: http://cens.ioc.ee/mailman/listinfo/f2py-users/\n__ usersguide/index.html\n__ FAQ.html\n\n-------------------------------\n\n.. topic:: NEWS!!!\n\n January 30, 2005\n\n Latest F2PY release (version 2.45.241_1926).\n New features: wrapping unsigned integers, support for ``.pyf.src`` template files,\n callback arguments can now be CObjects, fortran objects, built-in functions.\n Introduced ``intent(aux)`` attribute. Wrapped objects have ``_cpointer``\n attribute holding C pointer to wrapped functions or variables.\n Many bug fixes and improvements, updated documentation.\n `Differences with the previous release (version 2.43.239_1831)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.163&r2=1.137&f=h\n\n October 4, 2004\n F2PY bug fix release (version 2.43.239_1831).\n Better support for 64-bit platforms.\n Introduced ``--help-link`` and ``--link-`` options.\n Bug fixes.\n `Differences with the previous release (version 2.43.239_1806)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.137&r2=1.131&f=h\n\n September 25, 2004\n Latest F2PY release (version 2.43.239_1806). \n Support for ``ENTRY`` statement. New attributes:\n ``intent(inplace)``, ``intent(callback)``. Supports Numarray 1.1.\n Introduced ``-*- fix -*-`` header content. Improved ``PARAMETER`` support.\n Documentation updates. `Differences with the previous release\n (version 2.39.235-1693)`__.\n\n __ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.131&r2=1.98&f=h\n\n `History of NEWS`__\n\n __ OLDNEWS.html\n\n-------------------------------\n\n.. Contents::\n\n==============\n Introduction\n==============\n\nThe purpose of the F2PY --*Fortran to Python interface generator*--\nproject is to provide connection between Python_ and Fortran\nlanguages. F2PY is a Python extension tool for creating Python C/API\nmodules from (handwritten or F2PY generated) signature files (or\ndirectly from Fortran sources). The generated extension modules\nfacilitate:\n\n* Calling Fortran 77/90/95, Fortran 90/95 module, and C functions from\n Python.\n\n* Accessing Fortran 77 ``COMMON`` blocks and Fortran 90/95 module\n data (including allocatable arrays) from Python.\n\n* Calling Python functions from Fortran or C (call-backs).\n\n* Automatically handling the difference in the data storage order of\n multi-dimensional Fortran and Numerical Python (i.e. C) arrays.\n\nIn addition, F2PY can build the generated extension modules to shared\nlibraries with one command. F2PY uses the ``numpy_distutils`` module\nfrom SciPy_ that supports number of major Fortran compilers.\n\n..\n (see `COMPILERS.txt`_ for more information).\n\nF2PY generated extension modules depend on NumPy_ package that\nprovides fast multi-dimensional array language facility to Python.\n\n\n---------------\n Main features\n---------------\n\nHere follows a more detailed list of F2PY features:\n\n* F2PY scans real Fortran codes to produce the so-called signature\n files (.pyf files). The signature files contain all the information\n (function names, arguments and their types, etc.) that is needed to\n construct Python bindings to Fortran (or C) functions.\n\n The syntax of signature files is borrowed from the\n Fortran 90/95 language specification and has some F2PY specific\n extensions. The signature files can be modified to dictate how\n Fortran (or C) programs are called from Python:\n\n + F2PY solves dependencies between arguments (this is relevant for\n the order of initializing variables in extension modules).\n\n + Arguments can be specified to be optional or hidden that\n simplifies calling Fortran programs from Python considerably.\n\n + In principle, one can design any Python signature for a given\n Fortran function, e.g. change the order arguments, introduce\n auxiliary arguments, hide the arguments, process the arguments\n before passing to Fortran, return arguments as output of F2PY\n generated functions, etc.\n\n* F2PY automatically generates __doc__ strings (and optionally LaTeX\n documentation) for extension modules.\n\n* F2PY generated functions accept arbitrary (but sensible) Python\n objects as arguments. The F2PY interface automatically takes care of\n type-casting and handling of non-contiguous arrays.\n\n* The following Fortran constructs are recognized by F2PY:\n\n + All basic Fortran types::\n\n integer[ | *1 | *2 | *4 | *8 ], logical[ | *1 | *2 | *4 | *8 ]\n integer*([ -1 | -2 | -4 | -8 ])\n character[ | *(*) | *1 | *2 | *3 | ... ]\n real[ | *4 | *8 | *16 ], double precision\n complex[ | *8 | *16 | *32 ]\n\n Negative ``integer`` kinds are used to wrap unsigned integers.\n\n + Multi-dimensional arrays of all basic types with the following\n dimension specifications::\n\n | : | * | :\n\n + Attributes and statements::\n \n intent([ in | inout | out | hide | in,out | inout,out | c |\n copy | cache | callback | inplace | aux ])\n dimension()\n common, parameter\n allocatable\n optional, required, external\n depend([])\n check([])\n note()\n usercode, callstatement, callprotoargument, threadsafe, fortranname\n pymethoddef\n entry\n\n* Because there are only little (and easily handleable) differences\n between calling C and Fortran functions from F2PY generated\n extension modules, then F2PY is also well suited for wrapping C\n libraries to Python.\n\n* Practice has shown that F2PY generated interfaces (to C or Fortran\n functions) are less error prone and even more efficient than\n handwritten extension modules. The F2PY generated interfaces are\n easy to maintain and any future optimization of F2PY generated\n interfaces transparently apply to extension modules by just\n regenerating them with the latest version of F2PY.\n\n* `F2PY Users Guide and Reference Manual`_\n\n\n===============\n Prerequisites\n===============\n\nF2PY requires the following software installed:\n\n* Python_ (versions 1.5.2 or later; 2.1 and up are recommended).\n You must have python-dev package installed.\n* NumPy_ (versions 13 or later; 20.x, 21.x, 22.x, 23.x are recommended)\n* Numarray_ (version 0.9 and up), optional, partial support.\n* Scipy_distutils (version 0.2.2 and up are recommended) from SciPy_\n project. Get it from Scipy CVS or download it below.\n\nPython 1.x users also need distutils_.\n\nOf course, to build extension modules, you'll need also working C\nand/or Fortran compilers installed.\n\n==========\n Download\n==========\n\nYou can download the sources for the latest F2PY and numpy_distutils\nreleases as:\n\n* `2.x`__/`F2PY-2-latest.tar.gz`__\n* `2.x`__/`numpy_distutils-latest.tar.gz`__\n\nWindows users might be interested in Win32 installer for F2PY and\nScipy_distutils (these installers are built using Python 2.3):\n\n* `2.x`__/`F2PY-2-latest.win32.exe`__\n* `2.x`__/`numpy_distutils-latest.win32.exe`__\n\nOlder releases are also available in the directories\n`rel-0.x`__, `rel-1.x`__, `rel-2.x`__, `rel-3.x`__, `rel-4.x`__, `rel-5.x`__,\nif you need them.\n\n.. __: 2.x/\n.. __: 2.x/F2PY-2-latest.tar.gz\n.. __: 2.x/\n.. __: 2.x/numpy_distutils-latest.tar.gz\n.. __: 2.x/\n.. __: 2.x/F2PY-2-latest.win32.exe\n.. __: 2.x/\n.. __: 2.x/numpy_distutils-latest.win32.exe\n.. __: rel-0.x\n.. __: rel-1.x\n.. __: rel-2.x\n.. __: rel-3.x\n.. __: rel-4.x\n.. __: rel-5.x\n\nDevelopment version of F2PY from CVS is available as `f2py2e.tar.gz`__.\n\n__ http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/f2py2e/f2py2e.tar.gz?tarball=1\n\nDebian Sid users can simply install ``python-f2py`` package.\n\n==============\n Installation\n==============\n\nUnpack the source file, change to directrory ``F2PY-?-???/`` and run\n(you may need to become a root)::\n\n python setup.py install\n\nThe F2PY installation installs a Python package ``f2py2e`` to your\nPython ``site-packages`` directory and a script ``f2py`` to your\nPython executable path. \n\nSee also Installation__ section in `F2PY FAQ`_.\n\n.. __: FAQ.html#installation\n\nSimilarly, to install ``numpy_distutils``, unpack its tar-ball and run::\n\n python setup.py install\n\n=======\n Usage\n=======\n\nTo check if F2PY is installed correctly, run\n::\n\n f2py\n\nwithout any arguments. This should print out the usage information of\nthe ``f2py`` program.\n\nNext, try out the following three steps:\n\n1) Create a Fortran file `hello.f`__ that contains::\n\n C File hello.f\n subroutine foo (a)\n integer a\n print*, \"Hello from Fortran!\"\n print*, \"a=\",a\n end\n\n__ hello.f\n\n2) Run\n\n ::\n \n f2py -c -m hello hello.f\n\n This will build an extension module ``hello.so`` (or ``hello.sl``,\n or ``hello.pyd``, etc. depending on your platform) into the current\n directory.\n\n3) Now in Python try::\n\n >>> import hello\n >>> print hello.__doc__\n >>> print hello.foo.__doc__\n >>> hello.foo(4) \n Hello from Fortran!\n a= 4\n >>> \n\nIf the above works, then you can try out more thorough \n`F2PY unit tests`__ and read the `F2PY Users Guide and Reference Manual`_.\n\n__ FAQ.html#q-how-to-test-if-f2py-is-working-correctly\n\n===============\n Documentation\n===============\n\nThe documentation of the F2PY project is collected in ``f2py2e/docs/``\ndirectory. It contains the following documents:\n\n`README.txt`_ (in CVS__)\n The first thing to read about F2PY -- this document.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/README.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`usersguide/index.txt`_, `usersguide/f2py_usersguide.pdf`_\n F2PY Users Guide and Reference Manual. Contains lots of examples.\n\n`FAQ.txt`_ (in CVS__)\n F2PY Frequently Asked Questions.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/FAQ.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`TESTING.txt`_ (in CVS__)\n About F2PY testing site. What tests are available and how to run them.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/TESTING.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`HISTORY.txt`_ (in CVS__)\n A list of latest changes in F2PY. This is the most up-to-date\n document on F2PY.\n\n__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n\n`THANKS.txt`_\n Acknowledgments.\n\n..\n `COMPILERS.txt`_\n Compiler and platform specific notes.\n\n===============\n Mailing list\n===============\n\nA mailing list f2py-users@cens.ioc.ee is open for F2PY releated\ndiscussion/questions/etc.\n\n* `Subscribe..`__ \n* `Archives..`__\n\n__ http://cens.ioc.ee/mailman/listinfo/f2py-users\n__ http://cens.ioc.ee/pipermail/f2py-users\n\n\n=====\n CVS\n=====\n\nF2PY is being developed under CVS_. The CVS version of F2PY can be\nobtained as follows:\n\n1) First you need to login (the password is ``guest``)::\n\n cvs -d :pserver:anonymous@cens.ioc.ee:/home/cvs login\n\n2) and then do the checkout::\n\n cvs -z6 -d :pserver:anonymous@cens.ioc.ee:/home/cvs checkout f2py2e\n\n3) You can update your local F2PY tree ``f2py2e/`` by executing::\n\n cvs -z6 update -P -d\n\nYou can browse the `F2PY CVS`_ repository.\n\n===============\n Contributions\n===============\n\n* `A short introduction to F2PY`__ by Pierre Schnizer.\n\n* `F2PY notes`__ by Fernando Perez.\n\n* `Debian packages of F2PY`__ by Jos Fonseca. [OBSOLETE, Debian Sid\n ships python-f2py package]\n\n__ http://fubphpc.tu-graz.ac.at/~pierre/f2py_tutorial.tar.gz\n__ http://cens.ioc.ee/pipermail/f2py-users/2003-April/000472.html\n__ http://jrfonseca.dyndns.org/debian/\n\n\n===============\n Related sites\n===============\n\n* `Numerical Python`_ -- adds a fast array facility to the Python language.\n* Pyfort_ -- A Python-Fortran connection tool.\n* SciPy_ -- An open source library of scientific tools for Python.\n* `Scientific Python`_ -- A collection of Python modules that are\n useful for scientific computing.\n* `The Fortran Company`_ -- A place to find products, services, and general\n information related to the Fortran programming language.\n* `American National Standard Programming Language FORTRAN ANSI(R) X3.9-1978`__\n* `J3`_ -- The US Fortran standards committee.\n* SWIG_ -- A software development tool that connects programs written\n in C and C++ with a variety of high-level programming languages. \n* `Mathtools.net`_ -- A technical computing portal for all scientific\n and engineering needs. \n\n.. __: http://www.fortran.com/fortran/F77_std/rjcnf.html\n\n.. References\n ==========\n\n\n.. _F2PY Users Guide and Reference Manual: usersguide/index.html\n.. _usersguide/index.txt: usersguide/index.html\n.. _usersguide/f2py_usersguide.pdf: usersguide/f2py_usersguide.pdf\n.. _README.txt: README.html\n.. _COMPILERS.txt: COMPILERS.html\n.. _F2PY FAQ:\n.. _FAQ.txt: FAQ.html\n.. _HISTORY.txt: HISTORY.html\n.. _HISTORY.txt from CVS: http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt?rev=HEAD&content-type=text/x-cvsweb-markup\n.. _THANKS.txt: THANKS.html\n.. _TESTING.txt: TESTING.html\n.. _F2PY CVS2: http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/\n.. _F2PY CVS: http://cens.ioc.ee/cgi-bin/viewcvs.cgi/python/f2py2e/\n\n.. _CVS: http://www.cvshome.org/\n.. _Python: http://www.python.org/\n.. _SciPy: http://www.numpy.org/\n.. _NumPy: http://www.numpy.org/\n.. _Numarray: http://www.stsci.edu/resources/software_hardware/numarray\n.. _docutils: http://docutils.sourceforge.net/\n.. _distutils: http://www.python.org/sigs/distutils-sig/\n.. _LGPL: http://www.fsf.org/copyleft/lesser.html\n.. _Numerical Python: http://www.numpy.org/\n.. _Pyfort: http://pyfortran.sourceforge.net/\n.. _Scientific Python: \n http://starship.python.net/crew/hinsen/scientific.html\n.. _The Fortran Company: http://www.fortran.com/fortran/\n.. _J3: http://www.j3-fortran.org/\n.. _Mathtools.net: http://www.mathtools.net/\n.. _SWIG: http://www.swig.org/\n\n..\n Local Variables:\n mode: indented-text\n indent-tabs-mode: nil\n sentence-end-double-space: t\n fill-column: 70\n End:\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + " January 5, 2006", + "", + " WARNING -- these notes are out of date! The package structure for NumPy and", + " SciPy has changed considerably. Much of this information is now incorrect.", + "" + ], + "deleted": [] + } + }, + { + "old_path": "numpy/lib/shape_base.py", + "new_path": "numpy/lib/shape_base.py", + "filename": "shape_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -336,7 +336,7 @@ def array_split(ary,indices_or_sections,axis = 0):\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n- However, we could also make the argument that SciPy\n+ However, we could also make the argument that NumPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n@@ -401,7 +401,7 @@ def split(ary,indices_or_sections,axis=0):\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n- However, we could also make the argument that SciPy\n+ However, we could also make the argument that NumPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack',\n 'column_stack','dstack','array_split','split','hsplit',\n 'vsplit','dsplit','apply_over_axes','expand_dims',\n 'apply_along_axis']\n\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import *\nfrom numpy.core.oldnumeric import product\n\ndef apply_along_axis(func1d,axis,arr,*args):\n \"\"\" Execute func1d(arr[i],*args) where func1d takes 1-D arrays\n and arr is an N-d array. i varies so as to apply the function\n along the given axis for each 1-d subarray in arr.\n \"\"\"\n arr = asarray(arr)\n nd = arr.ndim\n if axis < 0:\n axis += nd\n if (axis >= nd):\n raise ValueError(\"axis must be less than arr.ndim; axis=%d, rank=%d.\" \n % (axis,nd))\n ind = [0]*(nd-1)\n i = zeros(nd,'O')\n indlist = range(nd)\n indlist.remove(axis)\n i[axis] = slice(None,None)\n outshape = asarray(arr.shape).take(indlist)\n i.put(ind, indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n # if res is a number, then we have a smaller output array\n if isscalar(res):\n outarr = zeros(outshape,asarray(res).dtypechar)\n outarr[ind] = res\n Ntot = product(outshape)\n k = 1\n while k < Ntot:\n # increment the index\n ind[-1] += 1\n n = -1\n while (ind[n] >= outshape[n]) and (n > (1-nd)):\n ind[n-1] += 1\n ind[n] = 0\n n -= 1\n i.put(ind,indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n outarr[ind] = res\n k += 1\n return outarr\n else:\n Ntot = product(outshape)\n holdshape = outshape\n outshape = list(arr.shape)\n outshape[axis] = len(res)\n outarr = zeros(outshape,asarray(res).dtypechar)\n outarr[tuple(i.tolist())] = res\n k = 1\n while k < Ntot:\n # increment the index\n ind[-1] += 1\n n = -1\n while (ind[n] >= holdshape[n]) and (n > (1-nd)):\n ind[n-1] += 1\n ind[n] = 0\n n -= 1\n i.put(ind, indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n outarr[tuple(i.tolist())] = res\n k += 1\n return outarr\n\n\ndef apply_over_axes(func, a, axes):\n \"\"\"Apply a function repeatedly over multiple axes, keeping the same shape\n for the resulting array.\n\n func is called as res = func(a, axis). The result is assumed\n to be either the same shape as a or have one less dimension.\n This call is repeated for each axis in the axes sequence.\n \"\"\"\n val = asarray(a)\n N = a.ndim\n if array(axes).ndim == 0:\n axes = (axes,)\n for axis in axes:\n if axis < 0: axis = N + axis\n args = (val, axis)\n res = func(*args)\n if res.ndim == val.ndim:\n val = res\n else:\n res = expand_dims(res,axis)\n if res.ndim == val.ndim:\n val = res\n else:\n raise ValueError, \"function is not returning\"\\\n \" an array of correct shape\"\n return val\n\ndef expand_dims(a, axis):\n \"\"\"Expand the shape of a by including newaxis before given axis.\n \"\"\"\n a = asarray(a)\n shape = a.shape\n if axis < 0:\n axis = axis + len(shape) + 1\n return a.reshape(shape[:axis] + (1,) + shape[axis:])\n\n\ndef atleast_1d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 1D.\n\n Description:\n Force an array to be at least 1D. If an array is 0D, the\n array is converted to a single row of values. Otherwise,\n the array is unaltered.\n Arguments:\n *arys -- arrays to be converted to 1 or more dimensional array.\n Returns:\n input array converted to at least 1D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n ary = ary.reshape(1)\n res.append(ary)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\ndef atleast_2d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 2D.\n\n Description:\n Force an array to each be at least 2D. If the array\n is 0D or 1D, the array is converted to a single\n row of values. Otherwise, the array is unaltered.\n Arguments:\n arys -- arrays to be converted to 2 or more dimensional array.\n Returns:\n input array converted to at least 2D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n result = ary.reshape(1,1)\n elif len(ary.shape) == 1: \n result = ary[newaxis,:]\n else: \n result = ary\n res.append(result)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\ndef atleast_3d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 3D.\n\n Description:\n Force an array each be at least 3D. If the array is 0D or 1D, \n the array is converted to a single 1xNx1 array of values where \n N is the orginal length of the array. If the array is 2D, the \n array is converted to a single MxNx1 array of values where MxN\n is the orginal shape of the array. Otherwise, the array is \n unaltered.\n Arguments:\n arys -- arrays to be converted to 3 or more dimensional array.\n Returns:\n input array converted to at least 3D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n result = ary.reshape(1,1,1)\n elif len(ary.shape) == 1:\n result = ary[newaxis,:,newaxis]\n elif len(ary.shape) == 2:\n result = ary[:,:,newaxis]\n else: \n result = ary\n res.append(result)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\n\ndef vstack(tup):\n \"\"\" Stack arrays in sequence vertically (row wise)\n\n Description:\n Take a sequence of arrays and stack them veritcally\n to make a single array. All arrays in the sequence\n must have the same shape along all but the first axis. \n vstack will rebuild arrays divided by vsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.vstack((a,b))\n array([[1, 2, 3],\n [2, 3, 4]])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.vstack((a,b))\n array([[1],\n [2],\n [3],\n [2],\n [3],\n [4]])\n\n \"\"\"\n return _nx.concatenate(map(atleast_2d,tup),0)\n\ndef hstack(tup):\n \"\"\" Stack arrays in sequence horizontally (column wise)\n\n Description:\n Take a sequence of arrays and stack them horizontally\n to make a single array. All arrays in the sequence\n must have the same shape along all but the second axis.\n hstack will rebuild arrays divided by hsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.hstack((a,b))\n array([1, 2, 3, 2, 3, 4])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.hstack((a,b))\n array([[1, 2],\n [2, 3],\n [3, 4]])\n\n \"\"\"\n return _nx.concatenate(map(atleast_1d,tup),1)\n\ndef column_stack(tup):\n \"\"\" Stack 1D arrays as columns into a 2D array\n\n Description:\n Take a sequence of 1D arrays and stack them as columns\n to make a single 2D array. All arrays in the sequence\n must have the same length.\n Arguments:\n tup -- sequence of 1D arrays. All arrays must have the same \n length.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.column_stack((a,b))\n array([[1, 2],\n [2, 3],\n [3, 4]])\n\n \"\"\"\n arrays = map(_nx.transpose,map(atleast_2d,tup))\n return _nx.concatenate(arrays,1)\n\ndef dstack(tup):\n \"\"\" Stack arrays in sequence depth wise (along third dimension)\n\n Description:\n Take a sequence of arrays and stack them along the third axis.\n All arrays in the sequence must have the same shape along all \n but the third axis. This is a simple way to stack 2D arrays \n (images) into a single 3D array for processing.\n dstack will rebuild arrays divided by dsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.dstack((a,b))\n array([ [[1, 2],\n [2, 3],\n [3, 4]]])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.dstack((a,b))\n array([[ [1, 2]],\n [ [2, 3]],\n [ [3, 4]]])\n \"\"\"\n return _nx.concatenate(map(atleast_3d,tup),2)\n\ndef _replace_zero_by_x_arrays(sub_arys):\n for i in range(len(sub_arys)):\n if len(_nx.shape(sub_arys[i])) == 0:\n sub_arys[i] = _nx.array([])\n elif _nx.sometrue(_nx.equal(_nx.shape(sub_arys[i]),0)):\n sub_arys[i] = _nx.array([]) \n return sub_arys\n\ndef array_split(ary,indices_or_sections,axis = 0):\n \"\"\" Divide an array into a list of sub-arrays.\n\n Description:\n Divide ary into a list of sub-arrays along the\n specified axis. If indices_or_sections is an integer,\n ary is divided into that many equally sized arrays.\n If it is impossible to make an equal split, each of the\n leading arrays in the list have one additional member. If\n indices_or_sections is a list of sorted integers, its\n entries define the indexes where ary is split.\n\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n axis -- integer. default=0.\n Specifies the axis along which to split ary.\n Caveats:\n Currently, the default for axis is 0. This\n means a 2D array is divided into multiple groups\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n However, we could also make the argument that NumPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n try:\n Ntotal = ary.shape[axis]\n except AttributeError:\n Ntotal = len(ary)\n try: # handle scalar case.\n Nsections = len(indices_or_sections) + 1\n div_points = [0] + list(indices_or_sections) + [Ntotal]\n except TypeError: #indices_or_sections is a scalar, not an array.\n Nsections = int(indices_or_sections)\n if Nsections <= 0:\n raise ValueError, 'number sections must be larger than 0.'\n Neach_section,extras = divmod(Ntotal,Nsections)\n section_sizes = [0] + \\\n extras * [Neach_section+1] + \\\n (Nsections-extras) * [Neach_section]\n div_points = _nx.array(section_sizes).cumsum()\n\n sub_arys = []\n sary = _nx.swapaxes(ary,axis,0)\n for i in range(Nsections):\n st = div_points[i]; end = div_points[i+1]\n sub_arys.append(_nx.swapaxes(sary[st:end],axis,0))\n\n # there is a wierd issue with array slicing that allows\n # 0x10 arrays and other such things. The following cluge is needed\n # to get around this issue.\n sub_arys = _replace_zero_by_x_arrays(sub_arys)\n # end cluge.\n\n return sub_arys\n\ndef split(ary,indices_or_sections,axis=0):\n \"\"\" Divide an array into a list of sub-arrays.\n\n Description:\n Divide ary into a list of sub-arrays along the\n specified axis. If indices_or_sections is an integer,\n ary is divided into that many equally sized arrays.\n If it is impossible to make an equal split, an error is \n raised. This is the only way this function differs from\n the array_split() function. If indices_or_sections is a \n list of sorted integers, its entries define the indexes\n where ary is split.\n\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n axis -- integer. default=0.\n Specifies the axis along which to split ary.\n Caveats:\n Currently, the default for axis is 0. This\n means a 2D array is divided into multiple groups\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n However, we could also make the argument that NumPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n try: len(indices_or_sections)\n except TypeError:\n sections = indices_or_sections\n N = ary.shape[axis]\n if N % sections:\n raise ValueError, 'array split does not result in an equal division'\n res = array_split(ary,indices_or_sections,axis)\n return res\n\ndef hsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple columns of sub-arrays\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups of columns. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Related:\n hstack, split, array_split, vsplit, dsplit.\n Examples:\n >>> import numpy\n >>> a= array((1,2,3,4))\n >>> numpy.hsplit(a,2)\n [array([1, 2]), array([3, 4])]\n >>> a = array([[1,2,3,4],[1,2,3,4]])\n [array([[1, 2],\n [1, 2]]), array([[3, 4],\n [3, 4]])]\n\n \"\"\"\n if len(_nx.shape(ary)) == 0:\n raise ValueError, 'hsplit only works on arrays of 1 or more dimensions'\n if len(ary.shape) > 1:\n return split(ary,indices_or_sections,1)\n else:\n return split(ary,indices_or_sections,0)\n\ndef vsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple rows of sub-arrays\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups of rows. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Caveats:\n How should we handle 1D arrays here? I am currently raising\n an error when I encounter them. Any better approach?\n\n Should we reduce the returned array to their minium dimensions\n by getting rid of any dimensions that are 1?\n Related:\n vstack, split, array_split, hsplit, dsplit.\n Examples:\n import numpy\n >>> a = array([[1,2,3,4],\n ... [1,2,3,4]])\n >>> numpy.vsplit(a)\n [array([ [1, 2, 3, 4]]), array([ [1, 2, 3, 4]])]\n\n \"\"\"\n if len(_nx.shape(ary)) < 2:\n raise ValueError, 'vsplit only works on arrays of 2 or more dimensions'\n return split(ary,indices_or_sections,0)\n\ndef dsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple sub-arrays along the 3rd axis (depth)\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups along the 3rd axis. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Caveats:\n See vsplit caveats.\n Related:\n dstack, split, array_split, hsplit, vsplit.\n Examples:\n >>> a = array([[[1,2,3,4],[1,2,3,4]]])\n [array([ [[1, 2],\n [1, 2]]]), array([ [[3, 4],\n [3, 4]]])]\n\n \"\"\"\n if len(_nx.shape(ary)) < 3:\n raise ValueError, 'vsplit only works on arrays of 3 or more dimensions'\n return split(ary,indices_or_sections,2)\n\n", + "source_code_before": "__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack',\n 'column_stack','dstack','array_split','split','hsplit',\n 'vsplit','dsplit','apply_over_axes','expand_dims',\n 'apply_along_axis']\n\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import *\nfrom numpy.core.oldnumeric import product\n\ndef apply_along_axis(func1d,axis,arr,*args):\n \"\"\" Execute func1d(arr[i],*args) where func1d takes 1-D arrays\n and arr is an N-d array. i varies so as to apply the function\n along the given axis for each 1-d subarray in arr.\n \"\"\"\n arr = asarray(arr)\n nd = arr.ndim\n if axis < 0:\n axis += nd\n if (axis >= nd):\n raise ValueError(\"axis must be less than arr.ndim; axis=%d, rank=%d.\" \n % (axis,nd))\n ind = [0]*(nd-1)\n i = zeros(nd,'O')\n indlist = range(nd)\n indlist.remove(axis)\n i[axis] = slice(None,None)\n outshape = asarray(arr.shape).take(indlist)\n i.put(ind, indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n # if res is a number, then we have a smaller output array\n if isscalar(res):\n outarr = zeros(outshape,asarray(res).dtypechar)\n outarr[ind] = res\n Ntot = product(outshape)\n k = 1\n while k < Ntot:\n # increment the index\n ind[-1] += 1\n n = -1\n while (ind[n] >= outshape[n]) and (n > (1-nd)):\n ind[n-1] += 1\n ind[n] = 0\n n -= 1\n i.put(ind,indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n outarr[ind] = res\n k += 1\n return outarr\n else:\n Ntot = product(outshape)\n holdshape = outshape\n outshape = list(arr.shape)\n outshape[axis] = len(res)\n outarr = zeros(outshape,asarray(res).dtypechar)\n outarr[tuple(i.tolist())] = res\n k = 1\n while k < Ntot:\n # increment the index\n ind[-1] += 1\n n = -1\n while (ind[n] >= holdshape[n]) and (n > (1-nd)):\n ind[n-1] += 1\n ind[n] = 0\n n -= 1\n i.put(ind, indlist)\n res = func1d(arr[tuple(i.tolist())],*args)\n outarr[tuple(i.tolist())] = res\n k += 1\n return outarr\n\n\ndef apply_over_axes(func, a, axes):\n \"\"\"Apply a function repeatedly over multiple axes, keeping the same shape\n for the resulting array.\n\n func is called as res = func(a, axis). The result is assumed\n to be either the same shape as a or have one less dimension.\n This call is repeated for each axis in the axes sequence.\n \"\"\"\n val = asarray(a)\n N = a.ndim\n if array(axes).ndim == 0:\n axes = (axes,)\n for axis in axes:\n if axis < 0: axis = N + axis\n args = (val, axis)\n res = func(*args)\n if res.ndim == val.ndim:\n val = res\n else:\n res = expand_dims(res,axis)\n if res.ndim == val.ndim:\n val = res\n else:\n raise ValueError, \"function is not returning\"\\\n \" an array of correct shape\"\n return val\n\ndef expand_dims(a, axis):\n \"\"\"Expand the shape of a by including newaxis before given axis.\n \"\"\"\n a = asarray(a)\n shape = a.shape\n if axis < 0:\n axis = axis + len(shape) + 1\n return a.reshape(shape[:axis] + (1,) + shape[axis:])\n\n\ndef atleast_1d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 1D.\n\n Description:\n Force an array to be at least 1D. If an array is 0D, the\n array is converted to a single row of values. Otherwise,\n the array is unaltered.\n Arguments:\n *arys -- arrays to be converted to 1 or more dimensional array.\n Returns:\n input array converted to at least 1D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n ary = ary.reshape(1)\n res.append(ary)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\ndef atleast_2d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 2D.\n\n Description:\n Force an array to each be at least 2D. If the array\n is 0D or 1D, the array is converted to a single\n row of values. Otherwise, the array is unaltered.\n Arguments:\n arys -- arrays to be converted to 2 or more dimensional array.\n Returns:\n input array converted to at least 2D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n result = ary.reshape(1,1)\n elif len(ary.shape) == 1: \n result = ary[newaxis,:]\n else: \n result = ary\n res.append(result)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\ndef atleast_3d(*arys):\n \"\"\" Force a sequence of arrays to each be at least 3D.\n\n Description:\n Force an array each be at least 3D. If the array is 0D or 1D, \n the array is converted to a single 1xNx1 array of values where \n N is the orginal length of the array. If the array is 2D, the \n array is converted to a single MxNx1 array of values where MxN\n is the orginal shape of the array. Otherwise, the array is \n unaltered.\n Arguments:\n arys -- arrays to be converted to 3 or more dimensional array.\n Returns:\n input array converted to at least 3D array.\n \"\"\"\n res = []\n for ary in arys:\n ary = asarray(ary)\n if len(ary.shape) == 0:\n result = ary.reshape(1,1,1)\n elif len(ary.shape) == 1:\n result = ary[newaxis,:,newaxis]\n elif len(ary.shape) == 2:\n result = ary[:,:,newaxis]\n else: \n result = ary\n res.append(result)\n if len(res) == 1:\n return res[0]\n else:\n return res\n\n\ndef vstack(tup):\n \"\"\" Stack arrays in sequence vertically (row wise)\n\n Description:\n Take a sequence of arrays and stack them veritcally\n to make a single array. All arrays in the sequence\n must have the same shape along all but the first axis. \n vstack will rebuild arrays divided by vsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.vstack((a,b))\n array([[1, 2, 3],\n [2, 3, 4]])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.vstack((a,b))\n array([[1],\n [2],\n [3],\n [2],\n [3],\n [4]])\n\n \"\"\"\n return _nx.concatenate(map(atleast_2d,tup),0)\n\ndef hstack(tup):\n \"\"\" Stack arrays in sequence horizontally (column wise)\n\n Description:\n Take a sequence of arrays and stack them horizontally\n to make a single array. All arrays in the sequence\n must have the same shape along all but the second axis.\n hstack will rebuild arrays divided by hsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.hstack((a,b))\n array([1, 2, 3, 2, 3, 4])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.hstack((a,b))\n array([[1, 2],\n [2, 3],\n [3, 4]])\n\n \"\"\"\n return _nx.concatenate(map(atleast_1d,tup),1)\n\ndef column_stack(tup):\n \"\"\" Stack 1D arrays as columns into a 2D array\n\n Description:\n Take a sequence of 1D arrays and stack them as columns\n to make a single 2D array. All arrays in the sequence\n must have the same length.\n Arguments:\n tup -- sequence of 1D arrays. All arrays must have the same \n length.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.column_stack((a,b))\n array([[1, 2],\n [2, 3],\n [3, 4]])\n\n \"\"\"\n arrays = map(_nx.transpose,map(atleast_2d,tup))\n return _nx.concatenate(arrays,1)\n\ndef dstack(tup):\n \"\"\" Stack arrays in sequence depth wise (along third dimension)\n\n Description:\n Take a sequence of arrays and stack them along the third axis.\n All arrays in the sequence must have the same shape along all \n but the third axis. This is a simple way to stack 2D arrays \n (images) into a single 3D array for processing.\n dstack will rebuild arrays divided by dsplit.\n Arguments:\n tup -- sequence of arrays. All arrays must have the same \n shape.\n Examples:\n >>> import numpy\n >>> a = array((1,2,3))\n >>> b = array((2,3,4))\n >>> numpy.dstack((a,b))\n array([ [[1, 2],\n [2, 3],\n [3, 4]]])\n >>> a = array([[1],[2],[3]])\n >>> b = array([[2],[3],[4]])\n >>> numpy.dstack((a,b))\n array([[ [1, 2]],\n [ [2, 3]],\n [ [3, 4]]])\n \"\"\"\n return _nx.concatenate(map(atleast_3d,tup),2)\n\ndef _replace_zero_by_x_arrays(sub_arys):\n for i in range(len(sub_arys)):\n if len(_nx.shape(sub_arys[i])) == 0:\n sub_arys[i] = _nx.array([])\n elif _nx.sometrue(_nx.equal(_nx.shape(sub_arys[i]),0)):\n sub_arys[i] = _nx.array([]) \n return sub_arys\n\ndef array_split(ary,indices_or_sections,axis = 0):\n \"\"\" Divide an array into a list of sub-arrays.\n\n Description:\n Divide ary into a list of sub-arrays along the\n specified axis. If indices_or_sections is an integer,\n ary is divided into that many equally sized arrays.\n If it is impossible to make an equal split, each of the\n leading arrays in the list have one additional member. If\n indices_or_sections is a list of sorted integers, its\n entries define the indexes where ary is split.\n\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n axis -- integer. default=0.\n Specifies the axis along which to split ary.\n Caveats:\n Currently, the default for axis is 0. This\n means a 2D array is divided into multiple groups\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n However, we could also make the argument that SciPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n try:\n Ntotal = ary.shape[axis]\n except AttributeError:\n Ntotal = len(ary)\n try: # handle scalar case.\n Nsections = len(indices_or_sections) + 1\n div_points = [0] + list(indices_or_sections) + [Ntotal]\n except TypeError: #indices_or_sections is a scalar, not an array.\n Nsections = int(indices_or_sections)\n if Nsections <= 0:\n raise ValueError, 'number sections must be larger than 0.'\n Neach_section,extras = divmod(Ntotal,Nsections)\n section_sizes = [0] + \\\n extras * [Neach_section+1] + \\\n (Nsections-extras) * [Neach_section]\n div_points = _nx.array(section_sizes).cumsum()\n\n sub_arys = []\n sary = _nx.swapaxes(ary,axis,0)\n for i in range(Nsections):\n st = div_points[i]; end = div_points[i+1]\n sub_arys.append(_nx.swapaxes(sary[st:end],axis,0))\n\n # there is a wierd issue with array slicing that allows\n # 0x10 arrays and other such things. The following cluge is needed\n # to get around this issue.\n sub_arys = _replace_zero_by_x_arrays(sub_arys)\n # end cluge.\n\n return sub_arys\n\ndef split(ary,indices_or_sections,axis=0):\n \"\"\" Divide an array into a list of sub-arrays.\n\n Description:\n Divide ary into a list of sub-arrays along the\n specified axis. If indices_or_sections is an integer,\n ary is divided into that many equally sized arrays.\n If it is impossible to make an equal split, an error is \n raised. This is the only way this function differs from\n the array_split() function. If indices_or_sections is a \n list of sorted integers, its entries define the indexes\n where ary is split.\n\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n axis -- integer. default=0.\n Specifies the axis along which to split ary.\n Caveats:\n Currently, the default for axis is 0. This\n means a 2D array is divided into multiple groups\n of rows. This seems like the appropriate default, but\n we've agreed most other functions should default to\n axis=-1. Perhaps we should use axis=-1 for consistency.\n However, we could also make the argument that SciPy\n works on \"rows\" by default. sum() sums up rows of\n values. split() will split data into rows. Opinions?\n \"\"\"\n try: len(indices_or_sections)\n except TypeError:\n sections = indices_or_sections\n N = ary.shape[axis]\n if N % sections:\n raise ValueError, 'array split does not result in an equal division'\n res = array_split(ary,indices_or_sections,axis)\n return res\n\ndef hsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple columns of sub-arrays\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups of columns. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Related:\n hstack, split, array_split, vsplit, dsplit.\n Examples:\n >>> import numpy\n >>> a= array((1,2,3,4))\n >>> numpy.hsplit(a,2)\n [array([1, 2]), array([3, 4])]\n >>> a = array([[1,2,3,4],[1,2,3,4]])\n [array([[1, 2],\n [1, 2]]), array([[3, 4],\n [3, 4]])]\n\n \"\"\"\n if len(_nx.shape(ary)) == 0:\n raise ValueError, 'hsplit only works on arrays of 1 or more dimensions'\n if len(ary.shape) > 1:\n return split(ary,indices_or_sections,1)\n else:\n return split(ary,indices_or_sections,0)\n\ndef vsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple rows of sub-arrays\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups of rows. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Caveats:\n How should we handle 1D arrays here? I am currently raising\n an error when I encounter them. Any better approach?\n\n Should we reduce the returned array to their minium dimensions\n by getting rid of any dimensions that are 1?\n Related:\n vstack, split, array_split, hsplit, dsplit.\n Examples:\n import numpy\n >>> a = array([[1,2,3,4],\n ... [1,2,3,4]])\n >>> numpy.vsplit(a)\n [array([ [1, 2, 3, 4]]), array([ [1, 2, 3, 4]])]\n\n \"\"\"\n if len(_nx.shape(ary)) < 2:\n raise ValueError, 'vsplit only works on arrays of 2 or more dimensions'\n return split(ary,indices_or_sections,0)\n\ndef dsplit(ary,indices_or_sections):\n \"\"\" Split ary into multiple sub-arrays along the 3rd axis (depth)\n\n Description:\n Split a single array into multiple sub arrays. The array is\n divided into groups along the 3rd axis. If indices_or_sections is\n an integer, ary is divided into that many equally sized sub arrays.\n If it is impossible to make the sub-arrays equally sized, the\n operation throws a ValueError exception. See array_split and\n split for other options on indices_or_sections.\n Arguments:\n ary -- N-D array.\n Array to be divided into sub-arrays.\n indices_or_sections -- integer or 1D array.\n If integer, defines the number of (close to) equal sized\n sub-arrays. If it is a 1D array of sorted indices, it\n defines the indexes at which ary is divided. Any empty\n list results in a single sub-array equal to the original\n array.\n Returns:\n sequence of sub-arrays. The returned arrays have the same\n number of dimensions as the input array.\n Caveats:\n See vsplit caveats.\n Related:\n dstack, split, array_split, hsplit, vsplit.\n Examples:\n >>> a = array([[[1,2,3,4],[1,2,3,4]]])\n [array([ [[1, 2],\n [1, 2]]]), array([ [[3, 4],\n [3, 4]]])]\n\n \"\"\"\n if len(_nx.shape(ary)) < 3:\n raise ValueError, 'vsplit only works on arrays of 3 or more dimensions'\n return split(ary,indices_or_sections,2)\n\n", + "methods": [ + { + "name": "apply_along_axis", + "long_name": "apply_along_axis( func1d , axis , arr , * args )", + "filename": "shape_base.py", + "nloc": 53, + "complexity": 10, + "token_count": 418, + "parameters": [ + "func1d", + "axis", + "arr", + "args" + ], + "start_line": 10, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "apply_over_axes", + "long_name": "apply_over_axes( func , a , axes )", + "filename": "shape_base.py", + "nloc": 19, + "complexity": 6, + "token_count": 110, + "parameters": [ + "func", + "a", + "axes" + ], + "start_line": 72, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "expand_dims", + "long_name": "expand_dims( a , axis )", + "filename": "shape_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "axis" + ], + "start_line": 99, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "atleast_1d", + "long_name": "atleast_1d( * arys )", + "filename": "shape_base.py", + "nloc": 11, + "complexity": 4, + "token_count": 63, + "parameters": [ + "arys" + ], + "start_line": 109, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "atleast_2d", + "long_name": "atleast_2d( * arys )", + "filename": "shape_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 88, + "parameters": [ + "arys" + ], + "start_line": 132, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "atleast_3d", + "long_name": "atleast_3d( * arys )", + "filename": "shape_base.py", + "nloc": 17, + "complexity": 6, + "token_count": 112, + "parameters": [ + "arys" + ], + "start_line": 159, + "end_line": 189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "vstack", + "long_name": "vstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 192, + "end_line": 221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "hstack", + "long_name": "hstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 223, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "column_stack", + "long_name": "column_stack( tup )", + "filename": "shape_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 30, + "parameters": [ + "tup" + ], + "start_line": 250, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dstack", + "long_name": "dstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 273, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "_replace_zero_by_x_arrays", + "long_name": "_replace_zero_by_x_arrays( sub_arys )", + "filename": "shape_base.py", + "nloc": 7, + "complexity": 4, + "token_count": 81, + "parameters": [ + "sub_arys" + ], + "start_line": 302, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_split", + "long_name": "array_split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 24, + "complexity": 5, + "token_count": 187, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 310, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "split", + "long_name": "split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 9, + "complexity": 3, + "token_count": 53, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 374, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "hsplit", + "long_name": "hsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 7, + "complexity": 3, + "token_count": 55, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 417, + "end_line": 457, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "vsplit", + "long_name": "vsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 34, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 459, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "dsplit", + "long_name": "dsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 34, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 501, + "end_line": 536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "apply_along_axis", + "long_name": "apply_along_axis( func1d , axis , arr , * args )", + "filename": "shape_base.py", + "nloc": 53, + "complexity": 10, + "token_count": 418, + "parameters": [ + "func1d", + "axis", + "arr", + "args" + ], + "start_line": 10, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 60, + "top_nesting_level": 0 + }, + { + "name": "apply_over_axes", + "long_name": "apply_over_axes( func , a , axes )", + "filename": "shape_base.py", + "nloc": 19, + "complexity": 6, + "token_count": 110, + "parameters": [ + "func", + "a", + "axes" + ], + "start_line": 72, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "expand_dims", + "long_name": "expand_dims( a , axis )", + "filename": "shape_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "axis" + ], + "start_line": 99, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "atleast_1d", + "long_name": "atleast_1d( * arys )", + "filename": "shape_base.py", + "nloc": 11, + "complexity": 4, + "token_count": 63, + "parameters": [ + "arys" + ], + "start_line": 109, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "atleast_2d", + "long_name": "atleast_2d( * arys )", + "filename": "shape_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 88, + "parameters": [ + "arys" + ], + "start_line": 132, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "atleast_3d", + "long_name": "atleast_3d( * arys )", + "filename": "shape_base.py", + "nloc": 17, + "complexity": 6, + "token_count": 112, + "parameters": [ + "arys" + ], + "start_line": 159, + "end_line": 189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "vstack", + "long_name": "vstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 192, + "end_line": 221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + }, + { + "name": "hstack", + "long_name": "hstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 223, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "column_stack", + "long_name": "column_stack( tup )", + "filename": "shape_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 30, + "parameters": [ + "tup" + ], + "start_line": 250, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dstack", + "long_name": "dstack( tup )", + "filename": "shape_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "tup" + ], + "start_line": 273, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "_replace_zero_by_x_arrays", + "long_name": "_replace_zero_by_x_arrays( sub_arys )", + "filename": "shape_base.py", + "nloc": 7, + "complexity": 4, + "token_count": 81, + "parameters": [ + "sub_arys" + ], + "start_line": 302, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "array_split", + "long_name": "array_split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 24, + "complexity": 5, + "token_count": 187, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 310, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "split", + "long_name": "split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 9, + "complexity": 3, + "token_count": 53, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 374, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "hsplit", + "long_name": "hsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 7, + "complexity": 3, + "token_count": 55, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 417, + "end_line": 457, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "vsplit", + "long_name": "vsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 34, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 459, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "dsplit", + "long_name": "dsplit( ary , indices_or_sections )", + "filename": "shape_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 34, + "parameters": [ + "ary", + "indices_or_sections" + ], + "start_line": 501, + "end_line": 536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "array_split", + "long_name": "array_split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 24, + "complexity": 5, + "token_count": 187, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 310, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "split", + "long_name": "split( ary , indices_or_sections , axis = 0 )", + "filename": "shape_base.py", + "nloc": 9, + "complexity": 3, + "token_count": 53, + "parameters": [ + "ary", + "indices_or_sections", + "axis" + ], + "start_line": 374, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + } + ], + "nloc": 192, + "complexity": 56, + "token_count": 1454, + "diff_parsed": { + "added": [ + " However, we could also make the argument that NumPy", + " However, we could also make the argument that NumPy" + ], + "deleted": [ + " However, we could also make the argument that SciPy", + " However, we could also make the argument that SciPy" + ] + } + } + ] + }, + { + "hash": "fc95346cc7568d2464cb4daa955b947d5b42a457", + "msg": "Fixed problem in mlab.py", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T00:46:19+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T00:46:19+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "605f8a5533071a0939fb5cbbc94dafede8006074" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1, + "insertions": 1, + "lines": 2, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/lib/mlab.py", + "new_path": "numpy/lib/mlab.py", + "filename": "mlab.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -11,4 +11,4 @@\n from polynomial import roots\n \n from numpy.random import rand, randn\n-from numpy.corelinalg import eig, svd\n+from numpy.linalg import eig, svd\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "# This module is for compatibility only. All functions are defined elsewhere.\n\nfrom numpy.core.numeric import *\n\nfrom twodim_base import eye, tri, diag, fliplr, flipud, rot90, tril, triu\nfrom numpy.core.oldnumeric import amax as max\nfrom numpy.core.oldnumeric import amin as min\nfrom function_base import msort, median, trapz, diff, cov, corrcoef, kaiser, blackman, \\\n bartlett, hanning, hamming, sinc, angle\nfrom numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, squeeze\nfrom polynomial import roots\n\nfrom numpy.random import rand, randn\nfrom numpy.linalg import eig, svd\n", + "source_code_before": "# This module is for compatibility only. All functions are defined elsewhere.\n\nfrom numpy.core.numeric import *\n\nfrom twodim_base import eye, tri, diag, fliplr, flipud, rot90, tril, triu\nfrom numpy.core.oldnumeric import amax as max\nfrom numpy.core.oldnumeric import amin as min\nfrom function_base import msort, median, trapz, diff, cov, corrcoef, kaiser, blackman, \\\n bartlett, hanning, hamming, sinc, angle\nfrom numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, squeeze\nfrom polynomial import roots\n\nfrom numpy.random import rand, randn\nfrom numpy.corelinalg import eig, svd\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 10, + "complexity": 0, + "token_count": 115, + "diff_parsed": { + "added": [ + "from numpy.linalg import eig, svd" + ], + "deleted": [ + "from numpy.corelinalg import eig, svd" + ] + } + } + ] + }, + { + "hash": "f115fdf57332da17fd43202a1512b02902a77048", + "msg": "numpy.base -> numpy", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T01:06:10+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T01:06:10+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "fc95346cc7568d2464cb4daa955b947d5b42a457" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 20, + "insertions": 20, + "lines": 40, + "files": 16, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/core/arrayprint.py", + "new_path": "numpy/core/arrayprint.py", + "filename": "arrayprint.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -10,7 +10,7 @@\n # last revision: 1996-3-13\n # modified by Jim Hugunin 1997-3-3 for repr's and str's (and other details)\n # and by Perry Greenfield 2000-4-1 for numarray\n-# and by Travis Oliphant 2005-8-22 for numpy.base\n+# and by Travis Oliphant 2005-8-22 for numpy\n \n import sys\n import numeric as _gen\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\"Array printing function\n\n$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $\n\"\"\"\n__all__ = [\"set_summary\", \"summary_off\", \"set_precision\", \"set_line_width\",\n \"array2string\"]\n \n#\n# Written by Konrad Hinsen \n# last revision: 1996-3-13\n# modified by Jim Hugunin 1997-3-3 for repr's and str's (and other details)\n# and by Perry Greenfield 2000-4-1 for numarray\n# and by Travis Oliphant 2005-8-22 for numpy\n\nimport sys\nimport numeric as _gen\nimport numerictypes as _nt\nimport umath as _uf\n_nc = _gen\n\n# The following functions are emergency substitutes for numeric functions\n# which sometimes get broken during development.\n\ndef product(x, y): return x*y\n\ndef _maximum_reduce(arr):\n maximum = arr[0]\n for i in xrange(1, arr.nelements()):\n if arr[i] > maximum: maximum = arr[i]\n return maximum\n\ndef _minimum_reduce(arr):\n minimum = arr[0]\n for i in xrange(1, arr.nelements()):\n if arr[i] < minimum: minimum = arr[i]\n return minimum\n\ndef _numeric_compress(arr):\n nonzero = 0\n for i in xrange(arr.nelements()):\n if arr[i] != 0: nonzero += 1\n retarr = _nc.zeros((nonzero,))\n nonzero = 0\n for i in xrange(arr.nelements()):\n if arr[i] != 0:\n retarr[nonzero] = abs(arr[i])\n nonzero += 1\n return retarr\n\n_failsafe = 0\nif _failsafe:\n max_reduce = _maximum_reduce\n min_reduce = _minimum_reduce\nelse:\n max_reduce = _uf.maximum.reduce\n min_reduce = _uf.minimum.reduce\n\n_summaryEdgeItems = 3 # repr N leading and trailing items of each dimension\n_summaryThreshhold = 1000 # total items > triggers array summarization\n\n_float_output_precision = 8\n_float_output_suppress_small = False\n_line_width = 75\n\n\ndef set_printoptions(precision=None, threshold=None, edgeitems=None, \n linewidth=None, suppress=None):\n \"\"\"Set options associated with printing.\n\n precision the default number of digits of precision for floating\n point output\n (default 8)\n threshold total number of array elements which trigger summarization\n rather than full repr.\n (default 1000)\n edgeitems number of array items in summary at beginning and end of\n each dimension.\n (default 3)\n linewidth the number of characters per line for the purpose of inserting\n line breaks.\n (default 75)\n supress Boolean value indicating whether or not suppress printing\n of small floating point values using scientific notation\n (default False)\n \"\"\" \n \n global _summaryThreshhold, _summaryEdgeItems, _float_output_precision, \\\n _line_width, _float_output_suppress_small\n if (linewidth is not None):\n _line_width = linewidth\n if (threshold is not None):\n _summaryThreshhold = threshold\n if (edgeitems is not None):\n _summaryEdgeItems = edgeitems\n if (precision is not None):\n _float_output_precision = precision\n if (suppress is not None):\n _float_output_supress_small = not not suppress\n return\n\ndef get_printoptions():\n return _float_output_precision, _summaryThreshhold, _summaryEdgeItems, \\\n _line_width, _float_output_suppress_small\n\n\ndef _leading_trailing(a):\n if a.ndim == 1:\n if len(a) > 2*_summaryEdgeItems:\n b = _gen.concatenate((a[:_summaryEdgeItems],\n a[-_summaryEdgeItems:]))\n else:\n b = a\n else:\n if len(a) > 2*_summaryEdgeItems:\n l = [_leading_trailing(a[i]) for i in range(\n min(len(a), _summaryEdgeItems))]\n l.extend([_leading_trailing(a[-i]) for i in range(\n min(len(a), _summaryEdgeItems),0,-1)])\n else:\n l = [_leading_trailing(a[i]) for i in range(0, len(a))]\n b = _gen.concatenate(tuple(l))\n return b\n\ndef _array2string(a, max_line_width, precision, suppress_small, separator=' ',\n prefix=\"\"):\n\n if max_line_width is None:\n max_line_width = _line_width\n \n if precision is None:\n precision = _float_output_precision\n\n if suppress_small is None:\n suppress_small = _float_output_suppress_small\n\n if a.size > _summaryThreshhold:\n summary_insert = \"..., \"\n data = _leading_trailing(a)\n else:\n summary_insert = \"\"\n data = a.ravel()\n\n items_per_line = a.shape[-1]\n \n try:\n format_function = a._format\n except AttributeError:\n dtype = a.dtype\n if issubclass(dtype, _nt.bool):\n format = \"%s\"\n format_function = lambda x, f = format: format % x\n if issubclass(dtype, _nt.integer):\n max_str_len = max(len(str(max_reduce(data))),\n len(str(min_reduce(data))))\n format = '%' + str(max_str_len) + 'd'\n format_function = lambda x, f = format: _formatInteger(x, f)\n elif issubclass(dtype, _nt.floating):\n format = _floatFormat(data, precision, suppress_small)\n format_function = lambda x, f = format: _formatFloat(x, f)\n elif issubclass(dtype, _nt.complexfloating):\n real_format = _floatFormat(\n data.real, precision, suppress_small, sign=0)\n imag_format = _floatFormat(\n data.imag, precision, suppress_small, sign=1)\n format_function = lambda x, f1 = real_format, f2 = imag_format: \\\n _formatComplex(x, f1, f2)\n else:\n\t format = '%s'\n\t format_function = lambda x, f = format: format % str(x)\n\t \n next_line_prefix = \" \" # skip over \"[\"\n next_line_prefix += \" \"*len(prefix) # skip over array(\n\n\n lst = _formatArray(a, format_function, len(a.shape), max_line_width,\n next_line_prefix, separator,\n _summaryEdgeItems, summary_insert)[:-1]\n\n return lst\n\ndef array2string(a, max_line_width = None, precision = None,\n suppress_small = None, separator=' ', prefix=\"\",\n style=repr):\n\n if a.shape == ():\n x = a.item()\n try:\n lst = a._format(x)\n except AttributeError:\n lst = style(x)\n elif reduce(product, a.shape) == 0:\n # treat as a null array if any of shape elements == 0\n lst = \"[]\"\n else:\n lst = _array2string(a, max_line_width, precision, suppress_small,\n separator, prefix)\n return lst\n\ndef _extendLine(s, line, word, max_line_len, next_line_prefix):\n if len(line.rstrip()) + len(word.rstrip()) >= max_line_len:\n s += line.rstrip() + \"\\n\"\n line = next_line_prefix\n line += word\n return s, line\n\ndef _formatArray(a, format_function, rank, max_line_len,\n next_line_prefix, separator, edge_items, summary_insert):\n \"\"\"formatArray is designed for two modes of operation:\n\n 1. Full output\n\n 2. Summarized output\n \n \"\"\"\n if rank == 0:\n return str(a.item())\n \n if summary_insert and 2*edge_items < len(a):\n leading_items, trailing_items, summary_insert1 = \\\n edge_items, edge_items, summary_insert\n else:\n leading_items, trailing_items, summary_insert1 = 0, len(a), \"\"\n\n if rank == 1:\n \n s = \"\"\n line = next_line_prefix\n for i in xrange(leading_items):\n word = format_function(a[i]) + separator\n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n \n if summary_insert1:\n s, line = _extendLine(s, line, summary_insert1, max_line_len, next_line_prefix)\n\n for i in xrange(trailing_items, 1, -1):\n word = format_function(a[-i]) + separator \n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n \n word = format_function(a[-1])\n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n s += line + \"]\\n\"\n s = '[' + s[len(next_line_prefix):]\n else:\n s = '['\n sep = separator.rstrip()\n for i in xrange(leading_items):\n if i > 0:\n s += next_line_prefix\n s += _formatArray(a[i], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert)\n s = s.rstrip()+ sep.rstrip() + '\\n'*max(rank-1,1)\n \n if summary_insert1:\n s += next_line_prefix + summary_insert1 + \"\\n\"\n \n for i in xrange(trailing_items, 1, -1):\n if leading_items or i != trailing_items:\n s += next_line_prefix\n s += _formatArray(a[-i], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert)\n s = s.rstrip() + sep.rstrip() + '\\n'*max(rank-1,1)\n if leading_items or trailing_items > 1:\n s += next_line_prefix\n s += _formatArray(a[-1], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert).rstrip()+']\\n'\n return s\n\ndef _floatFormat(data, precision, suppress_small, sign = 0):\n exp_format = 0\n non_zero = _uf.absolute(data.compress(_uf.not_equal(data, 0)))\n ##non_zero = _numeric_compress(data) ##\n if len(non_zero) == 0:\n max_val = 0.\n min_val = 0.\n else:\n max_val = max_reduce(non_zero)\n min_val = min_reduce(non_zero)\n if max_val >= 1.e8:\n exp_format = 1\n if not suppress_small and (min_val < 0.0001\n or max_val/min_val > 1000.):\n exp_format = 1\n if exp_format:\n large_exponent = 0 < min_val < 1e-99 or max_val >= 1e100\n max_str_len = 8 + precision + large_exponent\n if sign: format = '%+'\n else: format = '%'\n format = format + str(max_str_len) + '.' + str(precision) + 'e'\n if large_exponent: format = format + '3'\n else:\n format = '%.' + str(precision) + 'f'\n precision = min(precision, max(tuple(map(lambda x, p=precision,\n f=format: _digits(x,p,f),\n data))))\n max_str_len = len(str(int(max_val))) + precision + 2\n if sign: format = '%#+'\n else: format = '%#'\n format = format + str(max_str_len) + '.' + str(precision) + 'f'\n return format\n\ndef _digits(x, precision, format):\n s = format % x\n zeros = len(s)\n while s[zeros-1] == '0': zeros = zeros-1\n return precision-len(s)+zeros\n\n\n_MAXINT = sys.maxint\n_MININT = -sys.maxint-1\ndef _formatInteger(x, format):\n if (x < _MAXINT) and (x > _MININT):\n return format % x\n else:\n return \"%s\" % x\n\ndef _formatFloat(x, format, strip_zeros = 1):\n if format[-1] == '3':\n # 3-digit exponent\n format = format[:-1]\n s = format % x\n third = s[-3]\n if third == '+' or third == '-':\n s = s[1:-2] + '0' + s[-2:]\n elif format[-1] == 'e':\n # 2-digit exponent\n s = format % x\n if s[-3] == '0':\n s = ' ' + s[:-3] + s[-2:]\n elif format[-1] == 'f':\n s = format % x\n if strip_zeros:\n zeros = len(s)\n while s[zeros-1] == '0': zeros = zeros-1\n s = s[:zeros] + (len(s)-zeros)*' '\n else:\n s = format % x\n return s\n\ndef _formatComplex(x, real_format, imag_format):\n r = _formatFloat(x.real, real_format)\n i = _formatFloat(x.imag, imag_format, 0)\n if imag_format[-1] == 'f':\n zeros = len(i)\n while zeros > 2 and i[zeros-1] == '0': zeros = zeros-1\n i = i[:zeros] + 'j' + (len(i)-zeros)*' '\n else:\n i = i + 'j'\n return r + i\n\ndef _formatGeneral(x):\n return str(x) + ' '\n\nif __name__ == '__main__':\n a = _nc.arange(10)\n print array2string(a)\n print array2string(_nc.array([[],[]]))\n", + "source_code_before": "\"\"\"Array printing function\n\n$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $\n\"\"\"\n__all__ = [\"set_summary\", \"summary_off\", \"set_precision\", \"set_line_width\",\n \"array2string\"]\n \n#\n# Written by Konrad Hinsen \n# last revision: 1996-3-13\n# modified by Jim Hugunin 1997-3-3 for repr's and str's (and other details)\n# and by Perry Greenfield 2000-4-1 for numarray\n# and by Travis Oliphant 2005-8-22 for numpy.base\n\nimport sys\nimport numeric as _gen\nimport numerictypes as _nt\nimport umath as _uf\n_nc = _gen\n\n# The following functions are emergency substitutes for numeric functions\n# which sometimes get broken during development.\n\ndef product(x, y): return x*y\n\ndef _maximum_reduce(arr):\n maximum = arr[0]\n for i in xrange(1, arr.nelements()):\n if arr[i] > maximum: maximum = arr[i]\n return maximum\n\ndef _minimum_reduce(arr):\n minimum = arr[0]\n for i in xrange(1, arr.nelements()):\n if arr[i] < minimum: minimum = arr[i]\n return minimum\n\ndef _numeric_compress(arr):\n nonzero = 0\n for i in xrange(arr.nelements()):\n if arr[i] != 0: nonzero += 1\n retarr = _nc.zeros((nonzero,))\n nonzero = 0\n for i in xrange(arr.nelements()):\n if arr[i] != 0:\n retarr[nonzero] = abs(arr[i])\n nonzero += 1\n return retarr\n\n_failsafe = 0\nif _failsafe:\n max_reduce = _maximum_reduce\n min_reduce = _minimum_reduce\nelse:\n max_reduce = _uf.maximum.reduce\n min_reduce = _uf.minimum.reduce\n\n_summaryEdgeItems = 3 # repr N leading and trailing items of each dimension\n_summaryThreshhold = 1000 # total items > triggers array summarization\n\n_float_output_precision = 8\n_float_output_suppress_small = False\n_line_width = 75\n\n\ndef set_printoptions(precision=None, threshold=None, edgeitems=None, \n linewidth=None, suppress=None):\n \"\"\"Set options associated with printing.\n\n precision the default number of digits of precision for floating\n point output\n (default 8)\n threshold total number of array elements which trigger summarization\n rather than full repr.\n (default 1000)\n edgeitems number of array items in summary at beginning and end of\n each dimension.\n (default 3)\n linewidth the number of characters per line for the purpose of inserting\n line breaks.\n (default 75)\n supress Boolean value indicating whether or not suppress printing\n of small floating point values using scientific notation\n (default False)\n \"\"\" \n \n global _summaryThreshhold, _summaryEdgeItems, _float_output_precision, \\\n _line_width, _float_output_suppress_small\n if (linewidth is not None):\n _line_width = linewidth\n if (threshold is not None):\n _summaryThreshhold = threshold\n if (edgeitems is not None):\n _summaryEdgeItems = edgeitems\n if (precision is not None):\n _float_output_precision = precision\n if (suppress is not None):\n _float_output_supress_small = not not suppress\n return\n\ndef get_printoptions():\n return _float_output_precision, _summaryThreshhold, _summaryEdgeItems, \\\n _line_width, _float_output_suppress_small\n\n\ndef _leading_trailing(a):\n if a.ndim == 1:\n if len(a) > 2*_summaryEdgeItems:\n b = _gen.concatenate((a[:_summaryEdgeItems],\n a[-_summaryEdgeItems:]))\n else:\n b = a\n else:\n if len(a) > 2*_summaryEdgeItems:\n l = [_leading_trailing(a[i]) for i in range(\n min(len(a), _summaryEdgeItems))]\n l.extend([_leading_trailing(a[-i]) for i in range(\n min(len(a), _summaryEdgeItems),0,-1)])\n else:\n l = [_leading_trailing(a[i]) for i in range(0, len(a))]\n b = _gen.concatenate(tuple(l))\n return b\n\ndef _array2string(a, max_line_width, precision, suppress_small, separator=' ',\n prefix=\"\"):\n\n if max_line_width is None:\n max_line_width = _line_width\n \n if precision is None:\n precision = _float_output_precision\n\n if suppress_small is None:\n suppress_small = _float_output_suppress_small\n\n if a.size > _summaryThreshhold:\n summary_insert = \"..., \"\n data = _leading_trailing(a)\n else:\n summary_insert = \"\"\n data = a.ravel()\n\n items_per_line = a.shape[-1]\n \n try:\n format_function = a._format\n except AttributeError:\n dtype = a.dtype\n if issubclass(dtype, _nt.bool):\n format = \"%s\"\n format_function = lambda x, f = format: format % x\n if issubclass(dtype, _nt.integer):\n max_str_len = max(len(str(max_reduce(data))),\n len(str(min_reduce(data))))\n format = '%' + str(max_str_len) + 'd'\n format_function = lambda x, f = format: _formatInteger(x, f)\n elif issubclass(dtype, _nt.floating):\n format = _floatFormat(data, precision, suppress_small)\n format_function = lambda x, f = format: _formatFloat(x, f)\n elif issubclass(dtype, _nt.complexfloating):\n real_format = _floatFormat(\n data.real, precision, suppress_small, sign=0)\n imag_format = _floatFormat(\n data.imag, precision, suppress_small, sign=1)\n format_function = lambda x, f1 = real_format, f2 = imag_format: \\\n _formatComplex(x, f1, f2)\n else:\n\t format = '%s'\n\t format_function = lambda x, f = format: format % str(x)\n\t \n next_line_prefix = \" \" # skip over \"[\"\n next_line_prefix += \" \"*len(prefix) # skip over array(\n\n\n lst = _formatArray(a, format_function, len(a.shape), max_line_width,\n next_line_prefix, separator,\n _summaryEdgeItems, summary_insert)[:-1]\n\n return lst\n\ndef array2string(a, max_line_width = None, precision = None,\n suppress_small = None, separator=' ', prefix=\"\",\n style=repr):\n\n if a.shape == ():\n x = a.item()\n try:\n lst = a._format(x)\n except AttributeError:\n lst = style(x)\n elif reduce(product, a.shape) == 0:\n # treat as a null array if any of shape elements == 0\n lst = \"[]\"\n else:\n lst = _array2string(a, max_line_width, precision, suppress_small,\n separator, prefix)\n return lst\n\ndef _extendLine(s, line, word, max_line_len, next_line_prefix):\n if len(line.rstrip()) + len(word.rstrip()) >= max_line_len:\n s += line.rstrip() + \"\\n\"\n line = next_line_prefix\n line += word\n return s, line\n\ndef _formatArray(a, format_function, rank, max_line_len,\n next_line_prefix, separator, edge_items, summary_insert):\n \"\"\"formatArray is designed for two modes of operation:\n\n 1. Full output\n\n 2. Summarized output\n \n \"\"\"\n if rank == 0:\n return str(a.item())\n \n if summary_insert and 2*edge_items < len(a):\n leading_items, trailing_items, summary_insert1 = \\\n edge_items, edge_items, summary_insert\n else:\n leading_items, trailing_items, summary_insert1 = 0, len(a), \"\"\n\n if rank == 1:\n \n s = \"\"\n line = next_line_prefix\n for i in xrange(leading_items):\n word = format_function(a[i]) + separator\n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n \n if summary_insert1:\n s, line = _extendLine(s, line, summary_insert1, max_line_len, next_line_prefix)\n\n for i in xrange(trailing_items, 1, -1):\n word = format_function(a[-i]) + separator \n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n \n word = format_function(a[-1])\n s, line = _extendLine(s, line, word, max_line_len, next_line_prefix)\n s += line + \"]\\n\"\n s = '[' + s[len(next_line_prefix):]\n else:\n s = '['\n sep = separator.rstrip()\n for i in xrange(leading_items):\n if i > 0:\n s += next_line_prefix\n s += _formatArray(a[i], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert)\n s = s.rstrip()+ sep.rstrip() + '\\n'*max(rank-1,1)\n \n if summary_insert1:\n s += next_line_prefix + summary_insert1 + \"\\n\"\n \n for i in xrange(trailing_items, 1, -1):\n if leading_items or i != trailing_items:\n s += next_line_prefix\n s += _formatArray(a[-i], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert)\n s = s.rstrip() + sep.rstrip() + '\\n'*max(rank-1,1)\n if leading_items or trailing_items > 1:\n s += next_line_prefix\n s += _formatArray(a[-1], format_function, rank-1, max_line_len,\n \" \" + next_line_prefix, separator, edge_items,\n summary_insert).rstrip()+']\\n'\n return s\n\ndef _floatFormat(data, precision, suppress_small, sign = 0):\n exp_format = 0\n non_zero = _uf.absolute(data.compress(_uf.not_equal(data, 0)))\n ##non_zero = _numeric_compress(data) ##\n if len(non_zero) == 0:\n max_val = 0.\n min_val = 0.\n else:\n max_val = max_reduce(non_zero)\n min_val = min_reduce(non_zero)\n if max_val >= 1.e8:\n exp_format = 1\n if not suppress_small and (min_val < 0.0001\n or max_val/min_val > 1000.):\n exp_format = 1\n if exp_format:\n large_exponent = 0 < min_val < 1e-99 or max_val >= 1e100\n max_str_len = 8 + precision + large_exponent\n if sign: format = '%+'\n else: format = '%'\n format = format + str(max_str_len) + '.' + str(precision) + 'e'\n if large_exponent: format = format + '3'\n else:\n format = '%.' + str(precision) + 'f'\n precision = min(precision, max(tuple(map(lambda x, p=precision,\n f=format: _digits(x,p,f),\n data))))\n max_str_len = len(str(int(max_val))) + precision + 2\n if sign: format = '%#+'\n else: format = '%#'\n format = format + str(max_str_len) + '.' + str(precision) + 'f'\n return format\n\ndef _digits(x, precision, format):\n s = format % x\n zeros = len(s)\n while s[zeros-1] == '0': zeros = zeros-1\n return precision-len(s)+zeros\n\n\n_MAXINT = sys.maxint\n_MININT = -sys.maxint-1\ndef _formatInteger(x, format):\n if (x < _MAXINT) and (x > _MININT):\n return format % x\n else:\n return \"%s\" % x\n\ndef _formatFloat(x, format, strip_zeros = 1):\n if format[-1] == '3':\n # 3-digit exponent\n format = format[:-1]\n s = format % x\n third = s[-3]\n if third == '+' or third == '-':\n s = s[1:-2] + '0' + s[-2:]\n elif format[-1] == 'e':\n # 2-digit exponent\n s = format % x\n if s[-3] == '0':\n s = ' ' + s[:-3] + s[-2:]\n elif format[-1] == 'f':\n s = format % x\n if strip_zeros:\n zeros = len(s)\n while s[zeros-1] == '0': zeros = zeros-1\n s = s[:zeros] + (len(s)-zeros)*' '\n else:\n s = format % x\n return s\n\ndef _formatComplex(x, real_format, imag_format):\n r = _formatFloat(x.real, real_format)\n i = _formatFloat(x.imag, imag_format, 0)\n if imag_format[-1] == 'f':\n zeros = len(i)\n while zeros > 2 and i[zeros-1] == '0': zeros = zeros-1\n i = i[:zeros] + 'j' + (len(i)-zeros)*' '\n else:\n i = i + 'j'\n return r + i\n\ndef _formatGeneral(x):\n return str(x) + ' '\n\nif __name__ == '__main__':\n a = _nc.arange(10)\n print array2string(a)\n print array2string(_nc.array([[],[]]))\n", + "methods": [ + { + "name": "_maximum_reduce", + "long_name": "_maximum_reduce( arr )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "arr" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_minimum_reduce", + "long_name": "_minimum_reduce( arr )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "arr" + ], + "start_line": 32, + "end_line": 36, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_numeric_compress", + "long_name": "_numeric_compress( arr )", + "filename": "arrayprint.py", + "nloc": 11, + "complexity": 5, + "token_count": 82, + "parameters": [ + "arr" + ], + "start_line": 38, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "set_printoptions", + "long_name": "set_printoptions( precision = None , threshold = None , edgeitems = None , linewidth = None , suppress = None )", + "filename": "arrayprint.py", + "nloc": 15, + "complexity": 6, + "token_count": 93, + "parameters": [ + "precision", + "threshold", + "edgeitems", + "linewidth", + "suppress" + ], + "start_line": 66, + "end_line": 99, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "get_printoptions", + "long_name": "get_printoptions( )", + "filename": "arrayprint.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [], + "start_line": 101, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "_leading_trailing", + "long_name": "_leading_trailing( a )", + "filename": "arrayprint.py", + "nloc": 17, + "complexity": 7, + "token_count": 159, + "parameters": [ + "a" + ], + "start_line": 106, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_array2string", + "long_name": "_array2string( a , max_line_width , precision , suppress_small , separator = ' ' , prefix = \"\" )", + "filename": "arrayprint.py", + "nloc": 46, + "complexity": 10, + "token_count": 343, + "parameters": [ + "a", + "max_line_width", + "precision", + "suppress_small", + "separator", + "prefix" + ], + "start_line": 124, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 56, + "top_nesting_level": 0 + }, + { + "name": "array2string", + "long_name": "array2string( a , max_line_width = None , precision = None , suppress_small = None , separator = ' ' , prefix = \"\" , style = repr )", + "filename": "arrayprint.py", + "nloc": 15, + "complexity": 4, + "token_count": 98, + "parameters": [ + "a", + "max_line_width", + "precision", + "suppress_small", + "separator", + "prefix", + "style" + ], + "start_line": 181, + "end_line": 197, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_extendLine", + "long_name": "_extendLine( s , line , word , max_line_len , next_line_prefix )", + "filename": "arrayprint.py", + "nloc": 6, + "complexity": 2, + "token_count": 53, + "parameters": [ + "s", + "line", + "word", + "max_line_len", + "next_line_prefix" + ], + "start_line": 199, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_formatArray", + "long_name": "_formatArray( a , format_function , rank , max_line_len , next_line_prefix , separator , edge_items , summary_insert )", + "filename": "arrayprint.py", + "nloc": 49, + "complexity": 16, + "token_count": 433, + "parameters": [ + "a", + "format_function", + "rank", + "max_line_len", + "next_line_prefix", + "separator", + "edge_items", + "summary_insert" + ], + "start_line": 206, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "_floatFormat", + "long_name": "_floatFormat( data , precision , suppress_small , sign = 0 )", + "filename": "arrayprint.py", + "nloc": 31, + "complexity": 11, + "token_count": 252, + "parameters": [ + "data", + "precision", + "suppress_small", + "sign" + ], + "start_line": 271, + "end_line": 302, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "_digits", + "long_name": "_digits( x , precision , format )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 2, + "token_count": 44, + "parameters": [ + "x", + "precision", + "format" + ], + "start_line": 304, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_formatInteger", + "long_name": "_formatInteger( x , format )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 30, + "parameters": [ + "x", + "format" + ], + "start_line": 313, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_formatFloat", + "long_name": "_formatFloat( x , format , strip_zeros = 1 )", + "filename": "arrayprint.py", + "nloc": 20, + "complexity": 9, + "token_count": 172, + "parameters": [ + "x", + "format", + "strip_zeros" + ], + "start_line": 319, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_formatComplex", + "long_name": "_formatComplex( x , real_format , imag_format )", + "filename": "arrayprint.py", + "nloc": 10, + "complexity": 4, + "token_count": 96, + "parameters": [ + "x", + "real_format", + "imag_format" + ], + "start_line": 342, + "end_line": 351, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_formatGeneral", + "long_name": "_formatGeneral( x )", + "filename": "arrayprint.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "x" + ], + "start_line": 353, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_maximum_reduce", + "long_name": "_maximum_reduce( arr )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "arr" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_minimum_reduce", + "long_name": "_minimum_reduce( arr )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "arr" + ], + "start_line": 32, + "end_line": 36, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_numeric_compress", + "long_name": "_numeric_compress( arr )", + "filename": "arrayprint.py", + "nloc": 11, + "complexity": 5, + "token_count": 82, + "parameters": [ + "arr" + ], + "start_line": 38, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "set_printoptions", + "long_name": "set_printoptions( precision = None , threshold = None , edgeitems = None , linewidth = None , suppress = None )", + "filename": "arrayprint.py", + "nloc": 15, + "complexity": 6, + "token_count": 93, + "parameters": [ + "precision", + "threshold", + "edgeitems", + "linewidth", + "suppress" + ], + "start_line": 66, + "end_line": 99, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "get_printoptions", + "long_name": "get_printoptions( )", + "filename": "arrayprint.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [], + "start_line": 101, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "_leading_trailing", + "long_name": "_leading_trailing( a )", + "filename": "arrayprint.py", + "nloc": 17, + "complexity": 7, + "token_count": 159, + "parameters": [ + "a" + ], + "start_line": 106, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_array2string", + "long_name": "_array2string( a , max_line_width , precision , suppress_small , separator = ' ' , prefix = \"\" )", + "filename": "arrayprint.py", + "nloc": 46, + "complexity": 10, + "token_count": 343, + "parameters": [ + "a", + "max_line_width", + "precision", + "suppress_small", + "separator", + "prefix" + ], + "start_line": 124, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 56, + "top_nesting_level": 0 + }, + { + "name": "array2string", + "long_name": "array2string( a , max_line_width = None , precision = None , suppress_small = None , separator = ' ' , prefix = \"\" , style = repr )", + "filename": "arrayprint.py", + "nloc": 15, + "complexity": 4, + "token_count": 98, + "parameters": [ + "a", + "max_line_width", + "precision", + "suppress_small", + "separator", + "prefix", + "style" + ], + "start_line": 181, + "end_line": 197, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_extendLine", + "long_name": "_extendLine( s , line , word , max_line_len , next_line_prefix )", + "filename": "arrayprint.py", + "nloc": 6, + "complexity": 2, + "token_count": 53, + "parameters": [ + "s", + "line", + "word", + "max_line_len", + "next_line_prefix" + ], + "start_line": 199, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "_formatArray", + "long_name": "_formatArray( a , format_function , rank , max_line_len , next_line_prefix , separator , edge_items , summary_insert )", + "filename": "arrayprint.py", + "nloc": 49, + "complexity": 16, + "token_count": 433, + "parameters": [ + "a", + "format_function", + "rank", + "max_line_len", + "next_line_prefix", + "separator", + "edge_items", + "summary_insert" + ], + "start_line": 206, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 64, + "top_nesting_level": 0 + }, + { + "name": "_floatFormat", + "long_name": "_floatFormat( data , precision , suppress_small , sign = 0 )", + "filename": "arrayprint.py", + "nloc": 31, + "complexity": 11, + "token_count": 252, + "parameters": [ + "data", + "precision", + "suppress_small", + "sign" + ], + "start_line": 271, + "end_line": 302, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "_digits", + "long_name": "_digits( x , precision , format )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 2, + "token_count": 44, + "parameters": [ + "x", + "precision", + "format" + ], + "start_line": 304, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_formatInteger", + "long_name": "_formatInteger( x , format )", + "filename": "arrayprint.py", + "nloc": 5, + "complexity": 3, + "token_count": 30, + "parameters": [ + "x", + "format" + ], + "start_line": 313, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_formatFloat", + "long_name": "_formatFloat( x , format , strip_zeros = 1 )", + "filename": "arrayprint.py", + "nloc": 20, + "complexity": 9, + "token_count": 172, + "parameters": [ + "x", + "format", + "strip_zeros" + ], + "start_line": 319, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_formatComplex", + "long_name": "_formatComplex( x , real_format , imag_format )", + "filename": "arrayprint.py", + "nloc": 10, + "complexity": 4, + "token_count": 96, + "parameters": [ + "x", + "real_format", + "imag_format" + ], + "start_line": 342, + "end_line": 351, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_formatGeneral", + "long_name": "_formatGeneral( x )", + "filename": "arrayprint.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "x" + ], + "start_line": 353, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 275, + "complexity": 87, + "token_count": 2113, + "diff_parsed": { + "added": [ + "# and by Travis Oliphant 2005-8-22 for numpy" + ], + "deleted": [ + "# and by Travis Oliphant 2005-8-22 for numpy.base" + ] + } + }, + { + "old_path": "numpy/core/tests/test_matrix.py", + "new_path": "numpy/core/tests/test_matrix.py", + "filename": "test_matrix.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,8 +1,8 @@\n \n from numpy.testing import *\n set_package_path()\n-import numpy.base;reload(numpy.base)\n-from numpy.base import *\n+import numpy.core;reload(numpy.core)\n+from numpy.core import *\n restore_path()\n \n class test_ctor(ScipyTestCase):\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.core;reload(numpy.core)\nfrom numpy.core import *\nrestore_path()\n\nclass test_ctor(ScipyTestCase):\n def test_basic(self):\n A = array([[1,2],[3,4]])\n mA = matrix(A)\n assert all(mA.A == A)\n\n B = bmat(\"A,A;A,A\")\n C = bmat([[A,A], [A,A]])\n D = array([[1,2,1,2],\n [3,4,3,4],\n [1,2,1,2],\n [3,4,3,4]])\n assert all(B.A == D)\n assert all(C.A == D)\n \n vec = arange(5)\n mvec = matrix(vec)\n assert mvec.shape == (1,5)\n \nclass test_properties(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.], \n [3., 4.]])\n mA = matrix(A)\n assert allclose(linalg.inv(A), mA.I)\n assert all(array(transpose(A) == mA.T))\n assert all(array(transpose(A) == mA.H))\n assert all(A == mA.A)\n \n B = A + 2j*A\n mB = matrix(B)\n assert allclose(linalg.inv(B), mB.I)\n assert all(array(transpose(B) == mB.T))\n assert all(array(conjugate(transpose(B)) == mB.H))\n\n def test_comparisons(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n mB = matrix(A) + 0.1\n assert all(mB == A+0.1)\n assert all(mB == matrix(A+0.1))\n assert not any(mB == matrix(A-0.1))\n assert all(mA < mB)\n assert all(mA <= mB)\n assert all(mA <= mA)\n assert not any(mA < mA)\n \n assert not any(mB < mA)\n assert all(mB >= mA)\n assert all(mB >= mB)\n assert not any(mB > mB)\n \n assert all(mA == mA)\n assert not any(mA == mB)\n assert all(mB != mA)\n \n assert not all(abs(mA) > 0)\n assert all(abs(mB > 0))\n \n def test_asmatrix(self):\n A = arange(100).reshape(10,10)\n mA = asmatrix(A)\n mB = matrix(A)\n A[0,0] = -10\n assert A[0,0] == mA[0,0]\n assert A[0,0] != mB[0,0]\n\nclass test_autocasting(ScipyTestCase):\n def test_basic(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n \n mB = mA.copy()\n O = ones((10,10), float64) * 0.1\n mB = mB + O\n assert mB.dtype == float64\n assert all(mA != mB)\n assert all(mB == mA+0.1)\n \n mC = mA.copy()\n O = ones((10,10), complex128)\n mC = mC * O\n assert mC.dtype == complex128\n assert all(mA != mB)\n\nclass test_algebra(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.],\n [3., 4.]])\n mA = matrix(A)\n\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** i).A, B)\n B = dot(B, A)\n \n Ainv = linalg.inv(A)\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** -i).A, B)\n B = dot(B, Ainv)\n\n assert allclose((mA * mA).A, dot(A, A))\n assert allclose((mA + mA).A, (A + A)) \n assert allclose((3*mA).A, (3*A))\n\n", + "source_code_before": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.base;reload(numpy.base)\nfrom numpy.base import *\nrestore_path()\n\nclass test_ctor(ScipyTestCase):\n def test_basic(self):\n A = array([[1,2],[3,4]])\n mA = matrix(A)\n assert all(mA.A == A)\n\n B = bmat(\"A,A;A,A\")\n C = bmat([[A,A], [A,A]])\n D = array([[1,2,1,2],\n [3,4,3,4],\n [1,2,1,2],\n [3,4,3,4]])\n assert all(B.A == D)\n assert all(C.A == D)\n \n vec = arange(5)\n mvec = matrix(vec)\n assert mvec.shape == (1,5)\n \nclass test_properties(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.], \n [3., 4.]])\n mA = matrix(A)\n assert allclose(linalg.inv(A), mA.I)\n assert all(array(transpose(A) == mA.T))\n assert all(array(transpose(A) == mA.H))\n assert all(A == mA.A)\n \n B = A + 2j*A\n mB = matrix(B)\n assert allclose(linalg.inv(B), mB.I)\n assert all(array(transpose(B) == mB.T))\n assert all(array(conjugate(transpose(B)) == mB.H))\n\n def test_comparisons(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n mB = matrix(A) + 0.1\n assert all(mB == A+0.1)\n assert all(mB == matrix(A+0.1))\n assert not any(mB == matrix(A-0.1))\n assert all(mA < mB)\n assert all(mA <= mB)\n assert all(mA <= mA)\n assert not any(mA < mA)\n \n assert not any(mB < mA)\n assert all(mB >= mA)\n assert all(mB >= mB)\n assert not any(mB > mB)\n \n assert all(mA == mA)\n assert not any(mA == mB)\n assert all(mB != mA)\n \n assert not all(abs(mA) > 0)\n assert all(abs(mB > 0))\n \n def test_asmatrix(self):\n A = arange(100).reshape(10,10)\n mA = asmatrix(A)\n mB = matrix(A)\n A[0,0] = -10\n assert A[0,0] == mA[0,0]\n assert A[0,0] != mB[0,0]\n\nclass test_autocasting(ScipyTestCase):\n def test_basic(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n \n mB = mA.copy()\n O = ones((10,10), float64) * 0.1\n mB = mB + O\n assert mB.dtype == float64\n assert all(mA != mB)\n assert all(mB == mA+0.1)\n \n mC = mA.copy()\n O = ones((10,10), complex128)\n mC = mC * O\n assert mC.dtype == complex128\n assert all(mA != mB)\n\nclass test_algebra(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.],\n [3., 4.]])\n mA = matrix(A)\n\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** i).A, B)\n B = dot(B, A)\n \n Ainv = linalg.inv(A)\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** -i).A, B)\n B = dot(B, Ainv)\n\n assert allclose((mA * mA).A, dot(A, A))\n assert allclose((mA + mA).A, (A + A)) \n assert allclose((3*mA).A, (3*A))\n\n", + "methods": [ + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_comparisons", + "long_name": "test_comparisons( self )", + "filename": "test_matrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test_asmatrix", + "long_name": "test_asmatrix( self )", + "filename": "test_matrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 78, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 17, + "complexity": 3, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_comparisons", + "long_name": "test_comparisons( self )", + "filename": "test_matrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test_asmatrix", + "long_name": "test_asmatrix( self )", + "filename": "test_matrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 78, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_matrix.py", + "nloc": 17, + "complexity": 3, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 96, + "complexity": 8, + "token_count": 885, + "diff_parsed": { + "added": [ + "import numpy.core;reload(numpy.core)", + "from numpy.core import *" + ], + "deleted": [ + "import numpy.base;reload(numpy.base)", + "from numpy.base import *" + ] + } + }, + { + "old_path": "numpy/distutils/command/install_headers.py", + "new_path": "numpy/distutils/command/install_headers.py", + "filename": "install_headers.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -13,7 +13,7 @@ def run (self):\n for header in headers:\n if isinstance(header,tuple):\n # Kind of a hack, but I don't know where else to change this...\n- if header[0] == 'numpy.base':\n+ if header[0] == 'numpy.core':\n header = ('numpy', header[1])\n if os.path.splitext(header[1])[1] == '.inc':\n continue\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import os\nfrom distutils.command.install import *\nfrom distutils.command.install_headers import install_headers as old_install_headers\n\nclass install_headers (old_install_headers):\n\n def run (self):\n headers = self.distribution.headers\n if not headers:\n return\n\n prefix = os.path.dirname(self.install_dir)\n for header in headers:\n if isinstance(header,tuple):\n # Kind of a hack, but I don't know where else to change this...\n if header[0] == 'numpy.core':\n header = ('numpy', header[1])\n if os.path.splitext(header[1])[1] == '.inc':\n continue\n d = os.path.join(*([prefix]+header[0].split('.')))\n header = header[1]\n else:\n d = self.install_dir\n self.mkpath(d)\n (out, _) = self.copy_file(header, d)\n self.outfiles.append(out)\n", + "source_code_before": "import os\nfrom distutils.command.install import *\nfrom distutils.command.install_headers import install_headers as old_install_headers\n\nclass install_headers (old_install_headers):\n\n def run (self):\n headers = self.distribution.headers\n if not headers:\n return\n\n prefix = os.path.dirname(self.install_dir)\n for header in headers:\n if isinstance(header,tuple):\n # Kind of a hack, but I don't know where else to change this...\n if header[0] == 'numpy.base':\n header = ('numpy', header[1])\n if os.path.splitext(header[1])[1] == '.inc':\n continue\n d = os.path.join(*([prefix]+header[0].split('.')))\n header = header[1]\n else:\n d = self.install_dir\n self.mkpath(d)\n (out, _) = self.copy_file(header, d)\n self.outfiles.append(out)\n", + "methods": [ + { + "name": "run", + "long_name": "run( self )", + "filename": "install_headers.py", + "nloc": 18, + "complexity": 6, + "token_count": 145, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "run", + "long_name": "run( self )", + "filename": "install_headers.py", + "nloc": 18, + "complexity": 6, + "token_count": 145, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "run", + "long_name": "run( self )", + "filename": "install_headers.py", + "nloc": 18, + "complexity": 6, + "token_count": 145, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + } + ], + "nloc": 22, + "complexity": 6, + "token_count": 172, + "diff_parsed": { + "added": [ + " if header[0] == 'numpy.core':" + ], + "deleted": [ + " if header[0] == 'numpy.base':" + ] + } + }, + { + "old_path": "numpy/distutils/tests/f2py_ext/tests/test_fib2.py", + "new_path": "numpy/distutils/tests/f2py_ext/tests/test_fib2.py", + "filename": "test_fib2.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n import sys\n-from numpy.base.testing import *\n+from numpy.testing import *\n set_package_path()\n from f2py_ext import fib2\n del sys.path[0]\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import sys\nfrom numpy.testing import *\nset_package_path()\nfrom f2py_ext import fib2\ndel sys.path[0]\n\nclass test_fib2(ScipyTestCase):\n\n def check_fib(self):\n assert_array_equal(fib2.fib(6),[0,1,1,2,3,5])\n\nif __name__ == \"__main__\":\n ScipyTest(fib2).run()\n", + "source_code_before": "import sys\nfrom numpy.base.testing import *\nset_package_path()\nfrom f2py_ext import fib2\ndel sys.path[0]\n\nclass test_fib2(ScipyTestCase):\n\n def check_fib(self):\n assert_array_equal(fib2.fib(6),[0,1,1,2,3,5])\n\nif __name__ == \"__main__\":\n ScipyTest(fib2).run()\n", + "methods": [ + { + "name": "check_fib", + "long_name": "check_fib( self )", + "filename": "test_fib2.py", + "nloc": 2, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "check_fib", + "long_name": "check_fib( self )", + "filename": "test_fib2.py", + "nloc": 2, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 10, + "complexity": 1, + "token_count": 70, + "diff_parsed": { + "added": [ + "from numpy.testing import *" + ], + "deleted": [ + "from numpy.base.testing import *" + ] + } + }, + { + "old_path": "numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py", + "new_path": "numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py", + "filename": "test_foo.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n import sys\n-from numpy.base.testing import *\n+from numpy.testing import *\n set_package_path()\n from f2py_f90_ext import foo\n del sys.path[0]\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import sys\nfrom numpy.testing import *\nset_package_path()\nfrom f2py_f90_ext import foo\ndel sys.path[0]\n\nclass test_foo(ScipyTestCase):\n\n def check_foo_free(self):\n assert_equal(foo.foo_free.bar13(),13)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "import sys\nfrom numpy.base.testing import *\nset_package_path()\nfrom f2py_f90_ext import foo\ndel sys.path[0]\n\nclass test_foo(ScipyTestCase):\n\n def check_foo_free(self):\n assert_equal(foo.foo_free.bar13(),13)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "check_foo_free", + "long_name": "check_foo_free( self )", + "filename": "test_foo.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "check_foo_free", + "long_name": "check_foo_free( self )", + "filename": "test_foo.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 10, + "complexity": 1, + "token_count": 58, + "diff_parsed": { + "added": [ + "from numpy.testing import *" + ], + "deleted": [ + "from numpy.base.testing import *" + ] + } + }, + { + "old_path": "numpy/distutils/tests/gen_ext/tests/test_fib3.py", + "new_path": "numpy/distutils/tests/gen_ext/tests/test_fib3.py", + "filename": "test_fib3.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n import sys\n-from numpy.base.testing import *\n+from numpy.testing import *\n set_package_path()\n from gen_ext import fib3\n del sys.path[0]\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import sys\nfrom numpy.testing import *\nset_package_path()\nfrom gen_ext import fib3\ndel sys.path[0]\n\nclass test_fib3(ScipyTestCase):\n\n def check_fib(self):\n assert_array_equal(fib3.fib(6),[0,1,1,2,3,5])\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "import sys\nfrom numpy.base.testing import *\nset_package_path()\nfrom gen_ext import fib3\ndel sys.path[0]\n\nclass test_fib3(ScipyTestCase):\n\n def check_fib(self):\n assert_array_equal(fib3.fib(6),[0,1,1,2,3,5])\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "check_fib", + "long_name": "check_fib( self )", + "filename": "test_fib3.py", + "nloc": 2, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "check_fib", + "long_name": "check_fib( self )", + "filename": "test_fib3.py", + "nloc": 2, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 10, + "complexity": 1, + "token_count": 69, + "diff_parsed": { + "added": [ + "from numpy.testing import *" + ], + "deleted": [ + "from numpy.base.testing import *" + ] + } + }, + { + "old_path": "numpy/distutils/tests/swig_ext/tests/test_example.py", + "new_path": "numpy/distutils/tests/swig_ext/tests/test_example.py", + "filename": "test_example.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n import sys\n-from numpy.base.testing import *\n+from numpy.testing import *\n set_package_path()\n from swig_ext import example\n del sys.path[0]\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import sys\nfrom numpy.testing import *\nset_package_path()\nfrom swig_ext import example\ndel sys.path[0]\n\nclass test_example(ScipyTestCase):\n\n def check_fact(self):\n assert_equal(example.fact(10),3628800)\n\n def check_cvar(self):\n assert_equal(example.cvar.My_variable,3.0)\n example.cvar.My_variable = 5\n assert_equal(example.cvar.My_variable,5.0)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "import sys\nfrom numpy.base.testing import *\nset_package_path()\nfrom swig_ext import example\ndel sys.path[0]\n\nclass test_example(ScipyTestCase):\n\n def check_fact(self):\n assert_equal(example.fact(10),3628800)\n\n def check_cvar(self):\n assert_equal(example.cvar.My_variable,3.0)\n example.cvar.My_variable = 5\n assert_equal(example.cvar.My_variable,5.0)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "check_fact", + "long_name": "check_fact( self )", + "filename": "test_example.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_cvar", + "long_name": "check_cvar( self )", + "filename": "test_example.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 12, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "check_fact", + "long_name": "check_fact( self )", + "filename": "test_example.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 10, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_cvar", + "long_name": "check_cvar( self )", + "filename": "test_example.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 12, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 14, + "complexity": 2, + "token_count": 94, + "diff_parsed": { + "added": [ + "from numpy.testing import *" + ], + "deleted": [ + "from numpy.base.testing import *" + ] + } + }, + { + "old_path": "numpy/doc/DISTUTILS.txt", + "new_path": "numpy/doc/DISTUTILS.txt", + "filename": "DISTUTILS.txt", + "extension": "txt", + "change_type": "MODIFY", + "diff": "@@ -1,6 +1,6 @@\n .. -*- rest -*-\n \n-SciPy Distutils - Users Guide\n+NumPy Distutils - Users Guide\n =============================\n \n :Author: Pearu Peterson \n@@ -18,8 +18,8 @@ Currently SciPy project consists of two packages:\n \n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n- + numpy.weave - a tool to bind C++ codes to Python\n- + numpy.base - future replacement of Numeric and numarray packages\n+ + numpy.core - future replacement of Numeric and numarray packages\n+ + numpy.lib - extra utility functions\n + numpy.testing - numpy-style tools for unit testing\n + etc\n \n", + "added_lines": 3, + "deleted_lines": 3, + "source_code": ".. -*- rest -*-\n\nNumPy Distutils - Users Guide\n=============================\n\n:Author: Pearu Peterson \n:Discussions to: scipy-dev@scipy.org\n:Created: October 2005\n:Revision: $LastChangedRevision$\n:SVN source: $HeadURL$\n\nSciPy structure\n'''''''''''''''\n\nCurrently SciPy project consists of two packages:\n\n- NumPy (previously called SciPy core) --- it provides packages like:\n\n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n + numpy.core - future replacement of Numeric and numarray packages\n + numpy.lib - extra utility functions\n + numpy.testing - numpy-style tools for unit testing\n + etc\n\n- SciPy --- a collection of scientific tools for Python.\n\nThe aim of this document is to describe how to add new tools to SciPy.\n\n\nRequirements for SciPy packages\n'''''''''''''''''''''''''''''''\n\nSciPy consists of Python packages, called SciPy packages, that are\navailable to Python users via ``scipy`` name space. Each SciPy package\nmay contain other SciPy packages. And so on. So, SciPy directory tree\nis a tree of packages with arbitrary depth and width. Any SciPy\npackage may depend on NumPy packages but the dependence on other\nSciPy packages should be kept minimal or zero.\n\nA SciPy package contains in addition to its sources, the following\nfiles and directories:\n\n ``setup.py`` --- building script\n ``info.py`` --- contains documentation and import flags\n ``__init__.py`` --- package initializer\n ``tests/`` --- directory of unittests\n\nTheir contents will be described below.\n\nThe ``setup.py`` file\n'''''''''''''''''''''\n\nIn order to add a Python package to SciPy, its building script (the\n``setup.py`` file) must meet certain requirements. The minimal and the\nmost important one is that it must define a function\n``configuration(parent_package='',top_path=None)`` that returns a\ndictionary suitable for passing to ``numpy.distutils.core.setup(..)``\nfunction. In order to simplify the construction of such an distionary,\n``numpy.distutils.misc_util`` provides a class ``Configuration``, the\nusage of will be described below.\n\nSciPy pure Python package example\n---------------------------------\n\nHere follows a minimal example for a pure Python SciPy package\n``setup.py`` file that will be explained in detail below::\n\n #!/usr/bin/env python\n def configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('mypackage',parent_package,top_path)\n return config\n\n if __name__ == \"__main__\":\n from numpy.distutils.core import setup\n setup(**configuration(top_path='').todict())\n\nThe first argument ``parent_package`` of the main configuration\nfunction will contain a name of the parent SciPy package and the\nsecond argument ``top_path`` contains the name of the directory where\nthe main ``setup.py`` script is located. Both arguments should be\npassed to the ``Configuration`` constructor after the name of the\ncurrent package.\n\nThe ``Configuration`` constructor has also fourth optional argument,\n``package_path``, that can be used when package files are located in\nsome other location than the directory of the ``setup.py`` file. \n\nRemaining ``Configuration`` arguments are all keyword arguments that will\nbe used to initialize attributes of ``Configuration``\ninstance. Usually, these keywords are the same as the ones that\n``setup(..)`` function would expect, for example, ``packages``,\n``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``,\n``headers``, ``scripts``, ``package_dir``, etc. However, the direct\nspecification of these keywords is not recommended as the content of\nthese keyword arguments will not be processed or checked for the\nconsistency of SciPy building system.\n\nFinally, ``Configuration`` has ``.todict()`` method that returns all\nthe configuration data as a dictionary suitable for passing on to the\n``setup(..)`` function.\n\n``Configuration`` instance attributes\n-------------------------------------\n\nIn addition to attributes that can be specified via keyword arguments\nto ``Configuration`` constructor, ``Configuration`` instance (let us\ndenote as ``config``) has the following attributes that can be useful\nin writing setup scripts:\n\n+ ``config.name`` - full name of the current package. The names of parent\n packages can be extracted as ``config.name.split('.')``.\n\n+ ``config.local_path`` - path to the location of current ``setup.py`` file.\n\n+ ``config.top_path`` - path to the location of main ``setup.py`` file.\n\n``Configuration`` instance methods\n----------------------------------\n\n+ ``config.todict()`` --- returns configuration distionary suitable for\n passing to ``numpy.distutils.core.setup(..)`` function.\n\n+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of\n ``paths`` if necessary. Fixes ``paths`` item that is relative to\n ``config.local_path``.\n\n+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---\n returns SciPy subpackage configuration. Subpackage is looked in the\n current directory under the name ``subpackage_name`` but the path\n can be specified also via optional ``subpackage_path`` argument.\n If ``subpackage_name`` is specified as ``None`` then the subpackage\n name will be taken the basename of ``subpackage_path``.\n\n+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---\n add SciPy subpackage configuration to the current one. The meaning\n and usage of arguments is explained above, see\n ``config.get_subpackage()`` method.\n\n+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files``\n list. If ``files`` item is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data\n files. By default data files are copied under package installation\n directory. For example,\n\n ::\n\n config.add_data_files('foo.dat',\n ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']),\n 'bar/car.dat'.\n '/full/path/to/can.dat',\n )\n\n will install data files to the following locations::\n\n /\n foo.dat\n fun/\n gun.dat\n nun/\n pun.dat\n sun.dat\n bar/\n car.dat\n can.dat \n\n Path to data files can be a function taking no arguments and\n returning path(s) to data files -- this is a useful when data files\n are generated while building the package. (XXX: explain the step\n when this function are called exactly) \n\n+ ``config.add_data_dir(data_path)`` --- add directory ``data_path``\n recursively to ``data_files``. The whole directory tree starting at\n ``data_path`` will be copied under package installation directory.\n If ``data_path`` is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data directory.\n By default data directory are copied under package installation\n directory. For example,\n \n ::\n\n config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat\n config.add_data_dir(('sun','fun'))\n config.add_data_dir(('gun','/full/path/to/fun'))\n\n will install data files to the following locations \n\n /\n fun/\n foo.dat\n bar/\n car.dat\n sun/\n foo.dat\n bar/\n car.dat\n gun/\n foo.dat\n car.dat\n\n+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to\n ``include_dirs`` list. This list will be visible to all extension\n modules of the current package.\n\n+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers``\n list. By default, headers will be installed under \n ``/include/pythonX.X//``\n directory. If ``files`` item is a tuple then it's first argument\n specifies the installation suffix relative to\n ``/include/pythonX.X/`` path.\n\n+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts``\n list. Scripts will be installed under ``/bin/`` directory.\n\n+ ``config.add_extension(name,sources,*kw)`` --- create and add an\n ``Extension`` instance to ``ext_modules`` list. The first argument \n ``name`` defines the name of the extension module that will be\n installed under ``config.name`` package. The second argument is\n a list of sources. ``add_extension`` method takes also keyword\n arguments that are passed on to the ``Extension`` constructor.\n The list of allowed keywords is the following: ``include_dirs``,\n ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``,\n ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``,\n ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``,\n ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``.\n\n Note that ``config.paths`` method is applied to all lists that\n may contain paths. ``extra_info`` is a dictionary or a list\n of dictionaries that content will be appended to keyword arguments.\n The list ``depends`` contains paths to files or directories\n that the sources of the extension module depend on. If any path\n in the ``depends`` list is newer than the extension module, then\n the module will be rebuilt.\n\n The list of sources may contain functions ('source generators')\n with a pattern ``def (ext, build_dir): return\n ``. If ``funcname`` returns ``None``, no sources\n are generated. And if the ``Extension`` instance has no sources\n after processing all source generators, no extension module will\n be built. This is the recommended way to conditionally define\n extension modules. Source generator functions are called by the\n ``build_src`` command of ``numpy.distutils``.\n\n For example, here is a typical source generator function::\n\n def generate_source(ext,build_dir):\n import os\n from distutils.dep_util import newer\n target = os.path.join(build_dir,'somesource.c')\n if newer(target,__file__):\n # create target file\n return target\n\n The first argument contains the Extension instance that can be\n useful to access its attributes like ``depends``, ``sources``,\n etc. lists and modify them during the building process.\n The second argument gives a path to a build directory that must\n be used when creating files to a disk.\n\n+ ``config.add_library(name, sources, **build_info)`` --- add\n a library to ``libraries`` list. Allowed keywords arguments\n are ``depends``, ``macros``, ``include_dirs``,\n ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()``\n method for more information on arguments.\n\n+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is\n available (read: a simple Fortran 77 code compiled succesfully). \n\n+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is\n available (read: a simple Fortran 90 code compiled succesfully). \n\n+ ``config.get_version()`` --- return version string of the current package,\n ``None`` if version information could not be detected. This methods\n scans files ``__version__.py``, ``_version.py``,\n ``version.py``, ``__svn_version__.py`` for string variables\n ``version``, ``__version__``, ``_version``.\n\n+ ``config.make_svn_version_py()`` --- appends a data function to\n ``data_files`` list that will generate ``__svn_version__.py`` file\n to the current package directory. The file will be removed from\n the source directory when Python exits.\n\n+ ``config.get_build_temp_dir()`` --- return a path to a temporary\n directory. This is the place where one should build temporary\n files.\n\n+ ``config.get_distribution()`` --- return distutils ``Distribution``\n instance.\n\n+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config\n command instance.\n\nTemplate files\n--------------\n\nXXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,\n``.c.src``, etc. are pre-processed by the ``build_src`` command.\n\nUseful functions in ``numpy.distutils.misc_util``\n-------------------------------------------------\n\n+ ``get_numpy_include_dirs()`` --- return a list of NumPy base\n include directories. NumPy base include directories contain\n header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``\n etc. For installed NumPy the returned list has length 1\n but when building NumPy the list may contain more directories,\n for example, a path to ``config.h`` file that\n ``numpy/base/setup.py`` file generates and is used by ``numpy``\n header files.\n\n+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``.\n\n+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils``\n command instance.\n\n+ ``all_strings(lst)``\n\n+ ``has_f_sources(sources)``\n\n+ ``has_cxx_sources(sources)``\n\n+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources,\n f_sources, fmodule_sources``\n\n+ ``get_dependencies(sources)``\n\n+ ``is_local_src_dir(directory)``\n\n+ ``get_ext_source_files(ext)``\n\n+ ``get_script_files(scripts)``\n\n+ ``get_lib_source_files(lib)``\n\n+ ``get_data_files(data)``\n\n+ ``dot_join(*args)``\n\n+ ``get_frame(level=0)``\n\n+ ``cyg2win32(path)``\n\n+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``,\n ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)``\n\n+ ``get_path(mod_name,parent_path=None)``\n\n+ ``allpath(name)``\n\n+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``,\n ``f90_module_name_match``\n\n``numpy.distutils.system_info`` module\n--------------------------------------\n\n+ ``get_info(name,notfound_action=0)``\n+ ``combine_paths(*args,**kws)``\n+ ``show_all()``\n\n``numpy.distutils.cpuinfo`` module\n----------------------------------\n\n+ ``cpuinfo``\n\n``numpy.distutils.log`` module\n------------------------------\n\n+ ``set_verbosity(v)``\n\n\n``numpy.distutils.exec_command`` module\n---------------------------------------\n\n+ ``get_pythonexe()``\n+ ``splitcmdline(line)``\n+ ``find_executable(exe, path=None)``\n+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )``\n\nThe ``info.py`` file\n''''''''''''''''''''\n\nScipy package import hooks assume that each Scipy package contains\n``info.py`` file that contains overall documentation about the package\nand some variables defining the order of package imports, dependence\nrelations between packages, etc.\n\nThe following information will be looked in the ``info.py`` file:\n\n__doc__\n The documentation string of the package.\n\n__doc_title__\n The title of the package. If not defined then the first non-empty \n line of ``__doc__`` will be used.\n\n__all__\n List of symbols that package exports. Optional.\n\nglobal_symbols\n List of names that should be imported to numpy name space. To import\n all symbols to ``numpy`` namespace, define ``global_symbols=['*']``.\n\ndepends\n List of names that the package depends on. Prefix ``numpy.``\n will be automatically added to package names. For example,\n use ``testing`` to indicate dependence on ``numpy.testing``\n package. Default value is ``[]``.\n\npostpone_import\n Boolean variable indicating that importing the package should be\n postponed until the first attempt of its usage. Default value is ``False``.\n Depreciated.\n\nThe ``__init__.py`` file\n''''''''''''''''''''''''\n\nTo speed up the import time as well as to minimize memory usage, numpy\nuses ppimport hooks to transparently postpone importing large modules\nthat might not be used during the Scipy usage session. But in order to\nhave an access to the documentation of all Scipy packages, including \nof the postponed packages, the documentation string of a package (that would\nusually reside in ``__init__.py`` file) should be copied also\nto ``info.py`` file.\n\nSo, the header a typical ``__init__.py`` file is::\n\n #\n # Package ... - ...\n #\n\n from info import __doc__\n ...\n\n from numpy.testing import ScipyTest\n test = ScipyTest().test\n\nThe ``tests/`` directory\n''''''''''''''''''''''''\n\nIdeally, every Python code, extension module, or subpackage in Scipy\npackage directory should have the corresponding ``test_.py``\nfile in ``tests/`` directory. This file should define classes\nderived from ``ScipyTestCase`` (or from ``unittest.TestCase``) class\nand have names starting with ``test``. The methods of these classes\nwhich names start with ``bench``, ``check``, or ``test``, are passed\non to unittest machinery. In addition, the value of the first optional\nargument of these methods determine the level of the corresponding\ntest. Default level is 1.\n\nA minimal example of a ``test_yyy.py`` file that implements tests for\na Scipy package module ``numpy.xxx.yyy`` containing a function\n``zzz()``, is shown below::\n\n import sys\n from numpy.testing import *\n\n set_package_path()\n # import xxx symbols\n from xxx.yyy import zzz\n restore_path()\n\n #Optional:\n set_local_path()\n # import modules that are located in the same directory as this file.\n restore_path()\n\n class test_zzz(ScipyTestCase):\n def check_simple(self, level=1):\n assert zzz()=='Hello from zzz'\n #...\n\n if __name__ == \"__main__\":\n ScipyTest().run()\n\n``ScipyTestCase`` is derived from ``unittest.TestCase`` and it\nbasically only implements an additional method ``measure(self,\ncode_str, times=1)``.\n\n``numpy.testing`` module provides also the following convenience\nfunctions::\n\n assert_equal(actual,desired,err_msg='',verbose=1)\n assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)\n assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)\n assert_array_equal(x,y,err_msg='')\n assert_array_almost_equal(x,y,decimal=6,err_msg='')\n rand(*shape) # returns random array with a given shape\n\n``ScipyTest`` can be used for running ``tests/test_*.py`` scripts.\nFor instance, to run all test scripts of the module ``xxx``, execute\nin Python:\n\n >>> ScipyTest('xxx').test(level=1,verbosity=1)\n\nor equivalently,\n\n >>> import xxx\n >>> ScipyTest(xxx).test(level=1,verbosity=1)\n\nTo run only tests for ``xxx.yyy`` module, execute:\n\n >>> ScipyTest('xxx.yyy').test(level=1,verbosity=1)\n\nTo take the level and verbosity parameters for tests from\n``sys.argv``, use ``ScipyTest.run()`` method (this is supported only\nwhen ``optparse`` is installed).\n", + "source_code_before": ".. -*- rest -*-\n\nSciPy Distutils - Users Guide\n=============================\n\n:Author: Pearu Peterson \n:Discussions to: scipy-dev@scipy.org\n:Created: October 2005\n:Revision: $LastChangedRevision$\n:SVN source: $HeadURL$\n\nSciPy structure\n'''''''''''''''\n\nCurrently SciPy project consists of two packages:\n\n- NumPy (previously called SciPy core) --- it provides packages like:\n\n + numpy.distutils - extension to Python distutils\n + numpy.f2py - a tool to bind Fortran/C codes to Python\n + numpy.weave - a tool to bind C++ codes to Python\n + numpy.base - future replacement of Numeric and numarray packages\n + numpy.testing - numpy-style tools for unit testing\n + etc\n\n- SciPy --- a collection of scientific tools for Python.\n\nThe aim of this document is to describe how to add new tools to SciPy.\n\n\nRequirements for SciPy packages\n'''''''''''''''''''''''''''''''\n\nSciPy consists of Python packages, called SciPy packages, that are\navailable to Python users via ``scipy`` name space. Each SciPy package\nmay contain other SciPy packages. And so on. So, SciPy directory tree\nis a tree of packages with arbitrary depth and width. Any SciPy\npackage may depend on NumPy packages but the dependence on other\nSciPy packages should be kept minimal or zero.\n\nA SciPy package contains in addition to its sources, the following\nfiles and directories:\n\n ``setup.py`` --- building script\n ``info.py`` --- contains documentation and import flags\n ``__init__.py`` --- package initializer\n ``tests/`` --- directory of unittests\n\nTheir contents will be described below.\n\nThe ``setup.py`` file\n'''''''''''''''''''''\n\nIn order to add a Python package to SciPy, its building script (the\n``setup.py`` file) must meet certain requirements. The minimal and the\nmost important one is that it must define a function\n``configuration(parent_package='',top_path=None)`` that returns a\ndictionary suitable for passing to ``numpy.distutils.core.setup(..)``\nfunction. In order to simplify the construction of such an distionary,\n``numpy.distutils.misc_util`` provides a class ``Configuration``, the\nusage of will be described below.\n\nSciPy pure Python package example\n---------------------------------\n\nHere follows a minimal example for a pure Python SciPy package\n``setup.py`` file that will be explained in detail below::\n\n #!/usr/bin/env python\n def configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('mypackage',parent_package,top_path)\n return config\n\n if __name__ == \"__main__\":\n from numpy.distutils.core import setup\n setup(**configuration(top_path='').todict())\n\nThe first argument ``parent_package`` of the main configuration\nfunction will contain a name of the parent SciPy package and the\nsecond argument ``top_path`` contains the name of the directory where\nthe main ``setup.py`` script is located. Both arguments should be\npassed to the ``Configuration`` constructor after the name of the\ncurrent package.\n\nThe ``Configuration`` constructor has also fourth optional argument,\n``package_path``, that can be used when package files are located in\nsome other location than the directory of the ``setup.py`` file. \n\nRemaining ``Configuration`` arguments are all keyword arguments that will\nbe used to initialize attributes of ``Configuration``\ninstance. Usually, these keywords are the same as the ones that\n``setup(..)`` function would expect, for example, ``packages``,\n``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``,\n``headers``, ``scripts``, ``package_dir``, etc. However, the direct\nspecification of these keywords is not recommended as the content of\nthese keyword arguments will not be processed or checked for the\nconsistency of SciPy building system.\n\nFinally, ``Configuration`` has ``.todict()`` method that returns all\nthe configuration data as a dictionary suitable for passing on to the\n``setup(..)`` function.\n\n``Configuration`` instance attributes\n-------------------------------------\n\nIn addition to attributes that can be specified via keyword arguments\nto ``Configuration`` constructor, ``Configuration`` instance (let us\ndenote as ``config``) has the following attributes that can be useful\nin writing setup scripts:\n\n+ ``config.name`` - full name of the current package. The names of parent\n packages can be extracted as ``config.name.split('.')``.\n\n+ ``config.local_path`` - path to the location of current ``setup.py`` file.\n\n+ ``config.top_path`` - path to the location of main ``setup.py`` file.\n\n``Configuration`` instance methods\n----------------------------------\n\n+ ``config.todict()`` --- returns configuration distionary suitable for\n passing to ``numpy.distutils.core.setup(..)`` function.\n\n+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of\n ``paths`` if necessary. Fixes ``paths`` item that is relative to\n ``config.local_path``.\n\n+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` ---\n returns SciPy subpackage configuration. Subpackage is looked in the\n current directory under the name ``subpackage_name`` but the path\n can be specified also via optional ``subpackage_path`` argument.\n If ``subpackage_name`` is specified as ``None`` then the subpackage\n name will be taken the basename of ``subpackage_path``.\n\n+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` ---\n add SciPy subpackage configuration to the current one. The meaning\n and usage of arguments is explained above, see\n ``config.get_subpackage()`` method.\n\n+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files``\n list. If ``files`` item is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data\n files. By default data files are copied under package installation\n directory. For example,\n\n ::\n\n config.add_data_files('foo.dat',\n ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']),\n 'bar/car.dat'.\n '/full/path/to/can.dat',\n )\n\n will install data files to the following locations::\n\n /\n foo.dat\n fun/\n gun.dat\n nun/\n pun.dat\n sun.dat\n bar/\n car.dat\n can.dat \n\n Path to data files can be a function taking no arguments and\n returning path(s) to data files -- this is a useful when data files\n are generated while building the package. (XXX: explain the step\n when this function are called exactly) \n\n+ ``config.add_data_dir(data_path)`` --- add directory ``data_path``\n recursively to ``data_files``. The whole directory tree starting at\n ``data_path`` will be copied under package installation directory.\n If ``data_path`` is a tuple then its first element defines\n the suffix of where data files are copied relative to package installation\n directory and the second element specifies the path to data directory.\n By default data directory are copied under package installation\n directory. For example,\n \n ::\n\n config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat\n config.add_data_dir(('sun','fun'))\n config.add_data_dir(('gun','/full/path/to/fun'))\n\n will install data files to the following locations \n\n /\n fun/\n foo.dat\n bar/\n car.dat\n sun/\n foo.dat\n bar/\n car.dat\n gun/\n foo.dat\n car.dat\n\n+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to\n ``include_dirs`` list. This list will be visible to all extension\n modules of the current package.\n\n+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers``\n list. By default, headers will be installed under \n ``/include/pythonX.X//``\n directory. If ``files`` item is a tuple then it's first argument\n specifies the installation suffix relative to\n ``/include/pythonX.X/`` path.\n\n+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts``\n list. Scripts will be installed under ``/bin/`` directory.\n\n+ ``config.add_extension(name,sources,*kw)`` --- create and add an\n ``Extension`` instance to ``ext_modules`` list. The first argument \n ``name`` defines the name of the extension module that will be\n installed under ``config.name`` package. The second argument is\n a list of sources. ``add_extension`` method takes also keyword\n arguments that are passed on to the ``Extension`` constructor.\n The list of allowed keywords is the following: ``include_dirs``,\n ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``,\n ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``,\n ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``,\n ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``.\n\n Note that ``config.paths`` method is applied to all lists that\n may contain paths. ``extra_info`` is a dictionary or a list\n of dictionaries that content will be appended to keyword arguments.\n The list ``depends`` contains paths to files or directories\n that the sources of the extension module depend on. If any path\n in the ``depends`` list is newer than the extension module, then\n the module will be rebuilt.\n\n The list of sources may contain functions ('source generators')\n with a pattern ``def (ext, build_dir): return\n ``. If ``funcname`` returns ``None``, no sources\n are generated. And if the ``Extension`` instance has no sources\n after processing all source generators, no extension module will\n be built. This is the recommended way to conditionally define\n extension modules. Source generator functions are called by the\n ``build_src`` command of ``numpy.distutils``.\n\n For example, here is a typical source generator function::\n\n def generate_source(ext,build_dir):\n import os\n from distutils.dep_util import newer\n target = os.path.join(build_dir,'somesource.c')\n if newer(target,__file__):\n # create target file\n return target\n\n The first argument contains the Extension instance that can be\n useful to access its attributes like ``depends``, ``sources``,\n etc. lists and modify them during the building process.\n The second argument gives a path to a build directory that must\n be used when creating files to a disk.\n\n+ ``config.add_library(name, sources, **build_info)`` --- add\n a library to ``libraries`` list. Allowed keywords arguments\n are ``depends``, ``macros``, ``include_dirs``,\n ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()``\n method for more information on arguments.\n\n+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is\n available (read: a simple Fortran 77 code compiled succesfully). \n\n+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is\n available (read: a simple Fortran 90 code compiled succesfully). \n\n+ ``config.get_version()`` --- return version string of the current package,\n ``None`` if version information could not be detected. This methods\n scans files ``__version__.py``, ``_version.py``,\n ``version.py``, ``__svn_version__.py`` for string variables\n ``version``, ``__version__``, ``_version``.\n\n+ ``config.make_svn_version_py()`` --- appends a data function to\n ``data_files`` list that will generate ``__svn_version__.py`` file\n to the current package directory. The file will be removed from\n the source directory when Python exits.\n\n+ ``config.get_build_temp_dir()`` --- return a path to a temporary\n directory. This is the place where one should build temporary\n files.\n\n+ ``config.get_distribution()`` --- return distutils ``Distribution``\n instance.\n\n+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config\n command instance.\n\nTemplate files\n--------------\n\nXXX: Describe how files with extensions ``.f.src``, ``.pyf.src``,\n``.c.src``, etc. are pre-processed by the ``build_src`` command.\n\nUseful functions in ``numpy.distutils.misc_util``\n-------------------------------------------------\n\n+ ``get_numpy_include_dirs()`` --- return a list of NumPy base\n include directories. NumPy base include directories contain\n header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h``\n etc. For installed NumPy the returned list has length 1\n but when building NumPy the list may contain more directories,\n for example, a path to ``config.h`` file that\n ``numpy/base/setup.py`` file generates and is used by ``numpy``\n header files.\n\n+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``.\n\n+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils``\n command instance.\n\n+ ``all_strings(lst)``\n\n+ ``has_f_sources(sources)``\n\n+ ``has_cxx_sources(sources)``\n\n+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources,\n f_sources, fmodule_sources``\n\n+ ``get_dependencies(sources)``\n\n+ ``is_local_src_dir(directory)``\n\n+ ``get_ext_source_files(ext)``\n\n+ ``get_script_files(scripts)``\n\n+ ``get_lib_source_files(lib)``\n\n+ ``get_data_files(data)``\n\n+ ``dot_join(*args)``\n\n+ ``get_frame(level=0)``\n\n+ ``cyg2win32(path)``\n\n+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``,\n ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)``\n\n+ ``get_path(mod_name,parent_path=None)``\n\n+ ``allpath(name)``\n\n+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``,\n ``f90_module_name_match``\n\n``numpy.distutils.system_info`` module\n--------------------------------------\n\n+ ``get_info(name,notfound_action=0)``\n+ ``combine_paths(*args,**kws)``\n+ ``show_all()``\n\n``numpy.distutils.cpuinfo`` module\n----------------------------------\n\n+ ``cpuinfo``\n\n``numpy.distutils.log`` module\n------------------------------\n\n+ ``set_verbosity(v)``\n\n\n``numpy.distutils.exec_command`` module\n---------------------------------------\n\n+ ``get_pythonexe()``\n+ ``splitcmdline(line)``\n+ ``find_executable(exe, path=None)``\n+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )``\n\nThe ``info.py`` file\n''''''''''''''''''''\n\nScipy package import hooks assume that each Scipy package contains\n``info.py`` file that contains overall documentation about the package\nand some variables defining the order of package imports, dependence\nrelations between packages, etc.\n\nThe following information will be looked in the ``info.py`` file:\n\n__doc__\n The documentation string of the package.\n\n__doc_title__\n The title of the package. If not defined then the first non-empty \n line of ``__doc__`` will be used.\n\n__all__\n List of symbols that package exports. Optional.\n\nglobal_symbols\n List of names that should be imported to numpy name space. To import\n all symbols to ``numpy`` namespace, define ``global_symbols=['*']``.\n\ndepends\n List of names that the package depends on. Prefix ``numpy.``\n will be automatically added to package names. For example,\n use ``testing`` to indicate dependence on ``numpy.testing``\n package. Default value is ``[]``.\n\npostpone_import\n Boolean variable indicating that importing the package should be\n postponed until the first attempt of its usage. Default value is ``False``.\n Depreciated.\n\nThe ``__init__.py`` file\n''''''''''''''''''''''''\n\nTo speed up the import time as well as to minimize memory usage, numpy\nuses ppimport hooks to transparently postpone importing large modules\nthat might not be used during the Scipy usage session. But in order to\nhave an access to the documentation of all Scipy packages, including \nof the postponed packages, the documentation string of a package (that would\nusually reside in ``__init__.py`` file) should be copied also\nto ``info.py`` file.\n\nSo, the header a typical ``__init__.py`` file is::\n\n #\n # Package ... - ...\n #\n\n from info import __doc__\n ...\n\n from numpy.testing import ScipyTest\n test = ScipyTest().test\n\nThe ``tests/`` directory\n''''''''''''''''''''''''\n\nIdeally, every Python code, extension module, or subpackage in Scipy\npackage directory should have the corresponding ``test_.py``\nfile in ``tests/`` directory. This file should define classes\nderived from ``ScipyTestCase`` (or from ``unittest.TestCase``) class\nand have names starting with ``test``. The methods of these classes\nwhich names start with ``bench``, ``check``, or ``test``, are passed\non to unittest machinery. In addition, the value of the first optional\nargument of these methods determine the level of the corresponding\ntest. Default level is 1.\n\nA minimal example of a ``test_yyy.py`` file that implements tests for\na Scipy package module ``numpy.xxx.yyy`` containing a function\n``zzz()``, is shown below::\n\n import sys\n from numpy.testing import *\n\n set_package_path()\n # import xxx symbols\n from xxx.yyy import zzz\n restore_path()\n\n #Optional:\n set_local_path()\n # import modules that are located in the same directory as this file.\n restore_path()\n\n class test_zzz(ScipyTestCase):\n def check_simple(self, level=1):\n assert zzz()=='Hello from zzz'\n #...\n\n if __name__ == \"__main__\":\n ScipyTest().run()\n\n``ScipyTestCase`` is derived from ``unittest.TestCase`` and it\nbasically only implements an additional method ``measure(self,\ncode_str, times=1)``.\n\n``numpy.testing`` module provides also the following convenience\nfunctions::\n\n assert_equal(actual,desired,err_msg='',verbose=1)\n assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)\n assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)\n assert_array_equal(x,y,err_msg='')\n assert_array_almost_equal(x,y,decimal=6,err_msg='')\n rand(*shape) # returns random array with a given shape\n\n``ScipyTest`` can be used for running ``tests/test_*.py`` scripts.\nFor instance, to run all test scripts of the module ``xxx``, execute\nin Python:\n\n >>> ScipyTest('xxx').test(level=1,verbosity=1)\n\nor equivalently,\n\n >>> import xxx\n >>> ScipyTest(xxx).test(level=1,verbosity=1)\n\nTo run only tests for ``xxx.yyy`` module, execute:\n\n >>> ScipyTest('xxx.yyy').test(level=1,verbosity=1)\n\nTo take the level and verbosity parameters for tests from\n``sys.argv``, use ``ScipyTest.run()`` method (this is supported only\nwhen ``optparse`` is installed).\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "NumPy Distutils - Users Guide", + " + numpy.core - future replacement of Numeric and numarray packages", + " + numpy.lib - extra utility functions" + ], + "deleted": [ + "SciPy Distutils - Users Guide", + " + numpy.weave - a tool to bind C++ codes to Python", + " + numpy.base - future replacement of Numeric and numarray packages" + ] + } + }, + { + "old_path": "numpy/f2py/diagnose.py", + "new_path": "numpy/f2py/diagnose.py", + "filename": "diagnose.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -35,7 +35,7 @@ def run():\n print 'Failed to import numarray:',sys.exc_value\n has_numarray = 0\n try:\n- import numpy.base\n+ import numpy\n has_newnumpy = 1\n except ImportError:\n print 'Failed to import new numpy:', sys.exc_value\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\n\nimport os,sys,tempfile\n\ndef run_command(cmd):\n print 'Running %r:' % (cmd)\n s = os.system(cmd)\n print '------'\ndef run():\n _path = os.getcwd()\n os.chdir(tempfile.gettempdir())\n print '------'\n print 'os.name=%r' % (os.name)\n print '------'\n print 'sys.platform=%r' % (sys.platform)\n print '------'\n print 'sys.version:'\n print sys.version\n print '------'\n print 'sys.prefix:'\n print sys.prefix\n print '------'\n print 'sys.path=%r' % (':'.join(sys.path))\n print '------'\n try:\n import Numeric\n has_Numeric = 1\n except ImportError:\n print 'Failed to import Numeric:',sys.exc_value\n has_Numeric = 0\n try:\n import numarray\n has_numarray = 1\n except ImportError:\n print 'Failed to import numarray:',sys.exc_value\n has_numarray = 0\n try:\n import numpy\n has_newnumpy = 1\n except ImportError:\n print 'Failed to import new numpy:', sys.exc_value\n has_newnumpy = 0\n try:\n import f2py2e\n has_f2py2e = 1\n except ImportError:\n print 'Failed to import f2py2e:',sys.exc_value\n has_f2py2e = 0\n try:\n import numpy.distutils\n has_numpy_distutils = 2\n except ImportError:\n try:\n import numpy_distutils\n has_numpy_distutils = 1\n except ImportError:\n print 'Failed to import numpy_distutils:',sys.exc_value\n has_numpy_distutils = 0\n if has_Numeric:\n try:\n print 'Found Numeric version %r in %s' % \\\n (Numeric.__version__,Numeric.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_numarray:\n try:\n print 'Found numarray version %r in %s' % \\\n (numarray.__version__,numarray.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_newnumpy:\n try:\n print 'Found new numpy version %r in %s' % \\\n (numpy.__version__, numpy.__file__)\n except Exception,msg:\n print 'error:', msg\n print '------'\n if has_f2py2e:\n try:\n print 'Found f2py2e version %r in %s' % \\\n (f2py2e.__version__.version,f2py2e.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_numpy_distutils:\n try:\n if has_numpy_distutils==2:\n print 'Found numpy.distutils version %r in %r' % (\\\n numpy.distutils.__version__,\n numpy.distutils.__file__)\n else:\n print 'Found numpy_distutils version %r in %r' % (\\\n numpy_distutils.numpy_distutils_version.numpy_distutils_version,\n numpy_distutils.__file__)\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n try:\n if has_numpy_distutils==1:\n print 'Importing numpy_distutils.command.build_flib ...',\n import numpy_distutils.command.build_flib as build_flib\n print 'ok'\n print '------'\n try:\n print 'Checking availability of supported Fortran compilers:'\n for compiler_class in build_flib.all_compilers:\n compiler_class(verbose=1).is_available()\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n except Exception,msg:\n print 'error:',msg,'(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)'\n print '------'\n try:\n if has_numpy_distutils==2:\n print 'Importing numpy.distutils.fcompiler ...',\n import numpy.distutils.fcompiler as fcompiler\n else:\n print 'Importing numpy_distutils.fcompiler ...',\n import numpy_distutils.fcompiler as fcompiler\n print 'ok'\n print '------'\n try:\n print 'Checking availability of supported Fortran compilers:'\n fcompiler.show_fcompilers()\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n try:\n if has_numpy_distutils==2:\n print 'Importing numpy.distutils.cpuinfo ...',\n from numpy.distutils.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n else:\n try:\n print 'Importing numpy_distutils.command.cpuinfo ...',\n from numpy_distutils.command.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n except Exception,msg:\n print 'error:',msg,'(ignore it)'\n print 'Importing numpy_distutils.cpuinfo ...',\n from numpy_distutils.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n cpu = cpuinfo()\n print 'CPU information:',\n for name in dir(cpuinfo):\n if name[0]=='_' and name[1]!='_' and getattr(cpu,name[1:])():\n print name[1:],\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n os.chdir(_path)\nif __name__ == \"__main__\":\n run()\n", + "source_code_before": "#!/usr/bin/env python\n\nimport os,sys,tempfile\n\ndef run_command(cmd):\n print 'Running %r:' % (cmd)\n s = os.system(cmd)\n print '------'\ndef run():\n _path = os.getcwd()\n os.chdir(tempfile.gettempdir())\n print '------'\n print 'os.name=%r' % (os.name)\n print '------'\n print 'sys.platform=%r' % (sys.platform)\n print '------'\n print 'sys.version:'\n print sys.version\n print '------'\n print 'sys.prefix:'\n print sys.prefix\n print '------'\n print 'sys.path=%r' % (':'.join(sys.path))\n print '------'\n try:\n import Numeric\n has_Numeric = 1\n except ImportError:\n print 'Failed to import Numeric:',sys.exc_value\n has_Numeric = 0\n try:\n import numarray\n has_numarray = 1\n except ImportError:\n print 'Failed to import numarray:',sys.exc_value\n has_numarray = 0\n try:\n import numpy.base\n has_newnumpy = 1\n except ImportError:\n print 'Failed to import new numpy:', sys.exc_value\n has_newnumpy = 0\n try:\n import f2py2e\n has_f2py2e = 1\n except ImportError:\n print 'Failed to import f2py2e:',sys.exc_value\n has_f2py2e = 0\n try:\n import numpy.distutils\n has_numpy_distutils = 2\n except ImportError:\n try:\n import numpy_distutils\n has_numpy_distutils = 1\n except ImportError:\n print 'Failed to import numpy_distutils:',sys.exc_value\n has_numpy_distutils = 0\n if has_Numeric:\n try:\n print 'Found Numeric version %r in %s' % \\\n (Numeric.__version__,Numeric.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_numarray:\n try:\n print 'Found numarray version %r in %s' % \\\n (numarray.__version__,numarray.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_newnumpy:\n try:\n print 'Found new numpy version %r in %s' % \\\n (numpy.__version__, numpy.__file__)\n except Exception,msg:\n print 'error:', msg\n print '------'\n if has_f2py2e:\n try:\n print 'Found f2py2e version %r in %s' % \\\n (f2py2e.__version__.version,f2py2e.__file__)\n except Exception,msg:\n print 'error:',msg\n print '------'\n if has_numpy_distutils:\n try:\n if has_numpy_distutils==2:\n print 'Found numpy.distutils version %r in %r' % (\\\n numpy.distutils.__version__,\n numpy.distutils.__file__)\n else:\n print 'Found numpy_distutils version %r in %r' % (\\\n numpy_distutils.numpy_distutils_version.numpy_distutils_version,\n numpy_distutils.__file__)\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n try:\n if has_numpy_distutils==1:\n print 'Importing numpy_distutils.command.build_flib ...',\n import numpy_distutils.command.build_flib as build_flib\n print 'ok'\n print '------'\n try:\n print 'Checking availability of supported Fortran compilers:'\n for compiler_class in build_flib.all_compilers:\n compiler_class(verbose=1).is_available()\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n except Exception,msg:\n print 'error:',msg,'(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)'\n print '------'\n try:\n if has_numpy_distutils==2:\n print 'Importing numpy.distutils.fcompiler ...',\n import numpy.distutils.fcompiler as fcompiler\n else:\n print 'Importing numpy_distutils.fcompiler ...',\n import numpy_distutils.fcompiler as fcompiler\n print 'ok'\n print '------'\n try:\n print 'Checking availability of supported Fortran compilers:'\n fcompiler.show_fcompilers()\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n try:\n if has_numpy_distutils==2:\n print 'Importing numpy.distutils.cpuinfo ...',\n from numpy.distutils.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n else:\n try:\n print 'Importing numpy_distutils.command.cpuinfo ...',\n from numpy_distutils.command.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n except Exception,msg:\n print 'error:',msg,'(ignore it)'\n print 'Importing numpy_distutils.cpuinfo ...',\n from numpy_distutils.cpuinfo import cpuinfo\n print 'ok'\n print '------'\n cpu = cpuinfo()\n print 'CPU information:',\n for name in dir(cpuinfo):\n if name[0]=='_' and name[1]!='_' and getattr(cpu,name[1:])():\n print name[1:],\n print '------'\n except Exception,msg:\n print 'error:',msg\n print '------'\n os.chdir(_path)\nif __name__ == \"__main__\":\n run()\n", + "methods": [ + { + "name": "run_command", + "long_name": "run_command( cmd )", + "filename": "diagnose.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "cmd" + ], + "start_line": 5, + "end_line": 8, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "run", + "long_name": "run( )", + "filename": "diagnose.py", + "nloc": 156, + "complexity": 32, + "token_count": 626, + "parameters": [], + "start_line": 9, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 156, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "run_command", + "long_name": "run_command( cmd )", + "filename": "diagnose.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "cmd" + ], + "start_line": 5, + "end_line": 8, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "run", + "long_name": "run( )", + "filename": "diagnose.py", + "nloc": 156, + "complexity": 32, + "token_count": 628, + "parameters": [], + "start_line": 9, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 156, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "run", + "long_name": "run( )", + "filename": "diagnose.py", + "nloc": 156, + "complexity": 32, + "token_count": 626, + "parameters": [], + "start_line": 9, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 156, + "top_nesting_level": 0 + } + ], + "nloc": 163, + "complexity": 33, + "token_count": 663, + "diff_parsed": { + "added": [ + " import numpy" + ], + "deleted": [ + " import numpy.base" + ] + } + }, + { + "old_path": "numpy/f2py/rules.py", + "new_path": "numpy/f2py/rules.py", + "filename": "rules.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -174,7 +174,7 @@\n \\tPyFortran_Type.ob_type = &PyType_Type;\n \\timport_array();\n \\tif (PyErr_Occurred())\n-\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy.base)\\\");\n+\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy)\\\");\n \\td = PyModule_GetDict(m);\n \\ts = PyString_FromString(\\\"$R\"\"\"+\"\"\"evision: $\\\");\n \\tPyDict_SetItemString(d, \\\"__version__\\\", s);\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\n\"\"\"\n\nRules for building C/API module with f2py2e.\n\nHere is a skeleton of a new wrapper function (13Dec2001):\n\nwrapper_function(args)\n declarations\n get_python_arguments, say, `a' and `b'\n\n get_a_from_python\n if (successful) {\n\n get_b_from_python\n if (successful) {\n\n callfortran\n if (succesful) {\n\n put_a_to_python\n if (succesful) {\n\n put_b_to_python\n if (succesful) {\n\n buildvalue = ...\n\n }\n\n }\n \n }\n\n }\n cleanup_b\n\n }\n cleanup_a\n\n return buildvalue\n\"\"\"\n\"\"\"\nCopyright 1999,2000 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/08/30 08:58:42 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Revision: 1.129 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport pprint\nimport sys,string,time,types,copy\nerrmess=sys.stderr.write\noutmess=sys.stdout.write\nshow=pprint.pprint\n\nfrom auxfuncs import *\nimport capi_maps\nfrom capi_maps import *\nimport cfuncs\nimport common_rules\nimport use_rules\nimport f90mod_rules\nimport func2subr\noptions={}\n\nsepdict={}\n#for k in ['need_cfuncs']: sepdict[k]=','\nfor k in ['decl',\n 'frompyobj',\n 'cleanupfrompyobj',\n 'topyarr','method',\n 'pyobjfrom','closepyobjfrom',\n 'freemem',\n 'userincludes',\n 'includes0','includes','typedefs','typedefs_generated',\n 'cppmacros','cfuncs','callbacks',\n 'latexdoc',\n 'restdoc',\n 'routine_defs','externroutines',\n 'initf2pywraphooks',\n 'commonhooks','initcommonhooks',\n 'f90modhooks','initf90modhooks']:\n sepdict[k]='\\n'\n\n#################### Rules for C/API module #################\n\nmodule_rules={\n 'modulebody':\"\"\"\\\n/* File: #modulename#module.c\n * This file is auto-generated with f2py (version:#f2py_version#).\n * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,\n * written by Pearu Peterson .\n * See http://cens.ioc.ee/projects/f2py2e/\n * Generation date: \"\"\"+time.asctime(time.localtime(time.time()))+\"\"\"\n * $R\"\"\"+\"\"\"evision:$\n * $D\"\"\"+\"\"\"ate:$\n * Do not edit this file directly unless you know what you are doing!!!\n */\n#ifdef __cplusplus\nextern \\\"C\\\" {\n#endif\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: includes\")+\"\"\"\n#includes#\n#includes0#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: mod_rules['modulebody']\")+\"\"\"\nstatic PyObject *#modulename#_error;\nstatic PyObject *#modulename#_module;\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: typedefs\")+\"\"\"\n#typedefs#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: typedefs_generated\")+\"\"\"\n#typedefs_generated#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: cppmacros\")+\"\"\"\n#cppmacros#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: cfuncs\")+\"\"\"\n#cfuncs#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: userincludes\")+\"\"\"\n#userincludes#\n\n\"\"\"+gentitle(\"See f2py2e/capi_rules.py: usercode\")+\"\"\"\n#usercode#\n\n/* See f2py2e/rules.py */\n#externroutines#\n\n\"\"\"+gentitle(\"See f2py2e/capi_rules.py: usercode1\")+\"\"\"\n#usercode1#\n\n\"\"\"+gentitle(\"See f2py2e/cb_rules.py: buildcallback\")+\"\"\"\n#callbacks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: buildapi\")+\"\"\"\n#body#\n\n\"\"\"+gentitle(\"See f2py2e/f90mod_rules.py: buildhooks\")+\"\"\"\n#f90modhooks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: module_rules['modulebody']\")+\"\"\"\n\n\"\"\"+gentitle(\"See f2py2e/common_rules.py: buildhooks\")+\"\"\"\n#commonhooks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py\")+\"\"\"\n\nstatic FortranDataDef f2py_routine_defs[] = {\n#routine_defs#\n\\t{NULL}\n};\n\nstatic PyMethodDef f2py_module_methods[] = {\n#pymethoddef#\n\\t{NULL,NULL}\n};\n\nDL_EXPORT(void) init#modulename#(void) {\n\\tint i;\n\\tPyObject *m,*d, *s;\n\\tm = #modulename#_module = Py_InitModule(\\\"#modulename#\\\", f2py_module_methods);\n\\tPyFortran_Type.ob_type = &PyType_Type;\n\\timport_array();\n\\tif (PyErr_Occurred())\n\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy)\\\");\n\\td = PyModule_GetDict(m);\n\\ts = PyString_FromString(\\\"$R\"\"\"+\"\"\"evision: $\\\");\n\\tPyDict_SetItemString(d, \\\"__version__\\\", s);\n\\ts = PyString_FromString(\\\"This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\\\\nFunctions:\\\\n\\\"\\n#docs#\\\".\\\");\n\\tPyDict_SetItemString(d, \\\"__doc__\\\", s);\n\\t#modulename#_error = PyErr_NewException (\\\"#modulename#.error\\\", NULL, NULL);\n\\tPy_DECREF(s);\n\\tfor(i=0;f2py_routine_defs[i].name!=NULL;i++)\n\\t\\tPyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));\n#initf2pywraphooks#\n#initf90modhooks#\n#initcommonhooks#\n#interface_usercode#\n\\tif (PyErr_Occurred())\n\\t\\tPy_FatalError(\\\"can't initialize module #modulename#\\\");\n\n#ifdef F2PY_REPORT_ATEXIT\n\\ton_exit(f2py_report_on_exit,(void*)\\\"#modulename#\\\");\n#endif\n\n}\n#ifdef __cplusplus\n}\n#endif\n\"\"\",\n 'separatorsfor':{'latexdoc':'\\n\\n',\n 'restdoc':'\\n\\n'},\n 'latexdoc':['\\\\section{Module \\\\texttt{#texmodulename#}}\\n',\n '#modnote#\\n',\n '#latexdoc#'],\n 'restdoc':['Module #modulename#\\n'+'='*80,\n '\\n#restdoc#']\n }\n\ndefmod_rules=[\n {'body':'/*eof body*/',\n 'method':'/*eof method*/',\n 'externroutines':'/*eof externroutines*/',\n 'routine_defs':'/*eof routine_defs*/',\n 'initf90modhooks':'/*eof initf90modhooks*/',\n 'initf2pywraphooks':'/*eof initf2pywraphooks*/',\n 'initcommonhooks':'/*eof initcommonhooks*/',\n 'latexdoc':'',\n 'restdoc':'',\n 'modnote':{hasnote:'#note#',l_not(hasnote):''},\n }\n ]\n\nroutine_rules={\n 'separatorsfor':sepdict,\n 'body':\"\"\"\n#begintitle#\nstatic char doc_#apiname#[] = \\\"\\\\\\nFunction signature:\\\\n\\\\\\n\\t#docreturn##name#(#docsignatureshort#)\\\\n\\\\\\n#docstrsigns#\\\";\n/* #declfortranroutine# */\nstatic PyObject *#apiname#(const PyObject *capi_self,\n PyObject *capi_args,\n PyObject *capi_keywds,\n #functype# (*f2py_func)(#callprotoargument#)) {\n\\tPyObject * volatile capi_buildvalue = NULL;\n\\tvolatile int f2py_success = 1;\n#decl#\n\\tstatic char *capi_kwlist[] = {#kwlist##kwlistopt##kwlistxa#NULL};\n#usercode#\n#routdebugenter#\n#ifdef F2PY_REPORT_ATEXIT\nf2py_start_clock();\n#endif\n\\tif (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\\\\\n\\t\\t\\\"#argformat#|#keyformat##xaformat#:#pyname#\\\",\\\\\n\\t\\tcapi_kwlist#args_capi##keys_capi##keys_xa#))\\n\\t\\treturn NULL;\n#frompyobj#\n/*end of frompyobj*/\n#ifdef F2PY_REPORT_ATEXIT\nf2py_start_call_clock();\n#endif\n#callfortranroutine#\nif (PyErr_Occurred())\n f2py_success = 0;\n#ifdef F2PY_REPORT_ATEXIT\nf2py_stop_call_clock();\n#endif\n/*end of callfortranroutine*/\n\\t\\tif (f2py_success) {\n#pyobjfrom#\n/*end of pyobjfrom*/\n\\t\\tCFUNCSMESS(\\\"Building return value.\\\\n\\\");\n\\t\\tcapi_buildvalue = Py_BuildValue(\\\"#returnformat#\\\"#return#);\n/*closepyobjfrom*/\n#closepyobjfrom#\n\\t\\t} /*if (f2py_success) after callfortranroutine*/\n/*cleanupfrompyobj*/\n#cleanupfrompyobj#\n\\tif (capi_buildvalue == NULL) {\n#routdebugfailure#\n\\t} else {\n#routdebugleave#\n\\t}\n\\tCFUNCSMESS(\\\"Freeing memory.\\\\n\\\");\n#freemem#\n#ifdef F2PY_REPORT_ATEXIT\nf2py_stop_clock();\n#endif\n\\treturn capi_buildvalue;\n}\n#endtitle#\n\"\"\",\n 'routine_defs':'#routine_def#',\n 'initf2pywraphooks':'#initf2pywraphook#',\n 'externroutines':'#declfortranroutine#',\n 'doc':'#docreturn##name#(#docsignature#)',\n 'docshort':'#docreturn##name#(#docsignatureshort#)',\n 'docs':'\"\\t#docreturn##name#(#docsignature#)\\\\n\"\\n',\n 'need':['arrayobject.h','CFUNCSMESS','MINMAX'],\n 'cppmacros':{debugcapi:'#define DEBUGCFUNCS'},\n 'latexdoc':['\\\\subsection{Wrapper function \\\\texttt{#texname#}}\\n',\n \"\"\"\n\\\\noindent{{}\\\\verb@#docreturn##name#@{}}\\\\texttt{(#latexdocsignatureshort#)}\n#routnote#\n\n#latexdocstrsigns#\n\"\"\"],\n 'restdoc':['Wrapped function ``#name#``\\n'+'-'*80,\n \n ]\n }\n\n################## Rules for C/API function ##############\n\nrout_rules=[\n { # Init\n 'separatorsfor': {'callfortranroutine':'\\n','routdebugenter':'\\n','decl':'\\n',\n 'routdebugleave':'\\n','routdebugfailure':'\\n',\n 'setjmpbuf':' || ',\n 'docstrreq':'\\n','docstropt':'\\n','docstrout':'\\n',\n 'docstrcbs':'\\n','docstrsigns':'\\\\n\"\\n\"',\n 'latexdocstrsigns':'\\n',\n 'latexdocstrreq':'\\n','latexdocstropt':'\\n',\n 'latexdocstrout':'\\n','latexdocstrcbs':'\\n',\n },\n 'kwlist':'','kwlistopt':'','callfortran':'','callfortranappend':'',\n 'docsign':'','docsignopt':'','decl':'/*decl*/',\n 'freemem':'/*freemem*/',\n 'docsignshort':'','docsignoptshort':'',\n 'docstrsigns':'','latexdocstrsigns':'',\n 'docstrreq':'Required arguments:',\n 'docstropt':'Optional arguments:',\n 'docstrout':'Return objects:',\n 'docstrcbs':'Call-back functions:',\n 'latexdocstrreq':'\\\\noindent Required arguments:',\n 'latexdocstropt':'\\\\noindent Optional arguments:',\n 'latexdocstrout':'\\\\noindent Return objects:',\n 'latexdocstrcbs':'\\\\noindent Call-back functions:',\n 'args_capi':'','keys_capi':'','functype':'',\n 'frompyobj':'/*frompyobj*/',\n 'cleanupfrompyobj':['/*end of cleanupfrompyobj*/'], #this list will be reversed\n 'pyobjfrom':'/*pyobjfrom*/',\n 'closepyobjfrom':['/*end of closepyobjfrom*/'], #this list will be reversed\n 'topyarr':'/*topyarr*/','routdebugleave':'/*routdebugleave*/',\n 'routdebugenter':'/*routdebugenter*/',\n 'routdebugfailure':'/*routdebugfailure*/',\n 'callfortranroutine':'/*callfortranroutine*/',\n 'argformat':'','keyformat':'','need_cfuncs':'',\n 'docreturn':'','return':'','returnformat':'','rformat':'',\n 'kwlistxa':'','keys_xa':'','xaformat':'','docsignxa':'','docsignxashort':'',\n 'initf2pywraphook':'',\n 'routnote':{hasnote:'--- #note#',l_not(hasnote):''},\n },{\n 'apiname':'f2py_rout_#modulename#_#name#',\n 'pyname':'#modulename#.#name#',\n 'decl':'',\n '_check':l_not(ismoduleroutine)\n },{\n 'apiname':'f2py_rout_#modulename#_#f90modulename#_#name#',\n 'pyname':'#modulename#.#f90modulename#.#name#',\n 'decl':'',\n '_check':ismoduleroutine\n },{ # Subroutine\n 'functype':'void',\n 'declfortranroutine':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'extern void #fortranname#(#callprotoargument#);',\n ismoduleroutine:'',\n isdummyroutine:''\n },\n 'routine_def':{l_not(l_or(ismoduleroutine,isintent_c,isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isdummyroutine):'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'need':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'F_FUNC'},\n 'callfortranroutine':[\n {debugcapi:[\"\"\"\\tfprintf(stderr,\\\"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)\\'\\\\n\\\");\"\"\"]},\n {hasexternals:\"\"\"\\\n\\t\\tif (#setjmpbuf#) {\n\\t\\t\\tf2py_success = 0;\n\\t\\t} else {\"\"\"},\n {isthreadsafe:'\\t\\t\\tPy_BEGIN_ALLOW_THREADS'},\n {hascallstatement:'''\\t\\t\\t\\t#callstatement#;\n\\t\\t\\t\\t/*(*f2py_func)(#callfortran#);*/'''},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t\\t\\t\\t(*f2py_func)(#callfortran#);'},\n {isthreadsafe:'\\t\\t\\tPy_END_ALLOW_THREADS'},\n {hasexternals:\"\"\"\\t\\t}\"\"\"}\n ],\n '_check':issubroutine,\n },{ # Wrapped function\n 'functype':'void',\n 'declfortranroutine':{l_not(l_or(ismoduleroutine,isdummyroutine)):'extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);',\n isdummyroutine:'',\n },\n\n 'routine_def':{l_not(l_or(ismoduleroutine,isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_WRAPPEDFUNC#(#name_lower#,#NAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n isdummyroutine:'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'initf2pywraphook':{l_not(l_or(ismoduleroutine,isdummyroutine)):'''\n {\n extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void);\n PyObject* o = PyDict_GetItemString(d,\"#name#\");\n PyObject_SetAttrString(o,\"_cpointer\", PyCObject_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL));\n }\n '''},\n 'need':{l_not(l_or(ismoduleroutine,isdummyroutine)):['F_WRAPPEDFUNC','F_FUNC']},\n 'callfortranroutine':[\n {debugcapi:[\"\"\"\\tfprintf(stderr,\\\"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)\\'\\\\n\\\");\"\"\"]},\n {hasexternals:\"\"\"\\\n\\tif (#setjmpbuf#) {\n\\t\\tf2py_success = 0;\n\\t} else {\"\"\"},\n {isthreadsafe:'\\tPy_BEGIN_ALLOW_THREADS'},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t(*f2py_func)(#callfortran#);'},\n {hascallstatement:'\\t#callstatement#;\\n\\t/*(*f2py_func)(#callfortran#);*/'},\n {isthreadsafe:'\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t}'}\n ],\n '_check':isfunction_wrap,\n },{ # Function\n 'functype':'#ctype#',\n 'docreturn':{l_not(isintent_hide):'#rname#,'},\n 'docstrout':'\\t#pydocsignout#',\n 'latexdocstrout':['\\\\item[]{{}\\\\verb@#pydocsignout#@{}}',\n {hasresultnote:'--- #resultnote#'}],\n 'callfortranroutine':[{l_and(debugcapi,isstringfunction):\"\"\"\\\n#ifdef USESCOMPAQFORTRAN\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callcompaqfortran#)\\\\n\\\");\n#else\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\\\n\\\");\n#endif\n\"\"\"},\n {l_and(debugcapi,l_not(isstringfunction)):\"\"\"\\\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\\\n\\\");\n\"\"\"}\n ],\n '_check':l_and(isfunction,l_not(isfunction_wrap))\n },{ # Scalar function\n 'declfortranroutine':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'extern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'extern #ctype# #fortranname#(#callprotoargument#);',\n isdummyroutine:''\n },\n 'routine_def':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},',\n isdummyroutine:'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'decl':[{iscomplexfunction_warn:'\\t#ctype# #name#_return_value={0,0};',\n l_not(iscomplexfunction):'\\t#ctype# #name#_return_value=0;'},\n {iscomplexfunction:'\\tPyObject *#name#_return_value_capi = Py_None;'}\n ],\n 'callfortranroutine':[\n {hasexternals:\"\"\"\\\n\\tif (#setjmpbuf#) {\n\\t\\tf2py_success = 0;\n\\t} else {\"\"\"},\n {isthreadsafe:'\\tPy_BEGIN_ALLOW_THREADS'},\n {hascallstatement:'''\\t#callstatement#;\n/*\\t#name#_return_value = (*f2py_func)(#callfortran#);*/\n'''},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t#name#_return_value = (*f2py_func)(#callfortran#);'},\n {isthreadsafe:'\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t}'},\n {l_and(debugcapi,iscomplexfunction):'\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value.r,#name#_return_value.i);'},\n {l_and(debugcapi,l_not(iscomplexfunction)):'\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value);'}],\n 'pyobjfrom':{iscomplexfunction:'\\t#name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);'},\n 'need':[{l_not(isdummyroutine):'F_FUNC'},\n {iscomplexfunction:'pyobj_from_#ctype#1'},\n {islong_longfunction:'long_long'},\n {islong_doublefunction:'long_double'}],\n 'returnformat':{l_not(isintent_hide):'#rformat#'},\n 'return':{iscomplexfunction:',#name#_return_value_capi',\n l_not(l_or(iscomplexfunction,isintent_hide)):',#name#_return_value'},\n '_check':l_and(isfunction,l_not(isstringfunction),l_not(isfunction_wrap))\n },{ # String function # in use for --no-wrap\n 'declfortranroutine':'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n 'routine_def':{l_not(l_or(ismoduleroutine,isintent_c)):\n# '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)F_FUNC(#fortranname#,#FORTRANNAME#),(void *)#apiname#,doc_#apiname#},',\n '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c):\n# '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(void *)#apiname#,doc_#apiname#},'\n '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},'\n },\n 'decl':['\\t#ctype# #name#_return_value = NULL;',\n '\\tint #name#_return_value_len = 0;'],\n 'callfortran':'#name#_return_value,#name#_return_value_len,',\n 'callfortranroutine':['\\t#name#_return_value_len = #rlength#;',\n '\\tif ((#name#_return_value = (string)malloc(sizeof(char)*(#name#_return_value_len+1))) == NULL) {',\n '\\t\\tPyErr_SetString(PyExc_MemoryError, \\\"out of memory\\\");',\n '\\t\\tf2py_success = 0;',\n '\\t} else {',\n \"\\t\\t(#name#_return_value)[#name#_return_value_len] = '\\\\0';\",\n '\\t}',\n '\\tif (f2py_success) {',\n {hasexternals:\"\"\"\\\n\\t\\tif (#setjmpbuf#) {\n\\t\\t\\tf2py_success = 0;\n\\t\\t} else {\"\"\"},\n {isthreadsafe:'\\t\\tPy_BEGIN_ALLOW_THREADS'},\n \"\"\"\\\n#ifdef USESCOMPAQFORTRAN\n\\t\\t(*f2py_func)(#callcompaqfortran#);\n#else\n\\t\\t(*f2py_func)(#callfortran#);\n#endif\n\"\"\",\n {isthreadsafe:'\\t\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t\\t}'},\n {debugcapi:'\\t\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value_len,#name#_return_value);'},\n '\\t} /* if (f2py_success) after (string)malloc */',\n ],\n 'returnformat':'#rformat#',\n 'return':',#name#_return_value',\n 'freemem':'\\tSTRINGFREE(#name#_return_value);',\n 'need':['F_FUNC','#ctype#','STRINGFREE'],\n '_check':l_and(isstringfunction,l_not(isfunction_wrap)) # ???obsolete\n },\n { # Debugging\n 'routdebugenter':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\\\\n\");',\n 'routdebugleave':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#: successful.\\\\n\");',\n 'routdebugfailure':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#: failure.\\\\n\");',\n '_check':debugcapi\n }\n ]\n\n################ Rules for arguments ##################\n\ntypedef_need_dict = {islong_long:'long_long',\n islong_double:'long_double',\n islong_complex:'complex_long_double',\n isunsigned_char:'unsigned_char',\n isunsigned_short:'unsigned_short',\n isunsigned:'unsigned',\n isunsigned_long_long:'unsigned_long_long'}\n\naux_rules=[\n {\n 'separatorsfor':sepdict\n },\n { # Common\n 'frompyobj':['\\t/* Processing auxiliary variable #varname# */',\n {debugcapi:'\\tfprintf(stderr,\"#vardebuginfo#\\\\n\");'},],\n 'cleanupfrompyobj':'\\t/* End of cleaning variable #varname# */',\n 'need':typedef_need_dict,\n },\n# Scalars (not complex)\n { # Common\n 'decl':'\\t#ctype# #varname# = 0;',\n 'need':{hasinitvalue:'math.h'},\n 'frompyobj':{hasinitvalue:'\\t#varname# = #init#;'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n },\n {\n 'return':',#varname#',\n 'docstrout':'\\t#pydocsignout#',\n 'docreturn':'#outvarname#,',\n 'returnformat':'#varrformat#',\n '_check':l_and(isscalar,l_not(iscomplex),isintent_out),\n },\n# Complex scalars\n { # Common\n 'decl':'\\t#ctype# #varname#;',\n 'frompyobj': {hasinitvalue:'\\t#varname#.r = #init.r#, #varname#.i = #init.i#;'},\n '_check':iscomplex\n },\n# String\n { # Common\n 'decl':['\\t#ctype# #varname# = NULL;',\n '\\tint slen(#varname#);',\n ],\n 'need':['len..'],\n '_check':isstring\n },\n# Array\n { # Common\n 'decl':['\\t#ctype# *#varname# = NULL;',\n '\\tintp #varname#_Dims[#rank#] = {#rank*[-1]#};',\n '\\tconst int #varname#_Rank = #rank#;',\n ],\n 'need':['len..',{hasinitvalue:'forcomb'},{hasinitvalue:'CFUNCSMESS'}],\n '_check':isarray\n },\n# Scalararray\n { # Common\n '_check':l_and(isarray,l_not(iscomplexarray))\n },{ # Not hidden\n '_check':l_and(isarray,l_not(iscomplexarray),isintent_nothide)\n },\n# Integer*1 array\n {'need':'#ctype#',\n '_check':isint1array,\n '_depend':''\n },\n# Integer*-1 array\n {'need':'#ctype#',\n '_check':isunsigned_chararray,\n '_depend':''\n },\n# Integer*-2 array\n {'need':'#ctype#',\n '_check':isunsigned_shortarray,\n '_depend':''\n },\n# Integer*-8 array\n {'need':'#ctype#',\n '_check':isunsigned_long_longarray,\n '_depend':''\n },\n# Complexarray\n {'need':'#ctype#',\n '_check':iscomplexarray,\n '_depend':''\n },\n# Stringarray\n {\n 'callfortranappend':{isarrayofstrings:'flen(#varname#),'},\n 'need':'string',\n '_check':isstringarray\n }\n ]\n\narg_rules=[\n {\n 'separatorsfor':sepdict\n },\n { # Common\n 'frompyobj':['\\t/* Processing variable #varname# */',\n {debugcapi:'\\tfprintf(stderr,\"#vardebuginfo#\\\\n\");'},],\n 'cleanupfrompyobj':'\\t/* End of cleaning variable #varname# */',\n '_depend':'',\n 'need':typedef_need_dict,\n },\n# Doc signatures\n {\n 'docstropt':{l_and(isoptional,isintent_nothide):'\\t#pydocsign#'},\n 'docstrreq':{l_and(isrequired,isintent_nothide):'\\t#pydocsign#'},\n 'docstrout':{isintent_out:'\\t#pydocsignout#'},\n 'latexdocstropt':{l_and(isoptional,isintent_nothide):['\\\\item[]{{}\\\\verb@#pydocsign#@{}}',\n {hasnote:'--- #note#'}]},\n 'latexdocstrreq':{l_and(isrequired,isintent_nothide):['\\\\item[]{{}\\\\verb@#pydocsign#@{}}',\n {hasnote:'--- #note#'}]},\n 'latexdocstrout':{isintent_out:['\\\\item[]{{}\\\\verb@#pydocsignout#@{}}',\n {l_and(hasnote,isintent_hide):'--- #note#',\n l_and(hasnote,isintent_nothide):'--- See above.'}]},\n 'depend':''\n },\n# Required/Optional arguments\n {\n 'kwlist':'\"#varname#\",',\n 'docsign':'#varname#,',\n '_check':l_and(isintent_nothide,l_not(isoptional))\n },\n {\n 'kwlistopt':'\"#varname#\",',\n 'docsignopt':'#varname#=#showinit#,',\n 'docsignoptshort':'#varname#,',\n '_check':l_and(isintent_nothide,isoptional)\n },\n# Docstring/BuildValue\n {\n 'docreturn':'#outvarname#,',\n 'returnformat':'#varrformat#',\n '_check':isintent_out\n },\n# Externals (call-back functions)\n { # Common\n 'docsignxa':{isintent_nothide:'#varname#_extra_args=(),'},\n 'docsignxashort':{isintent_nothide:'#varname#_extra_args,'},\n 'docstropt':{isintent_nothide:'\\t#varname#_extra_args := () input tuple'},\n 'docstrcbs':'#cbdocstr#',\n 'latexdocstrcbs':'\\\\item[] #cblatexdocstr#',\n 'latexdocstropt':{isintent_nothide:'\\\\item[]{{}\\\\verb@#varname#_extra_args := () input tuple@{}} --- Extra arguments for call-back function {{}\\\\verb@#varname#@{}}.'},\n 'decl':['\\tPyObject *#varname#_capi = Py_None;',\n '\\tPyTupleObject *#varname#_xa_capi = NULL;',\n '\\tPyTupleObject *#varname#_args_capi = NULL;',\n '\\tint #varname#_nofargs_capi = 0;',\n {l_not(isintent_callback):'\\t#cbname#_typedef #varname#_cptr;'}\n ],\n 'kwlistxa':{isintent_nothide:'\"#varname#_extra_args\",'},\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'xaformat':{isintent_nothide:'O!'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'keys_xa':',&PyTuple_Type,&#varname#_xa_capi',\n 'setjmpbuf':'(setjmp(#cbname#_jmpbuf))',\n 'callfortran':{l_not(isintent_callback):'#varname#_cptr,'},\n 'need':['#cbname#','setjmp.h'],\n '_check':isexternal\n },\n {\n 'frompyobj':[{l_not(isintent_callback):\"\"\"\\\nif(PyCObject_Check(#varname#_capi)) {\n #varname#_cptr = PyCObject_AsVoidPtr(#varname#_capi);\n} else {\n #varname#_cptr = #cbname#;\n}\n\"\"\"},{isintent_callback:\"\"\"\\\nif (#varname#_capi==Py_None) {\n #varname#_capi = PyObject_GetAttrString(#modulename#_module,\\\"#varname#\\\");\n if (#varname#_capi) {\n if (#varname#_xa_capi==NULL) {\n if (PyObject_HasAttrString(#modulename#_module,\\\"#varname#_extra_args\\\")) {\n PyObject* capi_tmp = PyObject_GetAttrString(#modulename#_module,\\\"#varname#_extra_args\\\");\n if (capi_tmp)\n #varname#_xa_capi = (PyTupleObject *)PySequence_Tuple(capi_tmp);\n else\n #varname#_xa_capi = (PyTupleObject *)Py_BuildValue(\\\"()\\\");\n if (#varname#_xa_capi==NULL) {\n PyErr_SetString(#modulename#_error,\\\"Failed to convert #modulename#.#varname#_extra_args to tuple.\\\\n\\\");\n return NULL;\n }\n }\n }\n }\n if (#varname#_capi==NULL) {\n PyErr_SetString(#modulename#_error,\\\"Callback #varname# not defined (as an argument or module #modulename# attribute).\\\\n\\\");\n return NULL;\n }\n}\n\"\"\"},\n## {l_not(isintent_callback):\"\"\"\\\n## if (#varname#_capi==Py_None) {\n## printf(\\\"hoi\\\\n\\\");\n## }\n## \"\"\"},\n\"\"\"\\\n\\t#varname#_nofargs_capi = #cbname#_nofargs;\n\\tif (create_cb_arglist(#varname#_capi,#varname#_xa_capi,#maxnofargs#,#nofoptargs#,&#cbname#_nofargs,&#varname#_args_capi,\\\"failed in processing argument list for call-back #varname#.\\\")) {\n\\t\\tjmp_buf #varname#_jmpbuf;\"\"\",\n{debugcapi:[\"\"\"\\\n\\t\\tfprintf(stderr,\\\"debug-capi:Assuming %d arguments; at most #maxnofargs#(-#nofoptargs#) is expected.\\\\n\\\",#cbname#_nofargs);\n\\t\\tCFUNCSMESSPY(\\\"for #varname#=\\\",#cbname#_capi);\"\"\",\n{l_not(isintent_callback):\"\"\"\\t\\tfprintf(stderr,\\\"#vardebugshowvalue# (call-back in C).\\\\n\\\",#cbname#);\"\"\"}]},\n \"\"\"\\\n\\t\\tCFUNCSMESS(\\\"Saving jmpbuf for `#varname#`.\\\\n\\\");\n\\t\\tSWAP(#varname#_capi,#cbname#_capi,PyObject);\n\\t\\tSWAP(#varname#_args_capi,#cbname#_args_capi,PyTupleObject);\n\\t\\tmemcpy(&#varname#_jmpbuf,&#cbname#_jmpbuf,sizeof(jmp_buf));\"\"\",\n ],\n'cleanupfrompyobj':\n\"\"\"\\\n\\t\\tCFUNCSMESS(\\\"Restoring jmpbuf for `#varname#`.\\\\n\\\");\n\\t\\t#cbname#_capi = #varname#_capi;\n\\t\\tPy_DECREF(#cbname#_args_capi);\n\\t\\t#cbname#_args_capi = #varname#_args_capi;\n\\t\\t#cbname#_nofargs = #varname#_nofargs_capi;\n\\t\\tmemcpy(&#cbname#_jmpbuf,&#varname#_jmpbuf,sizeof(jmp_buf));\n\\t}\"\"\",\n 'need':['SWAP','create_cb_arglist'],\n '_check':isexternal,\n '_depend':''\n },\n# Scalars (not complex)\n { # Common\n 'decl':'\\t#ctype# #varname# = 0;',\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#);'},\n 'callfortran':{isintent_c:'#varname#,',l_not(isintent_c):'&#varname#,'},\n 'return':{isintent_out:',#varname#'},\n '_check':l_and(isscalar,l_not(iscomplex))\n },{\n 'need':{hasinitvalue:'math.h'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n #'_depend':''\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'pyobjfrom':{isintent_inout:\"\"\"\\\n\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\\tif (f2py_success) {\"\"\"},\n 'closepyobjfrom':{isintent_inout:\"\\t} /*if (f2py_success) of #varname# pyobjfrom*/\"},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n '_check':l_and(isscalar,l_not(iscomplex),isintent_nothide)\n },{\n 'frompyobj':[\n# hasinitvalue...\n# if pyobj is None:\n# varname = init\n# else\n# from_pyobj(varname)\n# \n# isoptional and noinitvalue...\n# if pyobj is not None:\n# from_pyobj(varname)\n# else:\n# varname is uninitialized\n#\n# ...\n# from_pyobj(varname)\n#\n {hasinitvalue:'\\tif (#varname#_capi == Py_None) #varname# = #init#; else',\n '_depend':''},\n {l_and(isoptional,l_not(hasinitvalue)):'\\tif (#varname#_capi != Py_None)',\n '_depend':''}, \n {l_not(islogical):'''\\\n\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#pyname#() #nth# (#varname#) can\\'t be converted to #ctype#\");\n\\tif (f2py_success) {'''},\n {islogical:'''\\\n\\t\\t#varname# = (#ctype#)PyObject_IsTrue(#varname#_capi);\n\\t\\tf2py_success = 1;\n\\tif (f2py_success) {'''},\n ],\n 'cleanupfrompyobj':'\\t} /*if (f2py_success) of #varname#*/',\n 'need':{l_not(islogical):'#ctype#_from_pyobj'},\n '_check':l_and(isscalar,l_not(iscomplex),isintent_nothide),\n '_depend':''\n# },{ # Hidden\n# '_check':l_and(isscalar,l_not(iscomplex),isintent_hide)\n },{ # Hidden\n 'frompyobj':{hasinitvalue:'\\t#varname# = #init#;'},\n 'need':typedef_need_dict,\n '_check':l_and(isscalar,l_not(iscomplex),isintent_hide),\n '_depend':''\n },{ # Common\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#);'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n '_depend':''\n },\n# Complex scalars\n { # Common\n 'decl':'\\t#ctype# #varname#;',\n 'callfortran':{isintent_c:'#varname#,',l_not(isintent_c):'&#varname#,'},\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#.r,#varname#.i);'},\n 'return':{isintent_out:',#varname#_capi'},\n '_check':iscomplex\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n 'pyobjfrom':{isintent_inout:\"\"\"\\\n\\t\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\\t\\tif (f2py_success) {\"\"\"},\n 'closepyobjfrom':{isintent_inout:\"\\t\\t} /*if (f2py_success) of #varname# pyobjfrom*/\"},\n '_check':l_and(iscomplex,isintent_nothide)\n },{\n 'frompyobj':[{hasinitvalue:'\\tif (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} else'},\n {l_and(isoptional,l_not(hasinitvalue)):'\\tif (#varname#_capi != Py_None)'},\n# '\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#ctype#_from_pyobj failed in converting #nth# `#varname#\\' of #pyname# to C #ctype#\\\\n\");'\n '\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#pyname#() #nth# (#varname#) can\\'t be converted to #ctype#\");'\n '\\n\\tif (f2py_success) {'],\n 'cleanupfrompyobj':'\\t} /*if (f2py_success) of #varname# frompyobj*/',\n 'need':['#ctype#_from_pyobj'],\n '_check':l_and(iscomplex,isintent_nothide),\n '_depend':''\n },{ # Hidden\n 'decl':{isintent_out:'\\tPyObject *#varname#_capi = Py_None;'},\n '_check':l_and(iscomplex,isintent_hide)\n },{\n 'frompyobj': {hasinitvalue:'\\t#varname#.r = #init.r#, #varname#.i = #init.i#;'},\n '_check':l_and(iscomplex,isintent_hide),\n '_depend':''\n },{ # Common\n 'pyobjfrom':{isintent_out:'\\t#varname#_capi = pyobj_from_#ctype#1(#varname#);'},\n 'need':['pyobj_from_#ctype#1'],\n '_check':iscomplex\n },{\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#.r,#varname#.i);'},\n '_check':iscomplex,\n '_depend':''\n },\n# String\n { # Common\n 'decl':['\\t#ctype# #varname# = NULL;',\n '\\tint slen(#varname#);',\n '\\tPyObject *#varname#_capi = Py_None;'],\n 'callfortran':'#varname#,',\n 'callfortranappend':'slen(#varname#),',\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",slen(#varname#),#varname#);'},\n# 'freemem':'\\tSTRINGFREE(#varname#);',\n 'return':{isintent_out:',#varname#'},\n 'need':['len..'],#'STRINGFREE'],\n '_check':isstring\n },{ # Common\n 'frompyobj':\"\"\"\\\n\\tslen(#varname#) = #length#;\n\\tf2py_success = #ctype#_from_pyobj(&#varname#,&slen(#varname#),#init#,#varname#_capi,\\\"#ctype#_from_pyobj failed in converting #nth# `#varname#\\' of #pyname# to C #ctype#\\\");\n\\tif (f2py_success) {\"\"\",\n 'cleanupfrompyobj':\"\"\"\\\n\\t\\tSTRINGFREE(#varname#);\n\\t} /*if (f2py_success) of #varname#*/\"\"\",\n 'need':['#ctype#_from_pyobj','len..','STRINGFREE'],\n '_check':isstring,\n '_depend':''\n },{ # Not hidden\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'pyobjfrom':{isintent_inout:'''\\\n\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,#varname#);\n\\tif (f2py_success) {'''},\n 'closepyobjfrom':{isintent_inout:'\\t} /*if (f2py_success) of #varname# pyobjfrom*/'},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n '_check':l_and(isstring,isintent_nothide)\n },{ # Hidden\n '_check':l_and(isstring,isintent_hide)\n },{\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",slen(#varname#),#varname#);'},\n '_check':isstring,\n '_depend':''\n },\n# Array\n { # Common\n 'decl':['\\t#ctype# *#varname# = NULL;',\n '\\tintp #varname#_Dims[#rank#] = {#rank*[-1]#};',\n '\\tconst int #varname#_Rank = #rank#;',\n '\\tPyArrayObject *capi_#varname#_tmp = NULL;',\n '\\tint capi_#varname#_intent = 0;',\n ],\n 'callfortran':'#varname#,',\n 'return':{isintent_out:',capi_#varname#_tmp'},\n 'need':'len..',\n '_check':isarray\n },{ # intent(overwrite) array\n 'decl':'\\tint capi_overwrite_#varname# = 1;',\n 'kwlistxa':'\"overwrite_#varname#\",',\n 'xaformat':'i',\n 'keys_xa':',&capi_overwrite_#varname#',\n 'docsignxa':'overwrite_#varname#=1,',\n 'docsignxashort':'overwrite_#varname#,',\n 'docstropt':'\\toverwrite_#varname# := 1 input int',\n '_check':l_and(isarray,isintent_overwrite),\n },{\n 'frompyobj':'\\tcapi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);',\n '_check':l_and(isarray,isintent_overwrite),\n '_depend':'',\n },\n { # intent(copy) array\n 'decl':'\\tint capi_overwrite_#varname# = 0;',\n 'kwlistxa':'\"overwrite_#varname#\",',\n 'xaformat':'i',\n 'keys_xa':',&capi_overwrite_#varname#',\n 'docsignxa':'overwrite_#varname#=0,',\n 'docsignxashort':'overwrite_#varname#,',\n 'docstropt':'\\toverwrite_#varname# := 0 input int',\n '_check':l_and(isarray,isintent_copy),\n },{\n 'frompyobj':'\\tcapi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);',\n '_check':l_and(isarray,isintent_copy),\n '_depend':'',\n },{ \n 'need':[{hasinitvalue:'forcomb'},{hasinitvalue:'CFUNCSMESS'}],\n '_check':isarray,\n '_depend':''\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n# 'pyobjfrom':{isintent_inout:\"\"\"\\\n# /* Partly because of the following hack, intent(inout) is depreciated,\n# Use intent(in,out) instead.\n \n# \\tif ((#varname#_capi != Py_None) && PyArray_Check(#varname#_capi) \\\\\n# \\t\\t&& (#varname#_capi != (PyObject *)capi_#varname#_tmp)) {\n# \\t\\tif (((PyArrayObject *)#varname#_capi)->nd != capi_#varname#_tmp->nd) {\n# \\t\\t\\tif (#varname#_capi != capi_#varname#_tmp->base)\n# \\t\\t\\t\\tcopy_ND_array((PyArrayObject *)capi_#varname#_tmp->base,(PyArrayObject *)#varname#_capi);\n# \\t\\t} else\n# \\t\\t\\tcopy_ND_array(capi_#varname#_tmp,(PyArrayObject *)#varname#_capi);\n# \\t}\n# */\n# \"\"\"},\n# 'need':{isintent_inout:'copy_ND_array'},\n '_check':l_and(isarray,isintent_nothide)\n },{\n 'frompyobj':['\\t#setdims#;',\n '\\tcapi_#varname#_intent |= #intent#;',\n {isintent_hide:'\\tcapi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,Py_None);'},\n {isintent_nothide:'\\tcapi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,#varname#_capi);'},\n \"\"\"\\\n\\tif (capi_#varname#_tmp == NULL) {\n\\t\\tif (!PyErr_Occurred())\n\\t\\t\\tPyErr_SetString(#modulename#_error,\\\"failed in converting #nth# `#varname#\\' of #pyname# to C/Fortran array\\\" );\n\\t} else {\n\\t\\t#varname# = (#ctype# *)(capi_#varname#_tmp->data);\n\"\"\",\n{hasinitvalue:[\n {isintent_nothide:'\\tif (#varname#_capi == Py_None) {'},\n {isintent_hide:'\\t{'},\n {iscomplexarray:'\\t\\t#ctype# capi_c;'},\n \"\"\"\\\n\\t\\tint *_i,capi_i=0;\n\\t\\tCFUNCSMESS(\\\"#name#: Initializing #varname#=#init#\\\\n\\\");\n\\t\\tif (initforcomb(capi_#varname#_tmp->dimensions,capi_#varname#_tmp->nd,1)) {\n\\t\\t\\twhile ((_i = nextforcomb()))\n\\t\\t\\t\\t#varname#[capi_i++] = #init#; /* fortran way */\n\\t\\t} else {\n\\t\\t\\tif (!PyErr_Occurred())\n\\t\\t\\t\\tPyErr_SetString(#modulename#_error,\\\"Initialization of #nth# #varname# failed (initforcomb).\\\");\n\\t\\t\\tf2py_success = 0;\n\\t\\t}\n\\t}\n\\tif (f2py_success) {\"\"\"]},\n ],\n 'cleanupfrompyobj':[ # note that this list will be reversed\n '\\t} /*if (capi_#varname#_tmp == NULL) ... else of #varname#*/',\n {l_not(l_or(isintent_out,isintent_hide)):\"\"\"\\\n\\tif((PyObject *)capi_#varname#_tmp!=#varname#_capi) {\n\\t\\tPy_XDECREF(capi_#varname#_tmp); }\"\"\"},\n {l_and(isintent_hide,l_not(isintent_out)):\"\"\"\\t\\tPy_XDECREF(capi_#varname#_tmp);\"\"\"},\n {hasinitvalue:'\\t} /*if (f2py_success) of #varname# init*/'},\n ],\n '_check':isarray,\n '_depend':''\n },\n# { # Hidden\n# 'freemem':{l_not(isintent_out):'\\tPy_XDECREF(capi_#varname#_tmp);'},\n# '_check':l_and(isarray,isintent_hide)\n# },\n# Scalararray\n { # Common\n '_check':l_and(isarray,l_not(iscomplexarray))\n },{ # Not hidden\n '_check':l_and(isarray,l_not(iscomplexarray),isintent_nothide)\n },\n# Integer*1 array\n {'need':'#ctype#',\n '_check':isint1array,\n '_depend':''\n },\n# Integer*-1 array\n {'need':'#ctype#',\n '_check':isunsigned_chararray,\n '_depend':''\n },\n# Integer*-2 array\n {'need':'#ctype#',\n '_check':isunsigned_shortarray,\n '_depend':''\n },\n# Integer*-8 array\n {'need':'#ctype#',\n '_check':isunsigned_long_longarray,\n '_depend':''\n },\n# Complexarray\n {'need':'#ctype#',\n '_check':iscomplexarray,\n '_depend':''\n },\n# Stringarray\n {\n 'callfortranappend':{isarrayofstrings:'flen(#varname#),'},\n 'need':'string',\n '_check':isstringarray\n }\n ]\n\n################# Rules for checking ###############\n\ncheck_rules=[\n {\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\\\"debug-capi:Checking `#check#\\'\\\\n\\\");'},\n 'need':'len..'\n },{\n 'frompyobj':'\\tCHECKSCALAR(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\",\\\"#varshowvalue#\\\",#varname#) {',\n 'cleanupfrompyobj':'\\t} /*CHECKSCALAR(#check#)*/',\n 'need':'CHECKSCALAR',\n '_check':l_and(isscalar,l_not(iscomplex)),\n '_break':''\n },{\n 'frompyobj':'\\tCHECKSTRING(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\",\\\"#varshowvalue#\\\",#varname#) {',\n 'cleanupfrompyobj':'\\t} /*CHECKSTRING(#check#)*/',\n 'need':'CHECKSTRING',\n '_check':isstring,\n '_break':''\n },{\n 'need':'CHECKARRAY',\n 'frompyobj':'\\tCHECKARRAY(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\") {',\n 'cleanupfrompyobj':'\\t} /*CHECKARRAY(#check#)*/',\n '_check':isarray,\n '_break':''\n },{\n 'need':'CHECKGENERIC',\n 'frompyobj':'\\tCHECKGENERIC(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\") {',\n 'cleanupfrompyobj':'\\t} /*CHECKGENERIC(#check#)*/',\n }\n]\n\n########## Applying the rules. No need to modify what follows #############\n\n#################### Build C/API module #######################\n\ndef buildmodule(m,um):\n \"\"\"\n Return \n \"\"\"\n global f2py_version,options\n outmess('\\tBuilding module \"%s\"...\\n'%(m['name']))\n ret = {}\n mod_rules=defmod_rules[:]\n vrd=modsign2map(m)\n rd=dictappend({'f2py_version':f2py_version},vrd)\n funcwrappers = []\n funcwrappers2 = [] # F90 codes\n for n in m['interfaced']:\n nb=None\n for bi in m['body']:\n if not bi['block']=='interface':\n errmess('buildmodule: Expected interface block. Skipping.\\n')\n continue\n for b in bi['body']:\n if b['name']==n: nb=b;break\n \n if not nb:\n errmess('buildmodule: Could not found the body of interfaced routine \"%s\". Skipping.\\n'%(n))\n continue\n nb_list = [nb]\n if nb.has_key('entry'):\n for k,a in nb['entry'].items():\n nb1 = copy.deepcopy(nb)\n del nb1['entry']\n nb1['name'] = k\n nb1['args'] = a\n nb_list.append(nb1)\n for nb in nb_list:\n api,wrap=buildapi(nb)\n if wrap:\n if ismoduleroutine(nb):\n funcwrappers2.append(wrap)\n else:\n funcwrappers.append(wrap)\n ar=applyrules(api,vrd)\n rd=dictappend(rd,ar)\n\n # Construct COMMON block support\n cr,wrap = common_rules.buildhooks(m)\n if wrap:\n funcwrappers.append(wrap)\n ar=applyrules(cr,vrd)\n rd=dictappend(rd,ar)\n\n # Construct F90 module support\n mr,wrap = f90mod_rules.buildhooks(m)\n if wrap:\n funcwrappers2.append(wrap)\n ar=applyrules(mr,vrd)\n rd=dictappend(rd,ar)\n\n for u in um:\n ar=use_rules.buildusevars(u,m['use'][u['name']])\n rd=dictappend(rd,ar)\n\n needs=cfuncs.get_needs()\n code={}\n for n in needs.keys():\n code[n]=[]\n for k in needs[n]:\n c=''\n if cfuncs.includes0.has_key(k): c=cfuncs.includes0[k]\n elif cfuncs.includes.has_key(k): c=cfuncs.includes[k]\n elif cfuncs.userincludes.has_key(k): c=cfuncs.userincludes[k]\n elif cfuncs.typedefs.has_key(k): c=cfuncs.typedefs[k]\n elif cfuncs.typedefs_generated.has_key(k):\n c=cfuncs.typedefs_generated[k]\n elif cfuncs.cppmacros.has_key(k): c=cfuncs.cppmacros[k]\n elif cfuncs.cfuncs.has_key(k): c=cfuncs.cfuncs[k]\n elif cfuncs.callbacks.has_key(k): c=cfuncs.callbacks[k]\n elif cfuncs.f90modhooks.has_key(k): c=cfuncs.f90modhooks[k]\n elif cfuncs.commonhooks.has_key(k): c=cfuncs.commonhooks[k]\n else: errmess('buildmodule: unknown need %s.\\n'%(`k`));continue\n code[n].append(c)\n mod_rules.append(code)\n for r in mod_rules:\n if (r.has_key('_check') and r['_check'](m)) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,m)\n rd=dictappend(rd,ar)\n ar=applyrules(module_rules,rd)\n\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.c')\n ret['csrc'] = fn\n f=open(fn,'w')\n f.write(string.replace(ar['modulebody'],'\\t',2*' '))\n f.close()\n outmess('\\tWrote C/API module \"%s\" to file \"%s/%smodule.c\"\\n'%(m['name'],options['buildpath'],vrd['modulename']))\n\n if options['dorestdoc']:\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.rest')\n f=open(fn,'w')\n f.write('.. -*- rest -*-\\n')\n f.write(string.join(ar['restdoc'],'\\n'))\n f.close()\n outmess('\\tReST Documentation is saved to file \"%s/%smodule.rest\"\\n'%(options['buildpath'],vrd['modulename']))\n if options['dolatexdoc']:\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.tex')\n ret['ltx'] = fn\n f=open(fn,'w')\n f.write('%% This file is auto-generated with f2py (version:%s)\\n'%(f2py_version))\n if not options.has_key('shortlatex'):\n f.write('\\\\documentclass{article}\\n\\\\usepackage{a4wide}\\n\\\\begin{document}\\n\\\\tableofcontents\\n\\n')\n f.write(string.join(ar['latexdoc'],'\\n'))\n if not options.has_key('shortlatex'):\n f.write('\\\\end{document}')\n f.close()\n outmess('\\tDocumentation is saved to file \"%s/%smodule.tex\"\\n'%(options['buildpath'],vrd['modulename']))\n if funcwrappers:\n wn = os.path.join(options['buildpath'],'%s-f2pywrappers.f'%(vrd['modulename']))\n ret['fsrc'] = wn\n f=open(wn,'w')\n f.write('C -*- fortran -*-\\n')\n f.write('C This file is autogenerated with f2py (version:%s)\\n'%(f2py_version))\n f.write('C It contains Fortran 77 wrappers to fortran functions.\\n')\n lines = []\n for l in string.split(string.join(funcwrappers,'\\n\\n')+'\\n','\\n'):\n if l and l[0]==' ':\n while len(l)>=66:\n lines.append(l[:66]+'\\n &')\n l = l[66:]\n lines.append(l+'\\n')\n else: lines.append(l+'\\n')\n lines = string.join(lines,'').replace('\\n &\\n','\\n')\n f.write(lines)\n f.close()\n outmess('\\tFortran 77 wrappers are saved to \"%s\"\\n'%(wn))\n if funcwrappers2:\n wn = os.path.join(options['buildpath'],'%s-f2pywrappers2.f90'%(vrd['modulename']))\n ret['fsrc'] = wn\n f=open(wn,'w')\n f.write('! -*- f90 -*-\\n')\n f.write('! This file is autogenerated with f2py (version:%s)\\n'%(f2py_version))\n f.write('! It contains Fortran 90 wrappers to fortran functions.\\n')\n lines = []\n for l in string.split(string.join(funcwrappers2,'\\n\\n')+'\\n','\\n'):\n if len(l)>72 and l[0]==' ':\n lines.append(l[:72]+'&\\n &')\n l = l[72:]\n while len(l)>66:\n lines.append(l[:66]+'&\\n &')\n l = l[66:]\n lines.append(l+'\\n')\n else: lines.append(l+'\\n')\n lines = string.join(lines,'').replace('\\n &\\n','\\n')\n f.write(lines)\n f.close()\n outmess('\\tFortran 90 wrappers are saved to \"%s\"\\n'%(wn))\n return ret\n\n################## Build C/API function #############\n\nstnd={1:'st',2:'nd',3:'rd',4:'th',5:'th',6:'th',7:'th',8:'th',9:'th',0:'th'}\ndef buildapi(rout):\n rout,wrap = func2subr.assubr(rout)\n args,depargs=getargs2(rout)\n capi_maps.depargs=depargs\n var=rout['vars']\n auxvars = [a for a in var.keys() if isintent_aux(var[a])]\n \n if ismoduleroutine(rout):\n outmess('\\t\\t\\tConstructing wrapper function \"%s.%s\"...\\n'%(rout['modulename'],rout['name']))\n else:\n outmess('\\t\\tConstructing wrapper function \"%s\"...\\n'%(rout['name']))\n # Routine\n vrd=routsign2map(rout)\n rd=dictappend({},vrd)\n for r in rout_rules:\n if (r.has_key('_check') and r['_check'](rout)) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,rout)\n rd=dictappend(rd,ar)\n\n # Args\n nth,nthk=0,0\n savevrd={}\n for a in args:\n vrd=sign2map(a,var[a])\n if isintent_aux(var[a]):\n _rules = aux_rules\n else:\n _rules = arg_rules\n if not isintent_hide(var[a]):\n if not isoptional(var[a]):\n nth=nth+1\n vrd['nth']=`nth`+stnd[nth%10]+' argument'\n else:\n nthk=nthk+1\n vrd['nth']=`nthk`+stnd[nthk%10]+' keyword'\n else: vrd['nth']='hidden' \n savevrd[a]=vrd\n for r in _rules:\n if r.has_key('_depend'): continue\n if (r.has_key('_check') and r['_check'](var[a])) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,var[a])\n rd=dictappend(rd,ar)\n if r.has_key('_break'): break\n for a in depargs:\n if isintent_aux(var[a]):\n _rules = aux_rules\n else:\n _rules = arg_rules\n vrd=savevrd[a]\n for r in _rules:\n if not r.has_key('_depend'): continue\n if (r.has_key('_check') and r['_check'](var[a])) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,var[a])\n rd=dictappend(rd,ar)\n if r.has_key('_break'): break\n if var[a].has_key('check'):\n for c in var[a]['check']:\n vrd['check']=c\n ar=applyrules(check_rules,vrd,var[a])\n rd=dictappend(rd,ar)\n if type(rd['cleanupfrompyobj']) is types.ListType:\n rd['cleanupfrompyobj'].reverse()\n if type(rd['closepyobjfrom']) is types.ListType:\n rd['closepyobjfrom'].reverse()\n rd['docsignature']=stripcomma(replace('#docsign##docsignopt##docsignxa#',\n {'docsign':rd['docsign'],\n 'docsignopt':rd['docsignopt'],\n 'docsignxa':rd['docsignxa']}))\n optargs=stripcomma(replace('#docsignopt##docsignxa#',\n {'docsignxa':rd['docsignxashort'],\n 'docsignopt':rd['docsignoptshort']}\n ))\n if optargs=='':\n rd['docsignatureshort']=stripcomma(replace('#docsign#',{'docsign':rd['docsign']}))\n else:\n rd['docsignatureshort']=replace('#docsign#[#docsignopt#]',\n {'docsign':rd['docsign'],\n 'docsignopt':optargs,\n })\n rd['latexdocsignatureshort']=string.replace(rd['docsignatureshort'],'_','\\\\_')\n rd['latexdocsignatureshort']=string.replace(rd['latexdocsignatureshort'],',',', ')\n cfs=stripcomma(replace('#callfortran##callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))\n if len(rd['callfortranappend'])>1:\n rd['callcompaqfortran']=stripcomma(replace('#callfortran# 0,#callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))\n else:\n rd['callcompaqfortran']=cfs\n rd['callfortran']=cfs\n if type(rd['docreturn'])==types.ListType:\n rd['docreturn']=stripcomma(replace('#docreturn#',{'docreturn':rd['docreturn']}))+' = '\n rd['docstrsigns']=[]\n rd['latexdocstrsigns']=[]\n for k in ['docstrreq','docstropt','docstrout','docstrcbs']:\n if rd.has_key(k) and type(rd[k])==types.ListType:\n rd['docstrsigns']=rd['docstrsigns']+rd[k]\n k='latex'+k\n if rd.has_key(k) and type(rd[k])==types.ListType:\n rd['latexdocstrsigns']=rd['latexdocstrsigns']+rd[k][0:1]+\\\n ['\\\\begin{description}']+rd[k][1:]+\\\n ['\\\\end{description}']\n ar=applyrules(routine_rules,rd)\n if ismoduleroutine(rout):\n outmess('\\t\\t\\t %s\\n'%(ar['docshort']))\n else:\n outmess('\\t\\t %s\\n'%(ar['docshort']))\n return ar,wrap\n\n\n#################### EOF rules.py #######################\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\n\nRules for building C/API module with f2py2e.\n\nHere is a skeleton of a new wrapper function (13Dec2001):\n\nwrapper_function(args)\n declarations\n get_python_arguments, say, `a' and `b'\n\n get_a_from_python\n if (successful) {\n\n get_b_from_python\n if (successful) {\n\n callfortran\n if (succesful) {\n\n put_a_to_python\n if (succesful) {\n\n put_b_to_python\n if (succesful) {\n\n buildvalue = ...\n\n }\n\n }\n \n }\n\n }\n cleanup_b\n\n }\n cleanup_a\n\n return buildvalue\n\"\"\"\n\"\"\"\nCopyright 1999,2000 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/08/30 08:58:42 $\nPearu Peterson\n\"\"\"\n\n__version__ = \"$Revision: 1.129 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport pprint\nimport sys,string,time,types,copy\nerrmess=sys.stderr.write\noutmess=sys.stdout.write\nshow=pprint.pprint\n\nfrom auxfuncs import *\nimport capi_maps\nfrom capi_maps import *\nimport cfuncs\nimport common_rules\nimport use_rules\nimport f90mod_rules\nimport func2subr\noptions={}\n\nsepdict={}\n#for k in ['need_cfuncs']: sepdict[k]=','\nfor k in ['decl',\n 'frompyobj',\n 'cleanupfrompyobj',\n 'topyarr','method',\n 'pyobjfrom','closepyobjfrom',\n 'freemem',\n 'userincludes',\n 'includes0','includes','typedefs','typedefs_generated',\n 'cppmacros','cfuncs','callbacks',\n 'latexdoc',\n 'restdoc',\n 'routine_defs','externroutines',\n 'initf2pywraphooks',\n 'commonhooks','initcommonhooks',\n 'f90modhooks','initf90modhooks']:\n sepdict[k]='\\n'\n\n#################### Rules for C/API module #################\n\nmodule_rules={\n 'modulebody':\"\"\"\\\n/* File: #modulename#module.c\n * This file is auto-generated with f2py (version:#f2py_version#).\n * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,\n * written by Pearu Peterson .\n * See http://cens.ioc.ee/projects/f2py2e/\n * Generation date: \"\"\"+time.asctime(time.localtime(time.time()))+\"\"\"\n * $R\"\"\"+\"\"\"evision:$\n * $D\"\"\"+\"\"\"ate:$\n * Do not edit this file directly unless you know what you are doing!!!\n */\n#ifdef __cplusplus\nextern \\\"C\\\" {\n#endif\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: includes\")+\"\"\"\n#includes#\n#includes0#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: mod_rules['modulebody']\")+\"\"\"\nstatic PyObject *#modulename#_error;\nstatic PyObject *#modulename#_module;\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: typedefs\")+\"\"\"\n#typedefs#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: typedefs_generated\")+\"\"\"\n#typedefs_generated#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: cppmacros\")+\"\"\"\n#cppmacros#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: cfuncs\")+\"\"\"\n#cfuncs#\n\n\"\"\"+gentitle(\"See f2py2e/cfuncs.py: userincludes\")+\"\"\"\n#userincludes#\n\n\"\"\"+gentitle(\"See f2py2e/capi_rules.py: usercode\")+\"\"\"\n#usercode#\n\n/* See f2py2e/rules.py */\n#externroutines#\n\n\"\"\"+gentitle(\"See f2py2e/capi_rules.py: usercode1\")+\"\"\"\n#usercode1#\n\n\"\"\"+gentitle(\"See f2py2e/cb_rules.py: buildcallback\")+\"\"\"\n#callbacks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: buildapi\")+\"\"\"\n#body#\n\n\"\"\"+gentitle(\"See f2py2e/f90mod_rules.py: buildhooks\")+\"\"\"\n#f90modhooks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py: module_rules['modulebody']\")+\"\"\"\n\n\"\"\"+gentitle(\"See f2py2e/common_rules.py: buildhooks\")+\"\"\"\n#commonhooks#\n\n\"\"\"+gentitle(\"See f2py2e/rules.py\")+\"\"\"\n\nstatic FortranDataDef f2py_routine_defs[] = {\n#routine_defs#\n\\t{NULL}\n};\n\nstatic PyMethodDef f2py_module_methods[] = {\n#pymethoddef#\n\\t{NULL,NULL}\n};\n\nDL_EXPORT(void) init#modulename#(void) {\n\\tint i;\n\\tPyObject *m,*d, *s;\n\\tm = #modulename#_module = Py_InitModule(\\\"#modulename#\\\", f2py_module_methods);\n\\tPyFortran_Type.ob_type = &PyType_Type;\n\\timport_array();\n\\tif (PyErr_Occurred())\n\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy.base)\\\");\n\\td = PyModule_GetDict(m);\n\\ts = PyString_FromString(\\\"$R\"\"\"+\"\"\"evision: $\\\");\n\\tPyDict_SetItemString(d, \\\"__version__\\\", s);\n\\ts = PyString_FromString(\\\"This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\\\\nFunctions:\\\\n\\\"\\n#docs#\\\".\\\");\n\\tPyDict_SetItemString(d, \\\"__doc__\\\", s);\n\\t#modulename#_error = PyErr_NewException (\\\"#modulename#.error\\\", NULL, NULL);\n\\tPy_DECREF(s);\n\\tfor(i=0;f2py_routine_defs[i].name!=NULL;i++)\n\\t\\tPyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));\n#initf2pywraphooks#\n#initf90modhooks#\n#initcommonhooks#\n#interface_usercode#\n\\tif (PyErr_Occurred())\n\\t\\tPy_FatalError(\\\"can't initialize module #modulename#\\\");\n\n#ifdef F2PY_REPORT_ATEXIT\n\\ton_exit(f2py_report_on_exit,(void*)\\\"#modulename#\\\");\n#endif\n\n}\n#ifdef __cplusplus\n}\n#endif\n\"\"\",\n 'separatorsfor':{'latexdoc':'\\n\\n',\n 'restdoc':'\\n\\n'},\n 'latexdoc':['\\\\section{Module \\\\texttt{#texmodulename#}}\\n',\n '#modnote#\\n',\n '#latexdoc#'],\n 'restdoc':['Module #modulename#\\n'+'='*80,\n '\\n#restdoc#']\n }\n\ndefmod_rules=[\n {'body':'/*eof body*/',\n 'method':'/*eof method*/',\n 'externroutines':'/*eof externroutines*/',\n 'routine_defs':'/*eof routine_defs*/',\n 'initf90modhooks':'/*eof initf90modhooks*/',\n 'initf2pywraphooks':'/*eof initf2pywraphooks*/',\n 'initcommonhooks':'/*eof initcommonhooks*/',\n 'latexdoc':'',\n 'restdoc':'',\n 'modnote':{hasnote:'#note#',l_not(hasnote):''},\n }\n ]\n\nroutine_rules={\n 'separatorsfor':sepdict,\n 'body':\"\"\"\n#begintitle#\nstatic char doc_#apiname#[] = \\\"\\\\\\nFunction signature:\\\\n\\\\\\n\\t#docreturn##name#(#docsignatureshort#)\\\\n\\\\\\n#docstrsigns#\\\";\n/* #declfortranroutine# */\nstatic PyObject *#apiname#(const PyObject *capi_self,\n PyObject *capi_args,\n PyObject *capi_keywds,\n #functype# (*f2py_func)(#callprotoargument#)) {\n\\tPyObject * volatile capi_buildvalue = NULL;\n\\tvolatile int f2py_success = 1;\n#decl#\n\\tstatic char *capi_kwlist[] = {#kwlist##kwlistopt##kwlistxa#NULL};\n#usercode#\n#routdebugenter#\n#ifdef F2PY_REPORT_ATEXIT\nf2py_start_clock();\n#endif\n\\tif (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\\\\\n\\t\\t\\\"#argformat#|#keyformat##xaformat#:#pyname#\\\",\\\\\n\\t\\tcapi_kwlist#args_capi##keys_capi##keys_xa#))\\n\\t\\treturn NULL;\n#frompyobj#\n/*end of frompyobj*/\n#ifdef F2PY_REPORT_ATEXIT\nf2py_start_call_clock();\n#endif\n#callfortranroutine#\nif (PyErr_Occurred())\n f2py_success = 0;\n#ifdef F2PY_REPORT_ATEXIT\nf2py_stop_call_clock();\n#endif\n/*end of callfortranroutine*/\n\\t\\tif (f2py_success) {\n#pyobjfrom#\n/*end of pyobjfrom*/\n\\t\\tCFUNCSMESS(\\\"Building return value.\\\\n\\\");\n\\t\\tcapi_buildvalue = Py_BuildValue(\\\"#returnformat#\\\"#return#);\n/*closepyobjfrom*/\n#closepyobjfrom#\n\\t\\t} /*if (f2py_success) after callfortranroutine*/\n/*cleanupfrompyobj*/\n#cleanupfrompyobj#\n\\tif (capi_buildvalue == NULL) {\n#routdebugfailure#\n\\t} else {\n#routdebugleave#\n\\t}\n\\tCFUNCSMESS(\\\"Freeing memory.\\\\n\\\");\n#freemem#\n#ifdef F2PY_REPORT_ATEXIT\nf2py_stop_clock();\n#endif\n\\treturn capi_buildvalue;\n}\n#endtitle#\n\"\"\",\n 'routine_defs':'#routine_def#',\n 'initf2pywraphooks':'#initf2pywraphook#',\n 'externroutines':'#declfortranroutine#',\n 'doc':'#docreturn##name#(#docsignature#)',\n 'docshort':'#docreturn##name#(#docsignatureshort#)',\n 'docs':'\"\\t#docreturn##name#(#docsignature#)\\\\n\"\\n',\n 'need':['arrayobject.h','CFUNCSMESS','MINMAX'],\n 'cppmacros':{debugcapi:'#define DEBUGCFUNCS'},\n 'latexdoc':['\\\\subsection{Wrapper function \\\\texttt{#texname#}}\\n',\n \"\"\"\n\\\\noindent{{}\\\\verb@#docreturn##name#@{}}\\\\texttt{(#latexdocsignatureshort#)}\n#routnote#\n\n#latexdocstrsigns#\n\"\"\"],\n 'restdoc':['Wrapped function ``#name#``\\n'+'-'*80,\n \n ]\n }\n\n################## Rules for C/API function ##############\n\nrout_rules=[\n { # Init\n 'separatorsfor': {'callfortranroutine':'\\n','routdebugenter':'\\n','decl':'\\n',\n 'routdebugleave':'\\n','routdebugfailure':'\\n',\n 'setjmpbuf':' || ',\n 'docstrreq':'\\n','docstropt':'\\n','docstrout':'\\n',\n 'docstrcbs':'\\n','docstrsigns':'\\\\n\"\\n\"',\n 'latexdocstrsigns':'\\n',\n 'latexdocstrreq':'\\n','latexdocstropt':'\\n',\n 'latexdocstrout':'\\n','latexdocstrcbs':'\\n',\n },\n 'kwlist':'','kwlistopt':'','callfortran':'','callfortranappend':'',\n 'docsign':'','docsignopt':'','decl':'/*decl*/',\n 'freemem':'/*freemem*/',\n 'docsignshort':'','docsignoptshort':'',\n 'docstrsigns':'','latexdocstrsigns':'',\n 'docstrreq':'Required arguments:',\n 'docstropt':'Optional arguments:',\n 'docstrout':'Return objects:',\n 'docstrcbs':'Call-back functions:',\n 'latexdocstrreq':'\\\\noindent Required arguments:',\n 'latexdocstropt':'\\\\noindent Optional arguments:',\n 'latexdocstrout':'\\\\noindent Return objects:',\n 'latexdocstrcbs':'\\\\noindent Call-back functions:',\n 'args_capi':'','keys_capi':'','functype':'',\n 'frompyobj':'/*frompyobj*/',\n 'cleanupfrompyobj':['/*end of cleanupfrompyobj*/'], #this list will be reversed\n 'pyobjfrom':'/*pyobjfrom*/',\n 'closepyobjfrom':['/*end of closepyobjfrom*/'], #this list will be reversed\n 'topyarr':'/*topyarr*/','routdebugleave':'/*routdebugleave*/',\n 'routdebugenter':'/*routdebugenter*/',\n 'routdebugfailure':'/*routdebugfailure*/',\n 'callfortranroutine':'/*callfortranroutine*/',\n 'argformat':'','keyformat':'','need_cfuncs':'',\n 'docreturn':'','return':'','returnformat':'','rformat':'',\n 'kwlistxa':'','keys_xa':'','xaformat':'','docsignxa':'','docsignxashort':'',\n 'initf2pywraphook':'',\n 'routnote':{hasnote:'--- #note#',l_not(hasnote):''},\n },{\n 'apiname':'f2py_rout_#modulename#_#name#',\n 'pyname':'#modulename#.#name#',\n 'decl':'',\n '_check':l_not(ismoduleroutine)\n },{\n 'apiname':'f2py_rout_#modulename#_#f90modulename#_#name#',\n 'pyname':'#modulename#.#f90modulename#.#name#',\n 'decl':'',\n '_check':ismoduleroutine\n },{ # Subroutine\n 'functype':'void',\n 'declfortranroutine':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'extern void #fortranname#(#callprotoargument#);',\n ismoduleroutine:'',\n isdummyroutine:''\n },\n 'routine_def':{l_not(l_or(ismoduleroutine,isintent_c,isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isdummyroutine):'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'need':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'F_FUNC'},\n 'callfortranroutine':[\n {debugcapi:[\"\"\"\\tfprintf(stderr,\\\"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)\\'\\\\n\\\");\"\"\"]},\n {hasexternals:\"\"\"\\\n\\t\\tif (#setjmpbuf#) {\n\\t\\t\\tf2py_success = 0;\n\\t\\t} else {\"\"\"},\n {isthreadsafe:'\\t\\t\\tPy_BEGIN_ALLOW_THREADS'},\n {hascallstatement:'''\\t\\t\\t\\t#callstatement#;\n\\t\\t\\t\\t/*(*f2py_func)(#callfortran#);*/'''},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t\\t\\t\\t(*f2py_func)(#callfortran#);'},\n {isthreadsafe:'\\t\\t\\tPy_END_ALLOW_THREADS'},\n {hasexternals:\"\"\"\\t\\t}\"\"\"}\n ],\n '_check':issubroutine,\n },{ # Wrapped function\n 'functype':'void',\n 'declfortranroutine':{l_not(l_or(ismoduleroutine,isdummyroutine)):'extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);',\n isdummyroutine:'',\n },\n\n 'routine_def':{l_not(l_or(ismoduleroutine,isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_WRAPPEDFUNC#(#name_lower#,#NAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n isdummyroutine:'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'initf2pywraphook':{l_not(l_or(ismoduleroutine,isdummyroutine)):'''\n {\n extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void);\n PyObject* o = PyDict_GetItemString(d,\"#name#\");\n PyObject_SetAttrString(o,\"_cpointer\", PyCObject_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL));\n }\n '''},\n 'need':{l_not(l_or(ismoduleroutine,isdummyroutine)):['F_WRAPPEDFUNC','F_FUNC']},\n 'callfortranroutine':[\n {debugcapi:[\"\"\"\\tfprintf(stderr,\\\"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)\\'\\\\n\\\");\"\"\"]},\n {hasexternals:\"\"\"\\\n\\tif (#setjmpbuf#) {\n\\t\\tf2py_success = 0;\n\\t} else {\"\"\"},\n {isthreadsafe:'\\tPy_BEGIN_ALLOW_THREADS'},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t(*f2py_func)(#callfortran#);'},\n {hascallstatement:'\\t#callstatement#;\\n\\t/*(*f2py_func)(#callfortran#);*/'},\n {isthreadsafe:'\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t}'}\n ],\n '_check':isfunction_wrap,\n },{ # Function\n 'functype':'#ctype#',\n 'docreturn':{l_not(isintent_hide):'#rname#,'},\n 'docstrout':'\\t#pydocsignout#',\n 'latexdocstrout':['\\\\item[]{{}\\\\verb@#pydocsignout#@{}}',\n {hasresultnote:'--- #resultnote#'}],\n 'callfortranroutine':[{l_and(debugcapi,isstringfunction):\"\"\"\\\n#ifdef USESCOMPAQFORTRAN\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callcompaqfortran#)\\\\n\\\");\n#else\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\\\n\\\");\n#endif\n\"\"\"},\n {l_and(debugcapi,l_not(isstringfunction)):\"\"\"\\\n\\tfprintf(stderr,\\\"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\\\\n\\\");\n\"\"\"}\n ],\n '_check':l_and(isfunction,l_not(isfunction_wrap))\n },{ # Scalar function\n 'declfortranroutine':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'extern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'extern #ctype# #fortranname#(#callprotoargument#);',\n isdummyroutine:''\n },\n 'routine_def':{l_and(l_not(l_or(ismoduleroutine,isintent_c)),l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c,l_not(isdummyroutine)):'\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},',\n isdummyroutine:'\\t{\\\"#name#\\\",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},',\n },\n 'decl':[{iscomplexfunction_warn:'\\t#ctype# #name#_return_value={0,0};',\n l_not(iscomplexfunction):'\\t#ctype# #name#_return_value=0;'},\n {iscomplexfunction:'\\tPyObject *#name#_return_value_capi = Py_None;'}\n ],\n 'callfortranroutine':[\n {hasexternals:\"\"\"\\\n\\tif (#setjmpbuf#) {\n\\t\\tf2py_success = 0;\n\\t} else {\"\"\"},\n {isthreadsafe:'\\tPy_BEGIN_ALLOW_THREADS'},\n {hascallstatement:'''\\t#callstatement#;\n/*\\t#name#_return_value = (*f2py_func)(#callfortran#);*/\n'''},\n {l_not(l_or(hascallstatement,isdummyroutine)):'\\t#name#_return_value = (*f2py_func)(#callfortran#);'},\n {isthreadsafe:'\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t}'},\n {l_and(debugcapi,iscomplexfunction):'\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value.r,#name#_return_value.i);'},\n {l_and(debugcapi,l_not(iscomplexfunction)):'\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value);'}],\n 'pyobjfrom':{iscomplexfunction:'\\t#name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);'},\n 'need':[{l_not(isdummyroutine):'F_FUNC'},\n {iscomplexfunction:'pyobj_from_#ctype#1'},\n {islong_longfunction:'long_long'},\n {islong_doublefunction:'long_double'}],\n 'returnformat':{l_not(isintent_hide):'#rformat#'},\n 'return':{iscomplexfunction:',#name#_return_value_capi',\n l_not(l_or(iscomplexfunction,isintent_hide)):',#name#_return_value'},\n '_check':l_and(isfunction,l_not(isstringfunction),l_not(isfunction_wrap))\n },{ # String function # in use for --no-wrap\n 'declfortranroutine':'extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);',\n 'routine_def':{l_not(l_or(ismoduleroutine,isintent_c)):\n# '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)F_FUNC(#fortranname#,#FORTRANNAME#),(void *)#apiname#,doc_#apiname#},',\n '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},',\n l_and(l_not(ismoduleroutine),isintent_c):\n# '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(void *)#apiname#,doc_#apiname#},'\n '\\t{\\\"#name#\\\",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},'\n },\n 'decl':['\\t#ctype# #name#_return_value = NULL;',\n '\\tint #name#_return_value_len = 0;'],\n 'callfortran':'#name#_return_value,#name#_return_value_len,',\n 'callfortranroutine':['\\t#name#_return_value_len = #rlength#;',\n '\\tif ((#name#_return_value = (string)malloc(sizeof(char)*(#name#_return_value_len+1))) == NULL) {',\n '\\t\\tPyErr_SetString(PyExc_MemoryError, \\\"out of memory\\\");',\n '\\t\\tf2py_success = 0;',\n '\\t} else {',\n \"\\t\\t(#name#_return_value)[#name#_return_value_len] = '\\\\0';\",\n '\\t}',\n '\\tif (f2py_success) {',\n {hasexternals:\"\"\"\\\n\\t\\tif (#setjmpbuf#) {\n\\t\\t\\tf2py_success = 0;\n\\t\\t} else {\"\"\"},\n {isthreadsafe:'\\t\\tPy_BEGIN_ALLOW_THREADS'},\n \"\"\"\\\n#ifdef USESCOMPAQFORTRAN\n\\t\\t(*f2py_func)(#callcompaqfortran#);\n#else\n\\t\\t(*f2py_func)(#callfortran#);\n#endif\n\"\"\",\n {isthreadsafe:'\\t\\tPy_END_ALLOW_THREADS'},\n {hasexternals:'\\t\\t}'},\n {debugcapi:'\\t\\tfprintf(stderr,\"#routdebugshowvalue#\\\\n\",#name#_return_value_len,#name#_return_value);'},\n '\\t} /* if (f2py_success) after (string)malloc */',\n ],\n 'returnformat':'#rformat#',\n 'return':',#name#_return_value',\n 'freemem':'\\tSTRINGFREE(#name#_return_value);',\n 'need':['F_FUNC','#ctype#','STRINGFREE'],\n '_check':l_and(isstringfunction,l_not(isfunction_wrap)) # ???obsolete\n },\n { # Debugging\n 'routdebugenter':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\\\\n\");',\n 'routdebugleave':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#: successful.\\\\n\");',\n 'routdebugfailure':'\\tfprintf(stderr,\"debug-capi:Python C/API function #modulename#.#name#: failure.\\\\n\");',\n '_check':debugcapi\n }\n ]\n\n################ Rules for arguments ##################\n\ntypedef_need_dict = {islong_long:'long_long',\n islong_double:'long_double',\n islong_complex:'complex_long_double',\n isunsigned_char:'unsigned_char',\n isunsigned_short:'unsigned_short',\n isunsigned:'unsigned',\n isunsigned_long_long:'unsigned_long_long'}\n\naux_rules=[\n {\n 'separatorsfor':sepdict\n },\n { # Common\n 'frompyobj':['\\t/* Processing auxiliary variable #varname# */',\n {debugcapi:'\\tfprintf(stderr,\"#vardebuginfo#\\\\n\");'},],\n 'cleanupfrompyobj':'\\t/* End of cleaning variable #varname# */',\n 'need':typedef_need_dict,\n },\n# Scalars (not complex)\n { # Common\n 'decl':'\\t#ctype# #varname# = 0;',\n 'need':{hasinitvalue:'math.h'},\n 'frompyobj':{hasinitvalue:'\\t#varname# = #init#;'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n },\n {\n 'return':',#varname#',\n 'docstrout':'\\t#pydocsignout#',\n 'docreturn':'#outvarname#,',\n 'returnformat':'#varrformat#',\n '_check':l_and(isscalar,l_not(iscomplex),isintent_out),\n },\n# Complex scalars\n { # Common\n 'decl':'\\t#ctype# #varname#;',\n 'frompyobj': {hasinitvalue:'\\t#varname#.r = #init.r#, #varname#.i = #init.i#;'},\n '_check':iscomplex\n },\n# String\n { # Common\n 'decl':['\\t#ctype# #varname# = NULL;',\n '\\tint slen(#varname#);',\n ],\n 'need':['len..'],\n '_check':isstring\n },\n# Array\n { # Common\n 'decl':['\\t#ctype# *#varname# = NULL;',\n '\\tintp #varname#_Dims[#rank#] = {#rank*[-1]#};',\n '\\tconst int #varname#_Rank = #rank#;',\n ],\n 'need':['len..',{hasinitvalue:'forcomb'},{hasinitvalue:'CFUNCSMESS'}],\n '_check':isarray\n },\n# Scalararray\n { # Common\n '_check':l_and(isarray,l_not(iscomplexarray))\n },{ # Not hidden\n '_check':l_and(isarray,l_not(iscomplexarray),isintent_nothide)\n },\n# Integer*1 array\n {'need':'#ctype#',\n '_check':isint1array,\n '_depend':''\n },\n# Integer*-1 array\n {'need':'#ctype#',\n '_check':isunsigned_chararray,\n '_depend':''\n },\n# Integer*-2 array\n {'need':'#ctype#',\n '_check':isunsigned_shortarray,\n '_depend':''\n },\n# Integer*-8 array\n {'need':'#ctype#',\n '_check':isunsigned_long_longarray,\n '_depend':''\n },\n# Complexarray\n {'need':'#ctype#',\n '_check':iscomplexarray,\n '_depend':''\n },\n# Stringarray\n {\n 'callfortranappend':{isarrayofstrings:'flen(#varname#),'},\n 'need':'string',\n '_check':isstringarray\n }\n ]\n\narg_rules=[\n {\n 'separatorsfor':sepdict\n },\n { # Common\n 'frompyobj':['\\t/* Processing variable #varname# */',\n {debugcapi:'\\tfprintf(stderr,\"#vardebuginfo#\\\\n\");'},],\n 'cleanupfrompyobj':'\\t/* End of cleaning variable #varname# */',\n '_depend':'',\n 'need':typedef_need_dict,\n },\n# Doc signatures\n {\n 'docstropt':{l_and(isoptional,isintent_nothide):'\\t#pydocsign#'},\n 'docstrreq':{l_and(isrequired,isintent_nothide):'\\t#pydocsign#'},\n 'docstrout':{isintent_out:'\\t#pydocsignout#'},\n 'latexdocstropt':{l_and(isoptional,isintent_nothide):['\\\\item[]{{}\\\\verb@#pydocsign#@{}}',\n {hasnote:'--- #note#'}]},\n 'latexdocstrreq':{l_and(isrequired,isintent_nothide):['\\\\item[]{{}\\\\verb@#pydocsign#@{}}',\n {hasnote:'--- #note#'}]},\n 'latexdocstrout':{isintent_out:['\\\\item[]{{}\\\\verb@#pydocsignout#@{}}',\n {l_and(hasnote,isintent_hide):'--- #note#',\n l_and(hasnote,isintent_nothide):'--- See above.'}]},\n 'depend':''\n },\n# Required/Optional arguments\n {\n 'kwlist':'\"#varname#\",',\n 'docsign':'#varname#,',\n '_check':l_and(isintent_nothide,l_not(isoptional))\n },\n {\n 'kwlistopt':'\"#varname#\",',\n 'docsignopt':'#varname#=#showinit#,',\n 'docsignoptshort':'#varname#,',\n '_check':l_and(isintent_nothide,isoptional)\n },\n# Docstring/BuildValue\n {\n 'docreturn':'#outvarname#,',\n 'returnformat':'#varrformat#',\n '_check':isintent_out\n },\n# Externals (call-back functions)\n { # Common\n 'docsignxa':{isintent_nothide:'#varname#_extra_args=(),'},\n 'docsignxashort':{isintent_nothide:'#varname#_extra_args,'},\n 'docstropt':{isintent_nothide:'\\t#varname#_extra_args := () input tuple'},\n 'docstrcbs':'#cbdocstr#',\n 'latexdocstrcbs':'\\\\item[] #cblatexdocstr#',\n 'latexdocstropt':{isintent_nothide:'\\\\item[]{{}\\\\verb@#varname#_extra_args := () input tuple@{}} --- Extra arguments for call-back function {{}\\\\verb@#varname#@{}}.'},\n 'decl':['\\tPyObject *#varname#_capi = Py_None;',\n '\\tPyTupleObject *#varname#_xa_capi = NULL;',\n '\\tPyTupleObject *#varname#_args_capi = NULL;',\n '\\tint #varname#_nofargs_capi = 0;',\n {l_not(isintent_callback):'\\t#cbname#_typedef #varname#_cptr;'}\n ],\n 'kwlistxa':{isintent_nothide:'\"#varname#_extra_args\",'},\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'xaformat':{isintent_nothide:'O!'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'keys_xa':',&PyTuple_Type,&#varname#_xa_capi',\n 'setjmpbuf':'(setjmp(#cbname#_jmpbuf))',\n 'callfortran':{l_not(isintent_callback):'#varname#_cptr,'},\n 'need':['#cbname#','setjmp.h'],\n '_check':isexternal\n },\n {\n 'frompyobj':[{l_not(isintent_callback):\"\"\"\\\nif(PyCObject_Check(#varname#_capi)) {\n #varname#_cptr = PyCObject_AsVoidPtr(#varname#_capi);\n} else {\n #varname#_cptr = #cbname#;\n}\n\"\"\"},{isintent_callback:\"\"\"\\\nif (#varname#_capi==Py_None) {\n #varname#_capi = PyObject_GetAttrString(#modulename#_module,\\\"#varname#\\\");\n if (#varname#_capi) {\n if (#varname#_xa_capi==NULL) {\n if (PyObject_HasAttrString(#modulename#_module,\\\"#varname#_extra_args\\\")) {\n PyObject* capi_tmp = PyObject_GetAttrString(#modulename#_module,\\\"#varname#_extra_args\\\");\n if (capi_tmp)\n #varname#_xa_capi = (PyTupleObject *)PySequence_Tuple(capi_tmp);\n else\n #varname#_xa_capi = (PyTupleObject *)Py_BuildValue(\\\"()\\\");\n if (#varname#_xa_capi==NULL) {\n PyErr_SetString(#modulename#_error,\\\"Failed to convert #modulename#.#varname#_extra_args to tuple.\\\\n\\\");\n return NULL;\n }\n }\n }\n }\n if (#varname#_capi==NULL) {\n PyErr_SetString(#modulename#_error,\\\"Callback #varname# not defined (as an argument or module #modulename# attribute).\\\\n\\\");\n return NULL;\n }\n}\n\"\"\"},\n## {l_not(isintent_callback):\"\"\"\\\n## if (#varname#_capi==Py_None) {\n## printf(\\\"hoi\\\\n\\\");\n## }\n## \"\"\"},\n\"\"\"\\\n\\t#varname#_nofargs_capi = #cbname#_nofargs;\n\\tif (create_cb_arglist(#varname#_capi,#varname#_xa_capi,#maxnofargs#,#nofoptargs#,&#cbname#_nofargs,&#varname#_args_capi,\\\"failed in processing argument list for call-back #varname#.\\\")) {\n\\t\\tjmp_buf #varname#_jmpbuf;\"\"\",\n{debugcapi:[\"\"\"\\\n\\t\\tfprintf(stderr,\\\"debug-capi:Assuming %d arguments; at most #maxnofargs#(-#nofoptargs#) is expected.\\\\n\\\",#cbname#_nofargs);\n\\t\\tCFUNCSMESSPY(\\\"for #varname#=\\\",#cbname#_capi);\"\"\",\n{l_not(isintent_callback):\"\"\"\\t\\tfprintf(stderr,\\\"#vardebugshowvalue# (call-back in C).\\\\n\\\",#cbname#);\"\"\"}]},\n \"\"\"\\\n\\t\\tCFUNCSMESS(\\\"Saving jmpbuf for `#varname#`.\\\\n\\\");\n\\t\\tSWAP(#varname#_capi,#cbname#_capi,PyObject);\n\\t\\tSWAP(#varname#_args_capi,#cbname#_args_capi,PyTupleObject);\n\\t\\tmemcpy(&#varname#_jmpbuf,&#cbname#_jmpbuf,sizeof(jmp_buf));\"\"\",\n ],\n'cleanupfrompyobj':\n\"\"\"\\\n\\t\\tCFUNCSMESS(\\\"Restoring jmpbuf for `#varname#`.\\\\n\\\");\n\\t\\t#cbname#_capi = #varname#_capi;\n\\t\\tPy_DECREF(#cbname#_args_capi);\n\\t\\t#cbname#_args_capi = #varname#_args_capi;\n\\t\\t#cbname#_nofargs = #varname#_nofargs_capi;\n\\t\\tmemcpy(&#cbname#_jmpbuf,&#varname#_jmpbuf,sizeof(jmp_buf));\n\\t}\"\"\",\n 'need':['SWAP','create_cb_arglist'],\n '_check':isexternal,\n '_depend':''\n },\n# Scalars (not complex)\n { # Common\n 'decl':'\\t#ctype# #varname# = 0;',\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#);'},\n 'callfortran':{isintent_c:'#varname#,',l_not(isintent_c):'&#varname#,'},\n 'return':{isintent_out:',#varname#'},\n '_check':l_and(isscalar,l_not(iscomplex))\n },{\n 'need':{hasinitvalue:'math.h'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n #'_depend':''\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'pyobjfrom':{isintent_inout:\"\"\"\\\n\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\\tif (f2py_success) {\"\"\"},\n 'closepyobjfrom':{isintent_inout:\"\\t} /*if (f2py_success) of #varname# pyobjfrom*/\"},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n '_check':l_and(isscalar,l_not(iscomplex),isintent_nothide)\n },{\n 'frompyobj':[\n# hasinitvalue...\n# if pyobj is None:\n# varname = init\n# else\n# from_pyobj(varname)\n# \n# isoptional and noinitvalue...\n# if pyobj is not None:\n# from_pyobj(varname)\n# else:\n# varname is uninitialized\n#\n# ...\n# from_pyobj(varname)\n#\n {hasinitvalue:'\\tif (#varname#_capi == Py_None) #varname# = #init#; else',\n '_depend':''},\n {l_and(isoptional,l_not(hasinitvalue)):'\\tif (#varname#_capi != Py_None)',\n '_depend':''}, \n {l_not(islogical):'''\\\n\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#pyname#() #nth# (#varname#) can\\'t be converted to #ctype#\");\n\\tif (f2py_success) {'''},\n {islogical:'''\\\n\\t\\t#varname# = (#ctype#)PyObject_IsTrue(#varname#_capi);\n\\t\\tf2py_success = 1;\n\\tif (f2py_success) {'''},\n ],\n 'cleanupfrompyobj':'\\t} /*if (f2py_success) of #varname#*/',\n 'need':{l_not(islogical):'#ctype#_from_pyobj'},\n '_check':l_and(isscalar,l_not(iscomplex),isintent_nothide),\n '_depend':''\n# },{ # Hidden\n# '_check':l_and(isscalar,l_not(iscomplex),isintent_hide)\n },{ # Hidden\n 'frompyobj':{hasinitvalue:'\\t#varname# = #init#;'},\n 'need':typedef_need_dict,\n '_check':l_and(isscalar,l_not(iscomplex),isintent_hide),\n '_depend':''\n },{ # Common\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#);'},\n '_check':l_and(isscalar,l_not(iscomplex)),\n '_depend':''\n },\n# Complex scalars\n { # Common\n 'decl':'\\t#ctype# #varname#;',\n 'callfortran':{isintent_c:'#varname#,',l_not(isintent_c):'&#varname#,'},\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#.r,#varname#.i);'},\n 'return':{isintent_out:',#varname#_capi'},\n '_check':iscomplex\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n 'pyobjfrom':{isintent_inout:\"\"\"\\\n\\t\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);\n\\t\\tif (f2py_success) {\"\"\"},\n 'closepyobjfrom':{isintent_inout:\"\\t\\t} /*if (f2py_success) of #varname# pyobjfrom*/\"},\n '_check':l_and(iscomplex,isintent_nothide)\n },{\n 'frompyobj':[{hasinitvalue:'\\tif (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} else'},\n {l_and(isoptional,l_not(hasinitvalue)):'\\tif (#varname#_capi != Py_None)'},\n# '\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#ctype#_from_pyobj failed in converting #nth# `#varname#\\' of #pyname# to C #ctype#\\\\n\");'\n '\\t\\tf2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,\"#pyname#() #nth# (#varname#) can\\'t be converted to #ctype#\");'\n '\\n\\tif (f2py_success) {'],\n 'cleanupfrompyobj':'\\t} /*if (f2py_success) of #varname# frompyobj*/',\n 'need':['#ctype#_from_pyobj'],\n '_check':l_and(iscomplex,isintent_nothide),\n '_depend':''\n },{ # Hidden\n 'decl':{isintent_out:'\\tPyObject *#varname#_capi = Py_None;'},\n '_check':l_and(iscomplex,isintent_hide)\n },{\n 'frompyobj': {hasinitvalue:'\\t#varname#.r = #init.r#, #varname#.i = #init.i#;'},\n '_check':l_and(iscomplex,isintent_hide),\n '_depend':''\n },{ # Common\n 'pyobjfrom':{isintent_out:'\\t#varname#_capi = pyobj_from_#ctype#1(#varname#);'},\n 'need':['pyobj_from_#ctype#1'],\n '_check':iscomplex\n },{\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",#varname#.r,#varname#.i);'},\n '_check':iscomplex,\n '_depend':''\n },\n# String\n { # Common\n 'decl':['\\t#ctype# #varname# = NULL;',\n '\\tint slen(#varname#);',\n '\\tPyObject *#varname#_capi = Py_None;'],\n 'callfortran':'#varname#,',\n 'callfortranappend':'slen(#varname#),',\n 'pyobjfrom':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",slen(#varname#),#varname#);'},\n# 'freemem':'\\tSTRINGFREE(#varname#);',\n 'return':{isintent_out:',#varname#'},\n 'need':['len..'],#'STRINGFREE'],\n '_check':isstring\n },{ # Common\n 'frompyobj':\"\"\"\\\n\\tslen(#varname#) = #length#;\n\\tf2py_success = #ctype#_from_pyobj(&#varname#,&slen(#varname#),#init#,#varname#_capi,\\\"#ctype#_from_pyobj failed in converting #nth# `#varname#\\' of #pyname# to C #ctype#\\\");\n\\tif (f2py_success) {\"\"\",\n 'cleanupfrompyobj':\"\"\"\\\n\\t\\tSTRINGFREE(#varname#);\n\\t} /*if (f2py_success) of #varname#*/\"\"\",\n 'need':['#ctype#_from_pyobj','len..','STRINGFREE'],\n '_check':isstring,\n '_depend':''\n },{ # Not hidden\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n 'pyobjfrom':{isintent_inout:'''\\\n\\tf2py_success = try_pyarr_from_#ctype#(#varname#_capi,#varname#);\n\\tif (f2py_success) {'''},\n 'closepyobjfrom':{isintent_inout:'\\t} /*if (f2py_success) of #varname# pyobjfrom*/'},\n 'need':{isintent_inout:'try_pyarr_from_#ctype#'},\n '_check':l_and(isstring,isintent_nothide)\n },{ # Hidden\n '_check':l_and(isstring,isintent_hide)\n },{\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\"#vardebugshowvalue#\\\\n\",slen(#varname#),#varname#);'},\n '_check':isstring,\n '_depend':''\n },\n# Array\n { # Common\n 'decl':['\\t#ctype# *#varname# = NULL;',\n '\\tintp #varname#_Dims[#rank#] = {#rank*[-1]#};',\n '\\tconst int #varname#_Rank = #rank#;',\n '\\tPyArrayObject *capi_#varname#_tmp = NULL;',\n '\\tint capi_#varname#_intent = 0;',\n ],\n 'callfortran':'#varname#,',\n 'return':{isintent_out:',capi_#varname#_tmp'},\n 'need':'len..',\n '_check':isarray\n },{ # intent(overwrite) array\n 'decl':'\\tint capi_overwrite_#varname# = 1;',\n 'kwlistxa':'\"overwrite_#varname#\",',\n 'xaformat':'i',\n 'keys_xa':',&capi_overwrite_#varname#',\n 'docsignxa':'overwrite_#varname#=1,',\n 'docsignxashort':'overwrite_#varname#,',\n 'docstropt':'\\toverwrite_#varname# := 1 input int',\n '_check':l_and(isarray,isintent_overwrite),\n },{\n 'frompyobj':'\\tcapi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);',\n '_check':l_and(isarray,isintent_overwrite),\n '_depend':'',\n },\n { # intent(copy) array\n 'decl':'\\tint capi_overwrite_#varname# = 0;',\n 'kwlistxa':'\"overwrite_#varname#\",',\n 'xaformat':'i',\n 'keys_xa':',&capi_overwrite_#varname#',\n 'docsignxa':'overwrite_#varname#=0,',\n 'docsignxashort':'overwrite_#varname#,',\n 'docstropt':'\\toverwrite_#varname# := 0 input int',\n '_check':l_and(isarray,isintent_copy),\n },{\n 'frompyobj':'\\tcapi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);',\n '_check':l_and(isarray,isintent_copy),\n '_depend':'',\n },{ \n 'need':[{hasinitvalue:'forcomb'},{hasinitvalue:'CFUNCSMESS'}],\n '_check':isarray,\n '_depend':''\n },{ # Not hidden\n 'decl':'\\tPyObject *#varname#_capi = Py_None;',\n 'argformat':{isrequired:'O'},\n 'keyformat':{isoptional:'O'},\n 'args_capi':{isrequired:',&#varname#_capi'},\n 'keys_capi':{isoptional:',&#varname#_capi'},\n# 'pyobjfrom':{isintent_inout:\"\"\"\\\n# /* Partly because of the following hack, intent(inout) is depreciated,\n# Use intent(in,out) instead.\n \n# \\tif ((#varname#_capi != Py_None) && PyArray_Check(#varname#_capi) \\\\\n# \\t\\t&& (#varname#_capi != (PyObject *)capi_#varname#_tmp)) {\n# \\t\\tif (((PyArrayObject *)#varname#_capi)->nd != capi_#varname#_tmp->nd) {\n# \\t\\t\\tif (#varname#_capi != capi_#varname#_tmp->base)\n# \\t\\t\\t\\tcopy_ND_array((PyArrayObject *)capi_#varname#_tmp->base,(PyArrayObject *)#varname#_capi);\n# \\t\\t} else\n# \\t\\t\\tcopy_ND_array(capi_#varname#_tmp,(PyArrayObject *)#varname#_capi);\n# \\t}\n# */\n# \"\"\"},\n# 'need':{isintent_inout:'copy_ND_array'},\n '_check':l_and(isarray,isintent_nothide)\n },{\n 'frompyobj':['\\t#setdims#;',\n '\\tcapi_#varname#_intent |= #intent#;',\n {isintent_hide:'\\tcapi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,Py_None);'},\n {isintent_nothide:'\\tcapi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,#varname#_capi);'},\n \"\"\"\\\n\\tif (capi_#varname#_tmp == NULL) {\n\\t\\tif (!PyErr_Occurred())\n\\t\\t\\tPyErr_SetString(#modulename#_error,\\\"failed in converting #nth# `#varname#\\' of #pyname# to C/Fortran array\\\" );\n\\t} else {\n\\t\\t#varname# = (#ctype# *)(capi_#varname#_tmp->data);\n\"\"\",\n{hasinitvalue:[\n {isintent_nothide:'\\tif (#varname#_capi == Py_None) {'},\n {isintent_hide:'\\t{'},\n {iscomplexarray:'\\t\\t#ctype# capi_c;'},\n \"\"\"\\\n\\t\\tint *_i,capi_i=0;\n\\t\\tCFUNCSMESS(\\\"#name#: Initializing #varname#=#init#\\\\n\\\");\n\\t\\tif (initforcomb(capi_#varname#_tmp->dimensions,capi_#varname#_tmp->nd,1)) {\n\\t\\t\\twhile ((_i = nextforcomb()))\n\\t\\t\\t\\t#varname#[capi_i++] = #init#; /* fortran way */\n\\t\\t} else {\n\\t\\t\\tif (!PyErr_Occurred())\n\\t\\t\\t\\tPyErr_SetString(#modulename#_error,\\\"Initialization of #nth# #varname# failed (initforcomb).\\\");\n\\t\\t\\tf2py_success = 0;\n\\t\\t}\n\\t}\n\\tif (f2py_success) {\"\"\"]},\n ],\n 'cleanupfrompyobj':[ # note that this list will be reversed\n '\\t} /*if (capi_#varname#_tmp == NULL) ... else of #varname#*/',\n {l_not(l_or(isintent_out,isintent_hide)):\"\"\"\\\n\\tif((PyObject *)capi_#varname#_tmp!=#varname#_capi) {\n\\t\\tPy_XDECREF(capi_#varname#_tmp); }\"\"\"},\n {l_and(isintent_hide,l_not(isintent_out)):\"\"\"\\t\\tPy_XDECREF(capi_#varname#_tmp);\"\"\"},\n {hasinitvalue:'\\t} /*if (f2py_success) of #varname# init*/'},\n ],\n '_check':isarray,\n '_depend':''\n },\n# { # Hidden\n# 'freemem':{l_not(isintent_out):'\\tPy_XDECREF(capi_#varname#_tmp);'},\n# '_check':l_and(isarray,isintent_hide)\n# },\n# Scalararray\n { # Common\n '_check':l_and(isarray,l_not(iscomplexarray))\n },{ # Not hidden\n '_check':l_and(isarray,l_not(iscomplexarray),isintent_nothide)\n },\n# Integer*1 array\n {'need':'#ctype#',\n '_check':isint1array,\n '_depend':''\n },\n# Integer*-1 array\n {'need':'#ctype#',\n '_check':isunsigned_chararray,\n '_depend':''\n },\n# Integer*-2 array\n {'need':'#ctype#',\n '_check':isunsigned_shortarray,\n '_depend':''\n },\n# Integer*-8 array\n {'need':'#ctype#',\n '_check':isunsigned_long_longarray,\n '_depend':''\n },\n# Complexarray\n {'need':'#ctype#',\n '_check':iscomplexarray,\n '_depend':''\n },\n# Stringarray\n {\n 'callfortranappend':{isarrayofstrings:'flen(#varname#),'},\n 'need':'string',\n '_check':isstringarray\n }\n ]\n\n################# Rules for checking ###############\n\ncheck_rules=[\n {\n 'frompyobj':{debugcapi:'\\tfprintf(stderr,\\\"debug-capi:Checking `#check#\\'\\\\n\\\");'},\n 'need':'len..'\n },{\n 'frompyobj':'\\tCHECKSCALAR(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\",\\\"#varshowvalue#\\\",#varname#) {',\n 'cleanupfrompyobj':'\\t} /*CHECKSCALAR(#check#)*/',\n 'need':'CHECKSCALAR',\n '_check':l_and(isscalar,l_not(iscomplex)),\n '_break':''\n },{\n 'frompyobj':'\\tCHECKSTRING(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\",\\\"#varshowvalue#\\\",#varname#) {',\n 'cleanupfrompyobj':'\\t} /*CHECKSTRING(#check#)*/',\n 'need':'CHECKSTRING',\n '_check':isstring,\n '_break':''\n },{\n 'need':'CHECKARRAY',\n 'frompyobj':'\\tCHECKARRAY(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\") {',\n 'cleanupfrompyobj':'\\t} /*CHECKARRAY(#check#)*/',\n '_check':isarray,\n '_break':''\n },{\n 'need':'CHECKGENERIC',\n 'frompyobj':'\\tCHECKGENERIC(#check#,\\\"#check#\\\",\\\"#nth# #varname#\\\") {',\n 'cleanupfrompyobj':'\\t} /*CHECKGENERIC(#check#)*/',\n }\n]\n\n########## Applying the rules. No need to modify what follows #############\n\n#################### Build C/API module #######################\n\ndef buildmodule(m,um):\n \"\"\"\n Return \n \"\"\"\n global f2py_version,options\n outmess('\\tBuilding module \"%s\"...\\n'%(m['name']))\n ret = {}\n mod_rules=defmod_rules[:]\n vrd=modsign2map(m)\n rd=dictappend({'f2py_version':f2py_version},vrd)\n funcwrappers = []\n funcwrappers2 = [] # F90 codes\n for n in m['interfaced']:\n nb=None\n for bi in m['body']:\n if not bi['block']=='interface':\n errmess('buildmodule: Expected interface block. Skipping.\\n')\n continue\n for b in bi['body']:\n if b['name']==n: nb=b;break\n \n if not nb:\n errmess('buildmodule: Could not found the body of interfaced routine \"%s\". Skipping.\\n'%(n))\n continue\n nb_list = [nb]\n if nb.has_key('entry'):\n for k,a in nb['entry'].items():\n nb1 = copy.deepcopy(nb)\n del nb1['entry']\n nb1['name'] = k\n nb1['args'] = a\n nb_list.append(nb1)\n for nb in nb_list:\n api,wrap=buildapi(nb)\n if wrap:\n if ismoduleroutine(nb):\n funcwrappers2.append(wrap)\n else:\n funcwrappers.append(wrap)\n ar=applyrules(api,vrd)\n rd=dictappend(rd,ar)\n\n # Construct COMMON block support\n cr,wrap = common_rules.buildhooks(m)\n if wrap:\n funcwrappers.append(wrap)\n ar=applyrules(cr,vrd)\n rd=dictappend(rd,ar)\n\n # Construct F90 module support\n mr,wrap = f90mod_rules.buildhooks(m)\n if wrap:\n funcwrappers2.append(wrap)\n ar=applyrules(mr,vrd)\n rd=dictappend(rd,ar)\n\n for u in um:\n ar=use_rules.buildusevars(u,m['use'][u['name']])\n rd=dictappend(rd,ar)\n\n needs=cfuncs.get_needs()\n code={}\n for n in needs.keys():\n code[n]=[]\n for k in needs[n]:\n c=''\n if cfuncs.includes0.has_key(k): c=cfuncs.includes0[k]\n elif cfuncs.includes.has_key(k): c=cfuncs.includes[k]\n elif cfuncs.userincludes.has_key(k): c=cfuncs.userincludes[k]\n elif cfuncs.typedefs.has_key(k): c=cfuncs.typedefs[k]\n elif cfuncs.typedefs_generated.has_key(k):\n c=cfuncs.typedefs_generated[k]\n elif cfuncs.cppmacros.has_key(k): c=cfuncs.cppmacros[k]\n elif cfuncs.cfuncs.has_key(k): c=cfuncs.cfuncs[k]\n elif cfuncs.callbacks.has_key(k): c=cfuncs.callbacks[k]\n elif cfuncs.f90modhooks.has_key(k): c=cfuncs.f90modhooks[k]\n elif cfuncs.commonhooks.has_key(k): c=cfuncs.commonhooks[k]\n else: errmess('buildmodule: unknown need %s.\\n'%(`k`));continue\n code[n].append(c)\n mod_rules.append(code)\n for r in mod_rules:\n if (r.has_key('_check') and r['_check'](m)) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,m)\n rd=dictappend(rd,ar)\n ar=applyrules(module_rules,rd)\n\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.c')\n ret['csrc'] = fn\n f=open(fn,'w')\n f.write(string.replace(ar['modulebody'],'\\t',2*' '))\n f.close()\n outmess('\\tWrote C/API module \"%s\" to file \"%s/%smodule.c\"\\n'%(m['name'],options['buildpath'],vrd['modulename']))\n\n if options['dorestdoc']:\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.rest')\n f=open(fn,'w')\n f.write('.. -*- rest -*-\\n')\n f.write(string.join(ar['restdoc'],'\\n'))\n f.close()\n outmess('\\tReST Documentation is saved to file \"%s/%smodule.rest\"\\n'%(options['buildpath'],vrd['modulename']))\n if options['dolatexdoc']:\n fn = os.path.join(options['buildpath'],vrd['modulename']+'module.tex')\n ret['ltx'] = fn\n f=open(fn,'w')\n f.write('%% This file is auto-generated with f2py (version:%s)\\n'%(f2py_version))\n if not options.has_key('shortlatex'):\n f.write('\\\\documentclass{article}\\n\\\\usepackage{a4wide}\\n\\\\begin{document}\\n\\\\tableofcontents\\n\\n')\n f.write(string.join(ar['latexdoc'],'\\n'))\n if not options.has_key('shortlatex'):\n f.write('\\\\end{document}')\n f.close()\n outmess('\\tDocumentation is saved to file \"%s/%smodule.tex\"\\n'%(options['buildpath'],vrd['modulename']))\n if funcwrappers:\n wn = os.path.join(options['buildpath'],'%s-f2pywrappers.f'%(vrd['modulename']))\n ret['fsrc'] = wn\n f=open(wn,'w')\n f.write('C -*- fortran -*-\\n')\n f.write('C This file is autogenerated with f2py (version:%s)\\n'%(f2py_version))\n f.write('C It contains Fortran 77 wrappers to fortran functions.\\n')\n lines = []\n for l in string.split(string.join(funcwrappers,'\\n\\n')+'\\n','\\n'):\n if l and l[0]==' ':\n while len(l)>=66:\n lines.append(l[:66]+'\\n &')\n l = l[66:]\n lines.append(l+'\\n')\n else: lines.append(l+'\\n')\n lines = string.join(lines,'').replace('\\n &\\n','\\n')\n f.write(lines)\n f.close()\n outmess('\\tFortran 77 wrappers are saved to \"%s\"\\n'%(wn))\n if funcwrappers2:\n wn = os.path.join(options['buildpath'],'%s-f2pywrappers2.f90'%(vrd['modulename']))\n ret['fsrc'] = wn\n f=open(wn,'w')\n f.write('! -*- f90 -*-\\n')\n f.write('! This file is autogenerated with f2py (version:%s)\\n'%(f2py_version))\n f.write('! It contains Fortran 90 wrappers to fortran functions.\\n')\n lines = []\n for l in string.split(string.join(funcwrappers2,'\\n\\n')+'\\n','\\n'):\n if len(l)>72 and l[0]==' ':\n lines.append(l[:72]+'&\\n &')\n l = l[72:]\n while len(l)>66:\n lines.append(l[:66]+'&\\n &')\n l = l[66:]\n lines.append(l+'\\n')\n else: lines.append(l+'\\n')\n lines = string.join(lines,'').replace('\\n &\\n','\\n')\n f.write(lines)\n f.close()\n outmess('\\tFortran 90 wrappers are saved to \"%s\"\\n'%(wn))\n return ret\n\n################## Build C/API function #############\n\nstnd={1:'st',2:'nd',3:'rd',4:'th',5:'th',6:'th',7:'th',8:'th',9:'th',0:'th'}\ndef buildapi(rout):\n rout,wrap = func2subr.assubr(rout)\n args,depargs=getargs2(rout)\n capi_maps.depargs=depargs\n var=rout['vars']\n auxvars = [a for a in var.keys() if isintent_aux(var[a])]\n \n if ismoduleroutine(rout):\n outmess('\\t\\t\\tConstructing wrapper function \"%s.%s\"...\\n'%(rout['modulename'],rout['name']))\n else:\n outmess('\\t\\tConstructing wrapper function \"%s\"...\\n'%(rout['name']))\n # Routine\n vrd=routsign2map(rout)\n rd=dictappend({},vrd)\n for r in rout_rules:\n if (r.has_key('_check') and r['_check'](rout)) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,rout)\n rd=dictappend(rd,ar)\n\n # Args\n nth,nthk=0,0\n savevrd={}\n for a in args:\n vrd=sign2map(a,var[a])\n if isintent_aux(var[a]):\n _rules = aux_rules\n else:\n _rules = arg_rules\n if not isintent_hide(var[a]):\n if not isoptional(var[a]):\n nth=nth+1\n vrd['nth']=`nth`+stnd[nth%10]+' argument'\n else:\n nthk=nthk+1\n vrd['nth']=`nthk`+stnd[nthk%10]+' keyword'\n else: vrd['nth']='hidden' \n savevrd[a]=vrd\n for r in _rules:\n if r.has_key('_depend'): continue\n if (r.has_key('_check') and r['_check'](var[a])) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,var[a])\n rd=dictappend(rd,ar)\n if r.has_key('_break'): break\n for a in depargs:\n if isintent_aux(var[a]):\n _rules = aux_rules\n else:\n _rules = arg_rules\n vrd=savevrd[a]\n for r in _rules:\n if not r.has_key('_depend'): continue\n if (r.has_key('_check') and r['_check'](var[a])) or (not r.has_key('_check')):\n ar=applyrules(r,vrd,var[a])\n rd=dictappend(rd,ar)\n if r.has_key('_break'): break\n if var[a].has_key('check'):\n for c in var[a]['check']:\n vrd['check']=c\n ar=applyrules(check_rules,vrd,var[a])\n rd=dictappend(rd,ar)\n if type(rd['cleanupfrompyobj']) is types.ListType:\n rd['cleanupfrompyobj'].reverse()\n if type(rd['closepyobjfrom']) is types.ListType:\n rd['closepyobjfrom'].reverse()\n rd['docsignature']=stripcomma(replace('#docsign##docsignopt##docsignxa#',\n {'docsign':rd['docsign'],\n 'docsignopt':rd['docsignopt'],\n 'docsignxa':rd['docsignxa']}))\n optargs=stripcomma(replace('#docsignopt##docsignxa#',\n {'docsignxa':rd['docsignxashort'],\n 'docsignopt':rd['docsignoptshort']}\n ))\n if optargs=='':\n rd['docsignatureshort']=stripcomma(replace('#docsign#',{'docsign':rd['docsign']}))\n else:\n rd['docsignatureshort']=replace('#docsign#[#docsignopt#]',\n {'docsign':rd['docsign'],\n 'docsignopt':optargs,\n })\n rd['latexdocsignatureshort']=string.replace(rd['docsignatureshort'],'_','\\\\_')\n rd['latexdocsignatureshort']=string.replace(rd['latexdocsignatureshort'],',',', ')\n cfs=stripcomma(replace('#callfortran##callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))\n if len(rd['callfortranappend'])>1:\n rd['callcompaqfortran']=stripcomma(replace('#callfortran# 0,#callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))\n else:\n rd['callcompaqfortran']=cfs\n rd['callfortran']=cfs\n if type(rd['docreturn'])==types.ListType:\n rd['docreturn']=stripcomma(replace('#docreturn#',{'docreturn':rd['docreturn']}))+' = '\n rd['docstrsigns']=[]\n rd['latexdocstrsigns']=[]\n for k in ['docstrreq','docstropt','docstrout','docstrcbs']:\n if rd.has_key(k) and type(rd[k])==types.ListType:\n rd['docstrsigns']=rd['docstrsigns']+rd[k]\n k='latex'+k\n if rd.has_key(k) and type(rd[k])==types.ListType:\n rd['latexdocstrsigns']=rd['latexdocstrsigns']+rd[k][0:1]+\\\n ['\\\\begin{description}']+rd[k][1:]+\\\n ['\\\\end{description}']\n ar=applyrules(routine_rules,rd)\n if ismoduleroutine(rout):\n outmess('\\t\\t\\t %s\\n'%(ar['docshort']))\n else:\n outmess('\\t\\t %s\\n'%(ar['docshort']))\n return ar,wrap\n\n\n#################### EOF rules.py #######################\n", + "methods": [ + { + "name": "buildmodule", + "long_name": "buildmodule( m , um )", + "filename": "rules.py", + "nloc": 141, + "complexity": 45, + "token_count": 1298, + "parameters": [ + "m", + "um" + ], + "start_line": 1081, + "end_line": 1233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 153, + "top_nesting_level": 0 + }, + { + "name": "buildapi", + "long_name": "buildapi( rout )", + "filename": "rules.py", + "nloc": 101, + "complexity": 39, + "token_count": 977, + "parameters": [ + "rout" + ], + "start_line": 1238, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "buildmodule", + "long_name": "buildmodule( m , um )", + "filename": "rules.py", + "nloc": 141, + "complexity": 45, + "token_count": 1298, + "parameters": [ + "m", + "um" + ], + "start_line": 1081, + "end_line": 1233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 153, + "top_nesting_level": 0 + }, + { + "name": "buildapi", + "long_name": "buildapi( rout )", + "filename": "rules.py", + "nloc": 101, + "complexity": 39, + "token_count": 977, + "parameters": [ + "rout" + ], + "start_line": 1238, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 1221, + "complexity": 84, + "token_count": 5900, + "diff_parsed": { + "added": [ + "\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy)\\\");" + ], + "deleted": [ + "\\t\\tPy_FatalError(\\\"can't initialize module #modulename# (failed to import numpy.base)\\\");" + ] + } + }, + { + "old_path": "numpy/f2py/tests/array_from_pyobj/tests/test_array_from_pyobj.py", + "new_path": "numpy/f2py/tests/array_from_pyobj/tests/test_array_from_pyobj.py", + "filename": "test_array_from_pyobj.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -2,8 +2,8 @@\n import sys\n import copy\n \n-from numpy.test.testing import *\n-from numpy.base import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros\n+from numpy.testing import *\n+from numpy import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros\n set_package_path()\n from array_from_pyobj import wrap\n del sys.path[0]\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import unittest\nimport sys\nimport copy\n\nfrom numpy.testing import *\nfrom numpy import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros\nset_package_path()\nfrom array_from_pyobj import wrap\ndel sys.path[0]\n\ndef flags_info(arr):\n flags = wrap.array_attrs(arr)[6]\n return flags2names(flags)\n\ndef flags2names(flags):\n info = []\n for flagname in ['CONTIGUOUS','FORTRAN','OWNDATA','ENSURECOPY',\n 'ENSUREARRAY','ALIGNED','NOTSWAPPED','WRITEABLE',\n 'UPDATEIFCOPY','BEHAVED_FLAGS','BEHAVED_FLAGS_RO',\n 'CARRAY_FLAGS','FARRAY_FLAGS'\n ]:\n if abs(flags) & getattr(wrap,flagname):\n info.append(flagname)\n return info\n\nclass Intent:\n def __init__(self,intent_list=[]):\n self.intent_list = intent_list[:]\n flags = 0\n for i in intent_list:\n if i=='optional':\n flags |= wrap.F2PY_OPTIONAL\n else:\n flags |= getattr(wrap,'F2PY_INTENT_'+i.upper())\n self.flags = flags\n def __getattr__(self,name):\n name = name.lower()\n if name=='in_': name='in'\n return self.__class__(self.intent_list+[name])\n def __str__(self):\n return 'intent(%s)' % (','.join(self.intent_list))\n def __repr__(self):\n return 'Intent(%r)' % (self.intent_list)\n def is_intent(self,*names):\n for name in names:\n if name not in self.intent_list:\n return False\n return True\n def is_intent_exact(self,*names):\n return len(self.intent_list)==len(names) and self.is_intent(*names)\n\nintent = Intent()\n\nclass Type(object):\n\n _type_names = ['BOOL','BYTE','UBYTE','SHORT','USHORT','INT','UINT',\n 'LONG','ULONG','LONGLONG','ULONGLONG',\n 'FLOAT','DOUBLE','LONGDOUBLE','CFLOAT','CDOUBLE',\n 'CLONGDOUBLE']\n _type_cache = {}\n\n _cast_dict = {'BOOL':['BOOL']}\n _cast_dict['BYTE'] = _cast_dict['BOOL'] + ['BYTE']\n _cast_dict['UBYTE'] = _cast_dict['BOOL'] + ['UBYTE']\n _cast_dict['BYTE'] = ['BYTE']\n _cast_dict['UBYTE'] = ['UBYTE']\n _cast_dict['SHORT'] = _cast_dict['BYTE'] + ['UBYTE','SHORT']\n _cast_dict['USHORT'] = _cast_dict['UBYTE'] + ['BYTE','USHORT']\n _cast_dict['INT'] = _cast_dict['SHORT'] + ['USHORT','INT']\n _cast_dict['UINT'] = _cast_dict['USHORT'] + ['SHORT','UINT']\n\n _cast_dict['LONG'] = _cast_dict['INT'] + ['LONG']\n _cast_dict['ULONG'] = _cast_dict['UINT'] + ['ULONG']\n\n _cast_dict['LONGLONG'] = _cast_dict['LONG'] + ['LONGLONG']\n _cast_dict['ULONGLONG'] = _cast_dict['ULONG'] + ['ULONGLONG']\n\n _cast_dict['FLOAT'] = _cast_dict['SHORT'] + ['USHORT','FLOAT']\n _cast_dict['DOUBLE'] = _cast_dict['INT'] + ['UINT','FLOAT','DOUBLE']\n _cast_dict['LONGDOUBLE'] = _cast_dict['LONG'] + ['ULONG','FLOAT','DOUBLE','LONGDOUBLE']\n\n _cast_dict['CFLOAT'] = _cast_dict['FLOAT'] + ['CFLOAT']\n _cast_dict['CDOUBLE'] = _cast_dict['DOUBLE'] + ['CFLOAT','CDOUBLE']\n _cast_dict['CLONGDOUBLE'] = _cast_dict['LONGDOUBLE'] + ['CFLOAT','CDOUBLE','CLONGDOUBLE']\n \n \n def __new__(cls,name):\n if isinstance(name,type):\n dtype = name\n name = None\n for n,i in typeinfo.items():\n if isinstance(i,tuple) and dtype is i[-1]:\n name = n\n break\n obj = cls._type_cache.get(name.upper(),None)\n if obj is not None:\n return obj\n obj = object.__new__(cls)\n obj._init(name)\n cls._type_cache[name.upper()] = obj\n return obj\n \n def _init(self,name):\n self.NAME = name.upper()\n self.type_num = getattr(wrap,'PyArray_'+self.NAME)\n assert_equal(self.type_num,typeinfo[self.NAME][1])\n self.dtype = typeinfo[self.NAME][-1]\n self.elsize = typeinfo[self.NAME][2] / 8\n self.dtypechar = typeinfo[self.NAME][0]\n\n def cast_types(self):\n return map(self.__class__,self._cast_dict[self.NAME])\n\n def all_types(self):\n return map(self.__class__,self._type_names)\n\n def smaller_types(self):\n bits = typeinfo[self.NAME][3]\n types = []\n for name in self._type_names:\n if typeinfo[name][3]bits:\n types.append(Type(name))\n return types\n\nclass Array:\n def __init__(self,typ,dims,intent,obj):\n self.type = typ\n self.dims = dims\n self.intent = intent\n self.obj_copy = copy.deepcopy(obj)\n self.obj = obj\n\n # arr.dtypechar may be different from typ.dtypechar\n self.arr = wrap.call(typ.type_num,dims,intent.flags,obj)\n\n self.arr_attr = wrap.array_attrs(self.arr)\n\n if len(dims)>1:\n if self.intent.is_intent('c'):\n assert intent.flags & wrap.F2PY_INTENT_C\n assert not self.arr.flags['FORTRAN'],`self.arr.flags,obj.flags`\n assert self.arr.flags['CONTIGUOUS']\n assert not self.arr_attr[6] & wrap.FORTRAN\n else:\n assert not intent.flags & wrap.F2PY_INTENT_C\n assert self.arr.flags['FORTRAN']\n assert not self.arr.flags['CONTIGUOUS']\n assert self.arr_attr[6] & wrap.FORTRAN\n\n if obj is None:\n self.pyarr = None\n self.pyarr_attr = None\n return\n\n if intent.is_intent('cache'):\n assert isinstance(obj,ndarray),`type(obj)`\n self.pyarr = array(obj).reshape(*dims)\n \n else:\n self.pyarr = array(array(obj,\n dtype = typ.dtypechar).reshape(*dims),\n fortran=not self.intent.is_intent('c'))\n assert self.pyarr.dtypechar==typ.dtypechar,\\\n `self.pyarr.dtypechar,typ.dtypechar`\n assert self.pyarr.flags['OWNDATA']\n self.pyarr_attr = wrap.array_attrs(self.pyarr)\n\n if len(dims)>1:\n if self.intent.is_intent('c'):\n assert not self.pyarr.flags['FORTRAN']\n assert self.pyarr.flags['CONTIGUOUS']\n assert not self.pyarr_attr[6] & wrap.FORTRAN\n else:\n assert self.pyarr.flags['FORTRAN']\n assert not self.pyarr.flags['CONTIGUOUS']\n assert self.pyarr_attr[6] & wrap.FORTRAN\n\n\n assert self.arr_attr[1]==self.pyarr_attr[1] # nd\n assert self.arr_attr[2]==self.pyarr_attr[2] # dimensions\n if self.arr_attr[1]<=1:\n assert self.arr_attr[3]==self.pyarr_attr[3],\\\n `self.arr_attr[3],self.pyarr_attr[3],self.arr.tostring(),self.pyarr.tostring()` # strides\n assert self.arr_attr[5][-2:]==self.pyarr_attr[5][-2:],\\\n `self.arr_attr[5],self.pyarr_attr[5]` # descr\n assert self.arr_attr[6]==self.pyarr_attr[6],\\\n `self.arr_attr[6],self.pyarr_attr[6],flags2names(0*self.arr_attr[6]-self.pyarr_attr[6]),flags2names(self.arr_attr[6]),intent` # flags\n\n if intent.is_intent('cache'):\n assert self.arr_attr[5][3]>=self.type.elsize,\\\n `self.arr_attr[5][3],self.type.elsize`\n else:\n assert self.arr_attr[5][3]==self.type.elsize,\\\n `self.arr_attr[5][3],self.type.elsize`\n assert self.arr_equal(self.pyarr,self.arr)\n \n if isinstance(self.obj,ndarray):\n if typ.elsize==Type(obj.dtype).elsize:\n if not intent.is_intent('copy') and self.arr_attr[1]<=1:\n assert self.has_shared_memory()\n\n def arr_equal(self,arr1,arr2):\n if arr1.shape != arr2.shape:\n return False\n return alltrue(arr1==arr2)\n\n def __str__(self):\n return str(self.arr)\n\n def has_shared_memory(self):\n \"\"\"Check that created array shares data with input array.\n \"\"\"\n if self.obj is self.arr:\n return True\n if not isinstance(self.obj,ndarray):\n return False\n obj_attr = wrap.array_attrs(self.obj)\n return obj_attr[0]==self.arr_attr[0]\n\n##################################################\n\nclass test_intent(unittest.TestCase):\n def check_in_out(self):\n assert_equal(str(intent.in_.out),'intent(in,out)')\n assert intent.in_.c.is_intent('c')\n assert not intent.in_.c.is_intent_exact('c')\n assert intent.in_.c.is_intent_exact('c','in')\n assert intent.in_.c.is_intent_exact('in','c')\n assert not intent.in_.is_intent('c')\n\nclass _test_shared_memory:\n num2seq = [1,2]\n num23seq = [[1,2,3],[4,5,6]]\n def check_in_from_2seq(self):\n a = self.array([2],intent.in_,self.num2seq)\n assert not a.has_shared_memory()\n\n def check_in_from_2casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num2seq,dtype=t.dtype)\n a = self.array([len(self.num2seq)],intent.in_,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`self.type.dtype,t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_inout_2seq(self):\n obj = array(self.num2seq,dtype=self.type.dtype)\n a = self.array([len(self.num2seq)],intent.inout,obj)\n assert a.has_shared_memory()\n\n try:\n a = self.array([2],intent.in_.inout,self.num2seq)\n except TypeError,msg:\n if not str(msg).startswith('failed to initialize intent(inout|inplace|cache) array'):\n raise\n else:\n raise SystemError,'intent(inout) should have failed on sequence'\n\n def check_f_inout_23seq(self):\n obj = array(self.num23seq,dtype=self.type.dtype,fortran=1)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n a = self.array(shape,intent.in_.inout,obj)\n assert a.has_shared_memory()\n\n obj = array(self.num23seq,dtype=self.type.dtype,fortran=0)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n try:\n a = self.array(shape,intent.in_.inout,obj)\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(inout) array'):\n raise\n else:\n raise SystemError,'intent(inout) should have failed on improper array'\n\n def check_c_inout_23seq(self):\n obj = array(self.num23seq,dtype=self.type.dtype)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n a = self.array(shape,intent.in_.c.inout,obj)\n assert a.has_shared_memory()\n\n def check_in_copy_from_2casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num2seq,dtype=t.dtype)\n a = self.array([len(self.num2seq)],intent.in_.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_in_from_23seq(self):\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,self.num23seq)\n assert not a.has_shared_memory()\n\n def check_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_f_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype,fortran=1)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.c,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_f_copy_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype,fortran=1)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_copy_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.c.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_in_cache_from_2casttype(self):\n for t in self.type.all_types():\n if t.elsize != self.type.elsize:\n continue\n obj = array(self.num2seq,dtype=t.dtype)\n shape = (len(self.num2seq),)\n a = self.array(shape,intent.in_.c.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n\n a = self.array(shape,intent.in_.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n \n obj = array(self.num2seq,dtype=t.dtype,fortran=1)\n a = self.array(shape,intent.in_.c.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n\n a = self.array(shape,intent.in_.cache,obj)\n assert a.has_shared_memory(),`t.dtype`\n\n try:\n a = self.array(shape,intent.in_.cache,obj[::-1])\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(cache) array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on multisegmented array'\n def check_in_cache_from_2casttype_failure(self):\n for t in self.type.all_types():\n if t.elsize >= self.type.elsize:\n continue\n obj = array(self.num2seq,dtype=t.dtype)\n shape = (len(self.num2seq),)\n try:\n a = self.array(shape,intent.in_.cache,obj)\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(cache) array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on smaller array'\n\n def check_cache_hidden(self):\n shape = (2,)\n a = self.array(shape,intent.cache.hide,None)\n assert a.arr.shape==shape\n\n shape = (2,3)\n a = self.array(shape,intent.cache.hide,None)\n assert a.arr.shape==shape\n\n shape = (-1,3)\n try:\n a = self.array(shape,intent.cache.hide,None)\n except ValueError,msg:\n if not str(msg).startswith('failed to create intent(cache|hide)|optional array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on undefined dimensions'\n\n def check_hidden(self):\n shape = (2,)\n a = self.array(shape,intent.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n\n shape = (2,3)\n a = self.array(shape,intent.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert a.arr.flags['FORTRAN'] and not a.arr.flags['CONTIGUOUS']\n\n shape = (2,3)\n a = self.array(shape,intent.c.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert not a.arr.flags['FORTRAN'] and a.arr.flags['CONTIGUOUS']\n\n shape = (-1,3)\n try:\n a = self.array(shape,intent.hide,None)\n except ValueError,msg:\n if not str(msg).startswith('failed to create intent(cache|hide)|optional array'):\n raise\n else:\n raise SystemError,'intent(hide) should have failed on undefined dimensions'\n\n def check_optional_none(self):\n shape = (2,)\n a = self.array(shape,intent.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n\n shape = (2,3)\n a = self.array(shape,intent.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert a.arr.flags['FORTRAN'] and not a.arr.flags['CONTIGUOUS']\n\n shape = (2,3)\n a = self.array(shape,intent.c.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert not a.arr.flags['FORTRAN'] and a.arr.flags['CONTIGUOUS']\n\n def check_optional_from_2seq(self):\n obj = self.num2seq\n shape = (len(obj),)\n a = self.array(shape,intent.optional,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n def check_optional_from_23seq(self):\n obj = self.num23seq\n shape = (len(obj),len(obj[0]))\n a = self.array(shape,intent.optional,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n a = self.array(shape,intent.optional.c,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n def check_inplace(self):\n obj = array(self.num23seq,dtype=self.type.dtype)\n assert not obj.flags['FORTRAN'] and obj.flags['CONTIGUOUS']\n shape = obj.shape\n a = self.array(shape,intent.inplace,obj)\n assert obj[1][2]==a.arr[1][2],`obj,a.arr`\n a.arr[1][2]=54\n assert obj[1][2]==a.arr[1][2]==array(54,dtype=self.type.dtype),`obj,a.arr`\n assert a.arr is obj\n assert obj.flags['FORTRAN'] # obj attributes are changed inplace!\n assert not obj.flags['CONTIGUOUS']\n\n def check_inplace_from_casttype(self):\n for t in self.type.cast_types():\n if t is self.type:\n continue\n obj = array(self.num23seq,dtype=t.dtype)\n assert obj.dtype==t.dtype\n assert obj.dtype is not self.type.dtype\n assert not obj.flags['FORTRAN'] and obj.flags['CONTIGUOUS']\n shape = obj.shape\n a = self.array(shape,intent.inplace,obj)\n assert obj[1][2]==a.arr[1][2],`obj,a.arr`\n a.arr[1][2]=54\n assert obj[1][2]==a.arr[1][2]==array(54,dtype=self.type.dtype),`obj,a.arr`\n assert a.arr is obj\n assert obj.flags['FORTRAN'] # obj attributes are changed inplace!\n assert not obj.flags['CONTIGUOUS']\n assert obj.dtype is self.type.dtype # obj type is changed inplace!\n\nfor t in Type._type_names:\n exec '''\\\nclass test_%s_gen(unittest.TestCase,\n _test_shared_memory\n ):\n type = Type(%r)\n array = lambda self,dims,intent,obj: Array(Type(%r),dims,intent,obj)\n''' % (t,t,t)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "import unittest\nimport sys\nimport copy\n\nfrom numpy.test.testing import *\nfrom numpy.base import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros\nset_package_path()\nfrom array_from_pyobj import wrap\ndel sys.path[0]\n\ndef flags_info(arr):\n flags = wrap.array_attrs(arr)[6]\n return flags2names(flags)\n\ndef flags2names(flags):\n info = []\n for flagname in ['CONTIGUOUS','FORTRAN','OWNDATA','ENSURECOPY',\n 'ENSUREARRAY','ALIGNED','NOTSWAPPED','WRITEABLE',\n 'UPDATEIFCOPY','BEHAVED_FLAGS','BEHAVED_FLAGS_RO',\n 'CARRAY_FLAGS','FARRAY_FLAGS'\n ]:\n if abs(flags) & getattr(wrap,flagname):\n info.append(flagname)\n return info\n\nclass Intent:\n def __init__(self,intent_list=[]):\n self.intent_list = intent_list[:]\n flags = 0\n for i in intent_list:\n if i=='optional':\n flags |= wrap.F2PY_OPTIONAL\n else:\n flags |= getattr(wrap,'F2PY_INTENT_'+i.upper())\n self.flags = flags\n def __getattr__(self,name):\n name = name.lower()\n if name=='in_': name='in'\n return self.__class__(self.intent_list+[name])\n def __str__(self):\n return 'intent(%s)' % (','.join(self.intent_list))\n def __repr__(self):\n return 'Intent(%r)' % (self.intent_list)\n def is_intent(self,*names):\n for name in names:\n if name not in self.intent_list:\n return False\n return True\n def is_intent_exact(self,*names):\n return len(self.intent_list)==len(names) and self.is_intent(*names)\n\nintent = Intent()\n\nclass Type(object):\n\n _type_names = ['BOOL','BYTE','UBYTE','SHORT','USHORT','INT','UINT',\n 'LONG','ULONG','LONGLONG','ULONGLONG',\n 'FLOAT','DOUBLE','LONGDOUBLE','CFLOAT','CDOUBLE',\n 'CLONGDOUBLE']\n _type_cache = {}\n\n _cast_dict = {'BOOL':['BOOL']}\n _cast_dict['BYTE'] = _cast_dict['BOOL'] + ['BYTE']\n _cast_dict['UBYTE'] = _cast_dict['BOOL'] + ['UBYTE']\n _cast_dict['BYTE'] = ['BYTE']\n _cast_dict['UBYTE'] = ['UBYTE']\n _cast_dict['SHORT'] = _cast_dict['BYTE'] + ['UBYTE','SHORT']\n _cast_dict['USHORT'] = _cast_dict['UBYTE'] + ['BYTE','USHORT']\n _cast_dict['INT'] = _cast_dict['SHORT'] + ['USHORT','INT']\n _cast_dict['UINT'] = _cast_dict['USHORT'] + ['SHORT','UINT']\n\n _cast_dict['LONG'] = _cast_dict['INT'] + ['LONG']\n _cast_dict['ULONG'] = _cast_dict['UINT'] + ['ULONG']\n\n _cast_dict['LONGLONG'] = _cast_dict['LONG'] + ['LONGLONG']\n _cast_dict['ULONGLONG'] = _cast_dict['ULONG'] + ['ULONGLONG']\n\n _cast_dict['FLOAT'] = _cast_dict['SHORT'] + ['USHORT','FLOAT']\n _cast_dict['DOUBLE'] = _cast_dict['INT'] + ['UINT','FLOAT','DOUBLE']\n _cast_dict['LONGDOUBLE'] = _cast_dict['LONG'] + ['ULONG','FLOAT','DOUBLE','LONGDOUBLE']\n\n _cast_dict['CFLOAT'] = _cast_dict['FLOAT'] + ['CFLOAT']\n _cast_dict['CDOUBLE'] = _cast_dict['DOUBLE'] + ['CFLOAT','CDOUBLE']\n _cast_dict['CLONGDOUBLE'] = _cast_dict['LONGDOUBLE'] + ['CFLOAT','CDOUBLE','CLONGDOUBLE']\n \n \n def __new__(cls,name):\n if isinstance(name,type):\n dtype = name\n name = None\n for n,i in typeinfo.items():\n if isinstance(i,tuple) and dtype is i[-1]:\n name = n\n break\n obj = cls._type_cache.get(name.upper(),None)\n if obj is not None:\n return obj\n obj = object.__new__(cls)\n obj._init(name)\n cls._type_cache[name.upper()] = obj\n return obj\n \n def _init(self,name):\n self.NAME = name.upper()\n self.type_num = getattr(wrap,'PyArray_'+self.NAME)\n assert_equal(self.type_num,typeinfo[self.NAME][1])\n self.dtype = typeinfo[self.NAME][-1]\n self.elsize = typeinfo[self.NAME][2] / 8\n self.dtypechar = typeinfo[self.NAME][0]\n\n def cast_types(self):\n return map(self.__class__,self._cast_dict[self.NAME])\n\n def all_types(self):\n return map(self.__class__,self._type_names)\n\n def smaller_types(self):\n bits = typeinfo[self.NAME][3]\n types = []\n for name in self._type_names:\n if typeinfo[name][3]bits:\n types.append(Type(name))\n return types\n\nclass Array:\n def __init__(self,typ,dims,intent,obj):\n self.type = typ\n self.dims = dims\n self.intent = intent\n self.obj_copy = copy.deepcopy(obj)\n self.obj = obj\n\n # arr.dtypechar may be different from typ.dtypechar\n self.arr = wrap.call(typ.type_num,dims,intent.flags,obj)\n\n self.arr_attr = wrap.array_attrs(self.arr)\n\n if len(dims)>1:\n if self.intent.is_intent('c'):\n assert intent.flags & wrap.F2PY_INTENT_C\n assert not self.arr.flags['FORTRAN'],`self.arr.flags,obj.flags`\n assert self.arr.flags['CONTIGUOUS']\n assert not self.arr_attr[6] & wrap.FORTRAN\n else:\n assert not intent.flags & wrap.F2PY_INTENT_C\n assert self.arr.flags['FORTRAN']\n assert not self.arr.flags['CONTIGUOUS']\n assert self.arr_attr[6] & wrap.FORTRAN\n\n if obj is None:\n self.pyarr = None\n self.pyarr_attr = None\n return\n\n if intent.is_intent('cache'):\n assert isinstance(obj,ndarray),`type(obj)`\n self.pyarr = array(obj).reshape(*dims)\n \n else:\n self.pyarr = array(array(obj,\n dtype = typ.dtypechar).reshape(*dims),\n fortran=not self.intent.is_intent('c'))\n assert self.pyarr.dtypechar==typ.dtypechar,\\\n `self.pyarr.dtypechar,typ.dtypechar`\n assert self.pyarr.flags['OWNDATA']\n self.pyarr_attr = wrap.array_attrs(self.pyarr)\n\n if len(dims)>1:\n if self.intent.is_intent('c'):\n assert not self.pyarr.flags['FORTRAN']\n assert self.pyarr.flags['CONTIGUOUS']\n assert not self.pyarr_attr[6] & wrap.FORTRAN\n else:\n assert self.pyarr.flags['FORTRAN']\n assert not self.pyarr.flags['CONTIGUOUS']\n assert self.pyarr_attr[6] & wrap.FORTRAN\n\n\n assert self.arr_attr[1]==self.pyarr_attr[1] # nd\n assert self.arr_attr[2]==self.pyarr_attr[2] # dimensions\n if self.arr_attr[1]<=1:\n assert self.arr_attr[3]==self.pyarr_attr[3],\\\n `self.arr_attr[3],self.pyarr_attr[3],self.arr.tostring(),self.pyarr.tostring()` # strides\n assert self.arr_attr[5][-2:]==self.pyarr_attr[5][-2:],\\\n `self.arr_attr[5],self.pyarr_attr[5]` # descr\n assert self.arr_attr[6]==self.pyarr_attr[6],\\\n `self.arr_attr[6],self.pyarr_attr[6],flags2names(0*self.arr_attr[6]-self.pyarr_attr[6]),flags2names(self.arr_attr[6]),intent` # flags\n\n if intent.is_intent('cache'):\n assert self.arr_attr[5][3]>=self.type.elsize,\\\n `self.arr_attr[5][3],self.type.elsize`\n else:\n assert self.arr_attr[5][3]==self.type.elsize,\\\n `self.arr_attr[5][3],self.type.elsize`\n assert self.arr_equal(self.pyarr,self.arr)\n \n if isinstance(self.obj,ndarray):\n if typ.elsize==Type(obj.dtype).elsize:\n if not intent.is_intent('copy') and self.arr_attr[1]<=1:\n assert self.has_shared_memory()\n\n def arr_equal(self,arr1,arr2):\n if arr1.shape != arr2.shape:\n return False\n return alltrue(arr1==arr2)\n\n def __str__(self):\n return str(self.arr)\n\n def has_shared_memory(self):\n \"\"\"Check that created array shares data with input array.\n \"\"\"\n if self.obj is self.arr:\n return True\n if not isinstance(self.obj,ndarray):\n return False\n obj_attr = wrap.array_attrs(self.obj)\n return obj_attr[0]==self.arr_attr[0]\n\n##################################################\n\nclass test_intent(unittest.TestCase):\n def check_in_out(self):\n assert_equal(str(intent.in_.out),'intent(in,out)')\n assert intent.in_.c.is_intent('c')\n assert not intent.in_.c.is_intent_exact('c')\n assert intent.in_.c.is_intent_exact('c','in')\n assert intent.in_.c.is_intent_exact('in','c')\n assert not intent.in_.is_intent('c')\n\nclass _test_shared_memory:\n num2seq = [1,2]\n num23seq = [[1,2,3],[4,5,6]]\n def check_in_from_2seq(self):\n a = self.array([2],intent.in_,self.num2seq)\n assert not a.has_shared_memory()\n\n def check_in_from_2casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num2seq,dtype=t.dtype)\n a = self.array([len(self.num2seq)],intent.in_,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`self.type.dtype,t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_inout_2seq(self):\n obj = array(self.num2seq,dtype=self.type.dtype)\n a = self.array([len(self.num2seq)],intent.inout,obj)\n assert a.has_shared_memory()\n\n try:\n a = self.array([2],intent.in_.inout,self.num2seq)\n except TypeError,msg:\n if not str(msg).startswith('failed to initialize intent(inout|inplace|cache) array'):\n raise\n else:\n raise SystemError,'intent(inout) should have failed on sequence'\n\n def check_f_inout_23seq(self):\n obj = array(self.num23seq,dtype=self.type.dtype,fortran=1)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n a = self.array(shape,intent.in_.inout,obj)\n assert a.has_shared_memory()\n\n obj = array(self.num23seq,dtype=self.type.dtype,fortran=0)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n try:\n a = self.array(shape,intent.in_.inout,obj)\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(inout) array'):\n raise\n else:\n raise SystemError,'intent(inout) should have failed on improper array'\n\n def check_c_inout_23seq(self):\n obj = array(self.num23seq,dtype=self.type.dtype)\n shape = (len(self.num23seq),len(self.num23seq[0]))\n a = self.array(shape,intent.in_.c.inout,obj)\n assert a.has_shared_memory()\n\n def check_in_copy_from_2casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num2seq,dtype=t.dtype)\n a = self.array([len(self.num2seq)],intent.in_.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_in_from_23seq(self):\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,self.num23seq)\n assert not a.has_shared_memory()\n\n def check_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_f_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype,fortran=1)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.c,obj)\n if t.elsize==self.type.elsize:\n assert a.has_shared_memory(),`t.dtype`\n else:\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_f_copy_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype,fortran=1)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_c_copy_in_from_23casttype(self):\n for t in self.type.cast_types():\n obj = array(self.num23seq,dtype=t.dtype)\n a = self.array([len(self.num23seq),len(self.num23seq[0])],\n intent.in_.c.copy,obj)\n assert not a.has_shared_memory(),`t.dtype`\n\n def check_in_cache_from_2casttype(self):\n for t in self.type.all_types():\n if t.elsize != self.type.elsize:\n continue\n obj = array(self.num2seq,dtype=t.dtype)\n shape = (len(self.num2seq),)\n a = self.array(shape,intent.in_.c.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n\n a = self.array(shape,intent.in_.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n \n obj = array(self.num2seq,dtype=t.dtype,fortran=1)\n a = self.array(shape,intent.in_.c.cache,obj) \n assert a.has_shared_memory(),`t.dtype`\n\n a = self.array(shape,intent.in_.cache,obj)\n assert a.has_shared_memory(),`t.dtype`\n\n try:\n a = self.array(shape,intent.in_.cache,obj[::-1])\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(cache) array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on multisegmented array'\n def check_in_cache_from_2casttype_failure(self):\n for t in self.type.all_types():\n if t.elsize >= self.type.elsize:\n continue\n obj = array(self.num2seq,dtype=t.dtype)\n shape = (len(self.num2seq),)\n try:\n a = self.array(shape,intent.in_.cache,obj)\n except ValueError,msg:\n if not str(msg).startswith('failed to initialize intent(cache) array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on smaller array'\n\n def check_cache_hidden(self):\n shape = (2,)\n a = self.array(shape,intent.cache.hide,None)\n assert a.arr.shape==shape\n\n shape = (2,3)\n a = self.array(shape,intent.cache.hide,None)\n assert a.arr.shape==shape\n\n shape = (-1,3)\n try:\n a = self.array(shape,intent.cache.hide,None)\n except ValueError,msg:\n if not str(msg).startswith('failed to create intent(cache|hide)|optional array'):\n raise\n else:\n raise SystemError,'intent(cache) should have failed on undefined dimensions'\n\n def check_hidden(self):\n shape = (2,)\n a = self.array(shape,intent.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n\n shape = (2,3)\n a = self.array(shape,intent.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert a.arr.flags['FORTRAN'] and not a.arr.flags['CONTIGUOUS']\n\n shape = (2,3)\n a = self.array(shape,intent.c.hide,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert not a.arr.flags['FORTRAN'] and a.arr.flags['CONTIGUOUS']\n\n shape = (-1,3)\n try:\n a = self.array(shape,intent.hide,None)\n except ValueError,msg:\n if not str(msg).startswith('failed to create intent(cache|hide)|optional array'):\n raise\n else:\n raise SystemError,'intent(hide) should have failed on undefined dimensions'\n\n def check_optional_none(self):\n shape = (2,)\n a = self.array(shape,intent.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n\n shape = (2,3)\n a = self.array(shape,intent.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert a.arr.flags['FORTRAN'] and not a.arr.flags['CONTIGUOUS']\n\n shape = (2,3)\n a = self.array(shape,intent.c.optional,None)\n assert a.arr.shape==shape\n assert a.arr_equal(a.arr,zeros(shape,dtype=self.type.dtype))\n assert not a.arr.flags['FORTRAN'] and a.arr.flags['CONTIGUOUS']\n\n def check_optional_from_2seq(self):\n obj = self.num2seq\n shape = (len(obj),)\n a = self.array(shape,intent.optional,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n def check_optional_from_23seq(self):\n obj = self.num23seq\n shape = (len(obj),len(obj[0]))\n a = self.array(shape,intent.optional,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n a = self.array(shape,intent.optional.c,obj)\n assert a.arr.shape==shape\n assert not a.has_shared_memory()\n\n def check_inplace(self):\n obj = array(self.num23seq,dtype=self.type.dtype)\n assert not obj.flags['FORTRAN'] and obj.flags['CONTIGUOUS']\n shape = obj.shape\n a = self.array(shape,intent.inplace,obj)\n assert obj[1][2]==a.arr[1][2],`obj,a.arr`\n a.arr[1][2]=54\n assert obj[1][2]==a.arr[1][2]==array(54,dtype=self.type.dtype),`obj,a.arr`\n assert a.arr is obj\n assert obj.flags['FORTRAN'] # obj attributes are changed inplace!\n assert not obj.flags['CONTIGUOUS']\n\n def check_inplace_from_casttype(self):\n for t in self.type.cast_types():\n if t is self.type:\n continue\n obj = array(self.num23seq,dtype=t.dtype)\n assert obj.dtype==t.dtype\n assert obj.dtype is not self.type.dtype\n assert not obj.flags['FORTRAN'] and obj.flags['CONTIGUOUS']\n shape = obj.shape\n a = self.array(shape,intent.inplace,obj)\n assert obj[1][2]==a.arr[1][2],`obj,a.arr`\n a.arr[1][2]=54\n assert obj[1][2]==a.arr[1][2]==array(54,dtype=self.type.dtype),`obj,a.arr`\n assert a.arr is obj\n assert obj.flags['FORTRAN'] # obj attributes are changed inplace!\n assert not obj.flags['CONTIGUOUS']\n assert obj.dtype is self.type.dtype # obj type is changed inplace!\n\nfor t in Type._type_names:\n exec '''\\\nclass test_%s_gen(unittest.TestCase,\n _test_shared_memory\n ):\n type = Type(%r)\n array = lambda self,dims,intent,obj: Array(Type(%r),dims,intent,obj)\n''' % (t,t,t)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "flags_info", + "long_name": "flags_info( arr )", + "filename": "test_array_from_pyobj.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "arr" + ], + "start_line": 11, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "flags2names", + "long_name": "flags2names( flags )", + "filename": "test_array_from_pyobj.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [ + "flags" + ], + "start_line": 15, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , intent_list = [ ] )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 57, + "parameters": [ + "self", + "intent_list" + ], + "start_line": 27, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "name" + ], + "start_line": 36, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 42, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "is_intent", + "long_name": "is_intent( self , * names )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 3, + "token_count": 25, + "parameters": [ + "self", + "names" + ], + "start_line": 44, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "is_intent_exact", + "long_name": "is_intent_exact( self , * names )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 2, + "token_count": 28, + "parameters": [ + "self", + "names" + ], + "start_line": 49, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__new__", + "long_name": "__new__( cls , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 6, + "token_count": 104, + "parameters": [ + "cls", + "name" + ], + "start_line": 87, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "_init", + "long_name": "_init( self , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 1, + "token_count": 88, + "parameters": [ + "self", + "name" + ], + "start_line": 103, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "cast_types", + "long_name": "cast_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 111, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "all_types", + "long_name": "all_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 114, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "smaller_types", + "long_name": "smaller_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "equal_types", + "long_name": "equal_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 8, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "larger_types", + "long_name": "larger_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , typ , dims , intent , obj )", + "filename": "test_array_from_pyobj.py", + "nloc": 63, + "complexity": 13, + "token_count": 728, + "parameters": [ + "self", + "typ", + "dims", + "intent", + "obj" + ], + "start_line": 143, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 75, + "top_nesting_level": 1 + }, + { + "name": "arr_equal", + "long_name": "arr_equal( self , arr1 , arr2 )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "self", + "arr1", + "arr2" + ], + "start_line": 219, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 224, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "has_shared_memory", + "long_name": "has_shared_memory( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_in_out", + "long_name": "check_in_out( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 1, + "token_count": 77, + "parameters": [ + "self" + ], + "start_line": 240, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_2seq", + "long_name": "check_in_from_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 3, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 251, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_2casttype", + "long_name": "check_in_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 8, + "complexity": 3, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 255, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_inout_2seq", + "long_name": "check_inout_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 11, + "complexity": 3, + "token_count": 94, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_f_inout_23seq", + "long_name": "check_f_inout_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 14, + "complexity": 3, + "token_count": 149, + "parameters": [ + "self" + ], + "start_line": 277, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_c_inout_23seq", + "long_name": "check_c_inout_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 293, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_in_copy_from_2casttype", + "long_name": "check_in_copy_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 299, + "end_line": 303, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_c_in_from_23seq", + "long_name": "check_c_in_from_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 305, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_23casttype", + "long_name": "check_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 310, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_f_in_from_23casttype", + "long_name": "check_f_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 103, + "parameters": [ + "self" + ], + "start_line": 317, + "end_line": 325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_c_in_from_23casttype", + "long_name": "check_c_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 101, + "parameters": [ + "self" + ], + "start_line": 327, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_f_copy_in_from_23casttype", + "long_name": "check_f_copy_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 80, + "parameters": [ + "self" + ], + "start_line": 337, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_c_copy_in_from_23casttype", + "long_name": "check_c_copy_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 344, + "end_line": 349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_in_cache_from_2casttype", + "long_name": "check_in_cache_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 22, + "complexity": 5, + "token_count": 234, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 376, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "check_in_cache_from_2casttype_failure", + "long_name": "check_in_cache_from_2casttype_failure( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 13, + "complexity": 5, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 377, + "end_line": 389, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_cache_hidden", + "long_name": "check_cache_hidden( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 3, + "token_count": 116, + "parameters": [ + "self" + ], + "start_line": 391, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_hidden", + "long_name": "check_hidden( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 23, + "complexity": 5, + "token_count": 245, + "parameters": [ + "self" + ], + "start_line": 409, + "end_line": 434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "check_optional_none", + "long_name": "check_optional_none( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 3, + "token_count": 197, + "parameters": [ + "self" + ], + "start_line": 436, + "end_line": 452, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_optional_from_2seq", + "long_name": "check_optional_from_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 1, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 454, + "end_line": 459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_optional_from_23seq", + "long_name": "check_optional_from_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 1, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 461, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_inplace", + "long_name": "check_inplace( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 11, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 472, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_inplace_from_casttype", + "long_name": "check_inplace_from_casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 17, + "complexity": 4, + "token_count": 198, + "parameters": [ + "self" + ], + "start_line": 484, + "end_line": 500, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "flags_info", + "long_name": "flags_info( arr )", + "filename": "test_array_from_pyobj.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "arr" + ], + "start_line": 11, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "flags2names", + "long_name": "flags2names( flags )", + "filename": "test_array_from_pyobj.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [ + "flags" + ], + "start_line": 15, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , intent_list = [ ] )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 57, + "parameters": [ + "self", + "intent_list" + ], + "start_line": 27, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "name" + ], + "start_line": 36, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 42, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "is_intent", + "long_name": "is_intent( self , * names )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 3, + "token_count": 25, + "parameters": [ + "self", + "names" + ], + "start_line": 44, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "is_intent_exact", + "long_name": "is_intent_exact( self , * names )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 2, + "token_count": 28, + "parameters": [ + "self", + "names" + ], + "start_line": 49, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__new__", + "long_name": "__new__( cls , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 6, + "token_count": 104, + "parameters": [ + "cls", + "name" + ], + "start_line": 87, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "_init", + "long_name": "_init( self , name )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 1, + "token_count": 88, + "parameters": [ + "self", + "name" + ], + "start_line": 103, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "cast_types", + "long_name": "cast_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 111, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "all_types", + "long_name": "all_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 114, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "smaller_types", + "long_name": "smaller_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "equal_types", + "long_name": "equal_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 8, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "larger_types", + "long_name": "larger_types( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , typ , dims , intent , obj )", + "filename": "test_array_from_pyobj.py", + "nloc": 63, + "complexity": 13, + "token_count": 728, + "parameters": [ + "self", + "typ", + "dims", + "intent", + "obj" + ], + "start_line": 143, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 75, + "top_nesting_level": 1 + }, + { + "name": "arr_equal", + "long_name": "arr_equal( self , arr1 , arr2 )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "self", + "arr1", + "arr2" + ], + "start_line": 219, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 224, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "has_shared_memory", + "long_name": "has_shared_memory( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 3, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_in_out", + "long_name": "check_in_out( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 7, + "complexity": 1, + "token_count": 77, + "parameters": [ + "self" + ], + "start_line": 240, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_2seq", + "long_name": "check_in_from_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 3, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 251, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_2casttype", + "long_name": "check_in_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 8, + "complexity": 3, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 255, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_inout_2seq", + "long_name": "check_inout_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 11, + "complexity": 3, + "token_count": 94, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_f_inout_23seq", + "long_name": "check_f_inout_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 14, + "complexity": 3, + "token_count": 149, + "parameters": [ + "self" + ], + "start_line": 277, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_c_inout_23seq", + "long_name": "check_c_inout_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 293, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_in_copy_from_2casttype", + "long_name": "check_in_copy_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 5, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 299, + "end_line": 303, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_c_in_from_23seq", + "long_name": "check_c_in_from_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 4, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 305, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_in_from_23casttype", + "long_name": "check_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 310, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_f_in_from_23casttype", + "long_name": "check_f_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 103, + "parameters": [ + "self" + ], + "start_line": 317, + "end_line": 325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_c_in_from_23casttype", + "long_name": "check_c_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 3, + "token_count": 101, + "parameters": [ + "self" + ], + "start_line": 327, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_f_copy_in_from_23casttype", + "long_name": "check_f_copy_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 80, + "parameters": [ + "self" + ], + "start_line": 337, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_c_copy_in_from_23casttype", + "long_name": "check_c_copy_in_from_23casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 344, + "end_line": 349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_in_cache_from_2casttype", + "long_name": "check_in_cache_from_2casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 22, + "complexity": 5, + "token_count": 234, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 376, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "check_in_cache_from_2casttype_failure", + "long_name": "check_in_cache_from_2casttype_failure( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 13, + "complexity": 5, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 377, + "end_line": 389, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_cache_hidden", + "long_name": "check_cache_hidden( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 3, + "token_count": 116, + "parameters": [ + "self" + ], + "start_line": 391, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_hidden", + "long_name": "check_hidden( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 23, + "complexity": 5, + "token_count": 245, + "parameters": [ + "self" + ], + "start_line": 409, + "end_line": 434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "check_optional_none", + "long_name": "check_optional_none( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 15, + "complexity": 3, + "token_count": 197, + "parameters": [ + "self" + ], + "start_line": 436, + "end_line": 452, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_optional_from_2seq", + "long_name": "check_optional_from_2seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 6, + "complexity": 1, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 454, + "end_line": 459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_optional_from_23seq", + "long_name": "check_optional_from_23seq( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 9, + "complexity": 1, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 461, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_inplace", + "long_name": "check_inplace( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 11, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 472, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_inplace_from_casttype", + "long_name": "check_inplace_from_casttype( self )", + "filename": "test_array_from_pyobj.py", + "nloc": 17, + "complexity": 4, + "token_count": 198, + "parameters": [ + "self" + ], + "start_line": 484, + "end_line": 500, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 435, + "complexity": 110, + "token_count": 4355, + "diff_parsed": { + "added": [ + "from numpy.testing import *", + "from numpy import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros" + ], + "deleted": [ + "from numpy.test.testing import *", + "from numpy.base import array, typeinfo, alltrue, ndarray, asarray, can_cast,zeros" + ] + } + }, + { + "old_path": "numpy/f2py/tests/array_from_pyobj/wrapmodule.c", + "new_path": "numpy/f2py/tests/array_from_pyobj/wrapmodule.c", + "filename": "wrapmodule.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -120,7 +120,7 @@ DL_EXPORT(void) initwrap(void) {\n PyFortran_Type.ob_type = &PyType_Type;\n import_array();\n if (PyErr_Occurred())\n- Py_FatalError(\"can't initialize module wrap (failed to import numpy.base)\");\n+ Py_FatalError(\"can't initialize module wrap (failed to import numpy)\");\n d = PyModule_GetDict(m);\n s = PyString_FromString(\"This module 'wrap' is auto-generated with f2py (version:2_1330).\\nFunctions:\\n\"\n \" arr = call(type_num,dims,intent,obj)\\n\"\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "/* File: wrapmodule.c\n * This file is auto-generated with f2py (version:2_1330).\n * Hand edited by Pearu.\n * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,\n * written by Pearu Peterson .\n * See http://cens.ioc.ee/projects/f2py2e/\n * Generation date: Fri Oct 21 22:41:12 2005\n * $Revision:$\n * $Date:$\n * Do not edit this file directly unless you know what you are doing!!!\n */\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*********************** See f2py2e/cfuncs.py: includes ***********************/\n#include \"Python.h\"\n#include \"fortranobject.h\"\n#include \n\nstatic PyObject *wrap_error;\nstatic PyObject *wrap_module;\n\n/************************************ call ************************************/\nstatic char doc_f2py_rout_wrap_call[] = \"\\\nFunction signature:\\n\\\n arr = call(type_num,dims,intent,obj)\\n\\\nRequired arguments:\\n\"\n\" type_num : input int\\n\"\n\" dims : input int-sequence\\n\"\n\" intent : input int\\n\"\n\" obj : input python object\\n\"\n\"Return objects:\\n\"\n\" arr : array\";\nstatic PyObject *f2py_rout_wrap_call(PyObject *capi_self,\n\t\t\t\t PyObject *capi_args) {\n PyObject * volatile capi_buildvalue = NULL;\n int type_num = 0;\n intp *dims = NULL;\n PyObject *dims_capi = Py_None;\n int rank = 0;\n int intent = 0;\n PyArrayObject *capi_arr_tmp = NULL;\n PyObject *arr_capi = Py_None;\n int i;\n\n if (!PyArg_ParseTuple(capi_args,\"iOiO|:wrap.call\",\\\n\t\t\t&type_num,&dims_capi,&intent,&arr_capi))\n return NULL;\n rank = PySequence_Length(dims_capi);\n dims = malloc(rank*sizeof(intp));\n for (i=0;idata);\n dimensions = PyTuple_New(arr->nd);\n strides = PyTuple_New(arr->nd);\n for (i=0;ind;++i) {\n PyTuple_SetItem(dimensions,i,PyInt_FromLong(arr->dimensions[i]));\n PyTuple_SetItem(strides,i,PyInt_FromLong(arr->strides[i]));\n }\n return Py_BuildValue(\"siOOO(cciii)ii\",s,arr->nd,\n\t\t dimensions,strides,\n\t\t (arr->base==NULL?Py_None:arr->base),\n\t\t arr->descr->kind,\n\t\t arr->descr->type,\n\t\t arr->descr->type_num,\n\t\t arr->descr->elsize,\n\t\t arr->descr->alignment,\n\t\t arr->flags,\n\t\t arr->itemsize);\n}\n\nstatic PyMethodDef f2py_module_methods[] = {\n\n {\"call\",f2py_rout_wrap_call,METH_VARARGS,doc_f2py_rout_wrap_call},\n {\"array_attrs\",f2py_rout_wrap_attrs,METH_VARARGS,doc_f2py_rout_wrap_attrs},\n {NULL,NULL}\n};\n\nDL_EXPORT(void) initwrap(void) {\n PyObject *m,*d, *s;\n m = wrap_module = Py_InitModule(\"wrap\", f2py_module_methods);\n PyFortran_Type.ob_type = &PyType_Type;\n import_array();\n if (PyErr_Occurred())\n Py_FatalError(\"can't initialize module wrap (failed to import numpy)\");\n d = PyModule_GetDict(m);\n s = PyString_FromString(\"This module 'wrap' is auto-generated with f2py (version:2_1330).\\nFunctions:\\n\"\n\" arr = call(type_num,dims,intent,obj)\\n\"\n\".\");\n PyDict_SetItemString(d, \"__doc__\", s);\n wrap_error = PyErr_NewException (\"wrap.error\", NULL, NULL);\n Py_DECREF(s);\n PyDict_SetItemString(d, \"F2PY_INTENT_IN\", PyInt_FromLong(F2PY_INTENT_IN));\n PyDict_SetItemString(d, \"F2PY_INTENT_INOUT\", PyInt_FromLong(F2PY_INTENT_INOUT));\n PyDict_SetItemString(d, \"F2PY_INTENT_OUT\", PyInt_FromLong(F2PY_INTENT_OUT));\n PyDict_SetItemString(d, \"F2PY_INTENT_HIDE\", PyInt_FromLong(F2PY_INTENT_HIDE));\n PyDict_SetItemString(d, \"F2PY_INTENT_CACHE\", PyInt_FromLong(F2PY_INTENT_CACHE));\n PyDict_SetItemString(d, \"F2PY_INTENT_COPY\", PyInt_FromLong(F2PY_INTENT_COPY));\n PyDict_SetItemString(d, \"F2PY_INTENT_C\", PyInt_FromLong(F2PY_INTENT_C));\n PyDict_SetItemString(d, \"F2PY_OPTIONAL\", PyInt_FromLong(F2PY_OPTIONAL));\n PyDict_SetItemString(d, \"F2PY_INTENT_INPLACE\", PyInt_FromLong(F2PY_INTENT_INPLACE));\n PyDict_SetItemString(d, \"PyArray_BOOL\", PyInt_FromLong(PyArray_BOOL));\n PyDict_SetItemString(d, \"PyArray_BYTE\", PyInt_FromLong(PyArray_BYTE));\n PyDict_SetItemString(d, \"PyArray_UBYTE\", PyInt_FromLong(PyArray_UBYTE));\n PyDict_SetItemString(d, \"PyArray_SHORT\", PyInt_FromLong(PyArray_SHORT));\n PyDict_SetItemString(d, \"PyArray_USHORT\", PyInt_FromLong(PyArray_USHORT));\n PyDict_SetItemString(d, \"PyArray_INT\", PyInt_FromLong(PyArray_INT));\n PyDict_SetItemString(d, \"PyArray_UINT\", PyInt_FromLong(PyArray_UINT));\n PyDict_SetItemString(d, \"PyArray_INTP\", PyInt_FromLong(PyArray_INTP));\n PyDict_SetItemString(d, \"PyArray_UINTP\", PyInt_FromLong(PyArray_UINTP));\n PyDict_SetItemString(d, \"PyArray_LONG\", PyInt_FromLong(PyArray_LONG));\n PyDict_SetItemString(d, \"PyArray_ULONG\", PyInt_FromLong(PyArray_ULONG));\n PyDict_SetItemString(d, \"PyArray_LONGLONG\", PyInt_FromLong(PyArray_LONGLONG));\n PyDict_SetItemString(d, \"PyArray_ULONGLONG\", PyInt_FromLong(PyArray_ULONGLONG));\n PyDict_SetItemString(d, \"PyArray_FLOAT\", PyInt_FromLong(PyArray_FLOAT));\n PyDict_SetItemString(d, \"PyArray_DOUBLE\", PyInt_FromLong(PyArray_DOUBLE));\n PyDict_SetItemString(d, \"PyArray_LONGDOUBLE\", PyInt_FromLong(PyArray_LONGDOUBLE));\n PyDict_SetItemString(d, \"PyArray_CFLOAT\", PyInt_FromLong(PyArray_CFLOAT));\n PyDict_SetItemString(d, \"PyArray_CDOUBLE\", PyInt_FromLong(PyArray_CDOUBLE));\n PyDict_SetItemString(d, \"PyArray_CLONGDOUBLE\", PyInt_FromLong(PyArray_CLONGDOUBLE));\n PyDict_SetItemString(d, \"PyArray_OBJECT\", PyInt_FromLong(PyArray_OBJECT));\n PyDict_SetItemString(d, \"PyArray_STRING\", PyInt_FromLong(PyArray_STRING));\n PyDict_SetItemString(d, \"PyArray_UNICODE\", PyInt_FromLong(PyArray_UNICODE));\n PyDict_SetItemString(d, \"PyArray_VOID\", PyInt_FromLong(PyArray_VOID));\n PyDict_SetItemString(d, \"PyArray_NTYPES\", PyInt_FromLong(PyArray_NTYPES));\n PyDict_SetItemString(d, \"PyArray_NOTYPE\", PyInt_FromLong(PyArray_NOTYPE));\n PyDict_SetItemString(d, \"PyArray_UDERDEF\", PyInt_FromLong(PyArray_USERDEF));\n\n PyDict_SetItemString(d, \"CONTIGUOUS\", PyInt_FromLong(CONTIGUOUS));\n PyDict_SetItemString(d, \"FORTRAN\", PyInt_FromLong(FORTRAN));\n PyDict_SetItemString(d, \"OWNDATA\", PyInt_FromLong(OWNDATA));\n PyDict_SetItemString(d, \"ENSURECOPY\", PyInt_FromLong(ENSURECOPY));\n PyDict_SetItemString(d, \"ENSUREARRAY\", PyInt_FromLong(ENSUREARRAY));\n PyDict_SetItemString(d, \"ALIGNED\", PyInt_FromLong(ALIGNED));\n PyDict_SetItemString(d, \"NOTSWAPPED\", PyInt_FromLong(NOTSWAPPED));\n PyDict_SetItemString(d, \"WRITEABLE\", PyInt_FromLong(WRITEABLE));\n PyDict_SetItemString(d, \"UPDATEIFCOPY\", PyInt_FromLong(UPDATEIFCOPY));\n\n PyDict_SetItemString(d, \"BEHAVED_FLAGS\", PyInt_FromLong(BEHAVED_FLAGS));\n PyDict_SetItemString(d, \"BEHAVED_FLAGS_RO\", PyInt_FromLong(BEHAVED_FLAGS_RO));\n PyDict_SetItemString(d, \"CARRAY_FLAGS\", PyInt_FromLong(CARRAY_FLAGS));\n PyDict_SetItemString(d, \"FARRAY_FLAGS\", PyInt_FromLong(FARRAY_FLAGS));\n PyDict_SetItemString(d, \"DEFAULT_FLAGS\", PyInt_FromLong(DEFAULT_FLAGS));\n PyDict_SetItemString(d, \"UPDATE_ALL_FLAGS\", PyInt_FromLong(UPDATE_ALL_FLAGS));\n\n if (PyErr_Occurred())\n Py_FatalError(\"can't initialize module wrap\");\n\n#ifdef F2PY_REPORT_ATEXIT\n on_exit(f2py_report_on_exit,(void*)\"array_from_pyobj.wrap.call\");\n#endif\n\n}\n#ifdef __cplusplus\n}\n#endif\n", + "source_code_before": "/* File: wrapmodule.c\n * This file is auto-generated with f2py (version:2_1330).\n * Hand edited by Pearu.\n * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,\n * written by Pearu Peterson .\n * See http://cens.ioc.ee/projects/f2py2e/\n * Generation date: Fri Oct 21 22:41:12 2005\n * $Revision:$\n * $Date:$\n * Do not edit this file directly unless you know what you are doing!!!\n */\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*********************** See f2py2e/cfuncs.py: includes ***********************/\n#include \"Python.h\"\n#include \"fortranobject.h\"\n#include \n\nstatic PyObject *wrap_error;\nstatic PyObject *wrap_module;\n\n/************************************ call ************************************/\nstatic char doc_f2py_rout_wrap_call[] = \"\\\nFunction signature:\\n\\\n arr = call(type_num,dims,intent,obj)\\n\\\nRequired arguments:\\n\"\n\" type_num : input int\\n\"\n\" dims : input int-sequence\\n\"\n\" intent : input int\\n\"\n\" obj : input python object\\n\"\n\"Return objects:\\n\"\n\" arr : array\";\nstatic PyObject *f2py_rout_wrap_call(PyObject *capi_self,\n\t\t\t\t PyObject *capi_args) {\n PyObject * volatile capi_buildvalue = NULL;\n int type_num = 0;\n intp *dims = NULL;\n PyObject *dims_capi = Py_None;\n int rank = 0;\n int intent = 0;\n PyArrayObject *capi_arr_tmp = NULL;\n PyObject *arr_capi = Py_None;\n int i;\n\n if (!PyArg_ParseTuple(capi_args,\"iOiO|:wrap.call\",\\\n\t\t\t&type_num,&dims_capi,&intent,&arr_capi))\n return NULL;\n rank = PySequence_Length(dims_capi);\n dims = malloc(rank*sizeof(intp));\n for (i=0;idata);\n dimensions = PyTuple_New(arr->nd);\n strides = PyTuple_New(arr->nd);\n for (i=0;ind;++i) {\n PyTuple_SetItem(dimensions,i,PyInt_FromLong(arr->dimensions[i]));\n PyTuple_SetItem(strides,i,PyInt_FromLong(arr->strides[i]));\n }\n return Py_BuildValue(\"siOOO(cciii)ii\",s,arr->nd,\n\t\t dimensions,strides,\n\t\t (arr->base==NULL?Py_None:arr->base),\n\t\t arr->descr->kind,\n\t\t arr->descr->type,\n\t\t arr->descr->type_num,\n\t\t arr->descr->elsize,\n\t\t arr->descr->alignment,\n\t\t arr->flags,\n\t\t arr->itemsize);\n}\n\nstatic PyMethodDef f2py_module_methods[] = {\n\n {\"call\",f2py_rout_wrap_call,METH_VARARGS,doc_f2py_rout_wrap_call},\n {\"array_attrs\",f2py_rout_wrap_attrs,METH_VARARGS,doc_f2py_rout_wrap_attrs},\n {NULL,NULL}\n};\n\nDL_EXPORT(void) initwrap(void) {\n PyObject *m,*d, *s;\n m = wrap_module = Py_InitModule(\"wrap\", f2py_module_methods);\n PyFortran_Type.ob_type = &PyType_Type;\n import_array();\n if (PyErr_Occurred())\n Py_FatalError(\"can't initialize module wrap (failed to import numpy.base)\");\n d = PyModule_GetDict(m);\n s = PyString_FromString(\"This module 'wrap' is auto-generated with f2py (version:2_1330).\\nFunctions:\\n\"\n\" arr = call(type_num,dims,intent,obj)\\n\"\n\".\");\n PyDict_SetItemString(d, \"__doc__\", s);\n wrap_error = PyErr_NewException (\"wrap.error\", NULL, NULL);\n Py_DECREF(s);\n PyDict_SetItemString(d, \"F2PY_INTENT_IN\", PyInt_FromLong(F2PY_INTENT_IN));\n PyDict_SetItemString(d, \"F2PY_INTENT_INOUT\", PyInt_FromLong(F2PY_INTENT_INOUT));\n PyDict_SetItemString(d, \"F2PY_INTENT_OUT\", PyInt_FromLong(F2PY_INTENT_OUT));\n PyDict_SetItemString(d, \"F2PY_INTENT_HIDE\", PyInt_FromLong(F2PY_INTENT_HIDE));\n PyDict_SetItemString(d, \"F2PY_INTENT_CACHE\", PyInt_FromLong(F2PY_INTENT_CACHE));\n PyDict_SetItemString(d, \"F2PY_INTENT_COPY\", PyInt_FromLong(F2PY_INTENT_COPY));\n PyDict_SetItemString(d, \"F2PY_INTENT_C\", PyInt_FromLong(F2PY_INTENT_C));\n PyDict_SetItemString(d, \"F2PY_OPTIONAL\", PyInt_FromLong(F2PY_OPTIONAL));\n PyDict_SetItemString(d, \"F2PY_INTENT_INPLACE\", PyInt_FromLong(F2PY_INTENT_INPLACE));\n PyDict_SetItemString(d, \"PyArray_BOOL\", PyInt_FromLong(PyArray_BOOL));\n PyDict_SetItemString(d, \"PyArray_BYTE\", PyInt_FromLong(PyArray_BYTE));\n PyDict_SetItemString(d, \"PyArray_UBYTE\", PyInt_FromLong(PyArray_UBYTE));\n PyDict_SetItemString(d, \"PyArray_SHORT\", PyInt_FromLong(PyArray_SHORT));\n PyDict_SetItemString(d, \"PyArray_USHORT\", PyInt_FromLong(PyArray_USHORT));\n PyDict_SetItemString(d, \"PyArray_INT\", PyInt_FromLong(PyArray_INT));\n PyDict_SetItemString(d, \"PyArray_UINT\", PyInt_FromLong(PyArray_UINT));\n PyDict_SetItemString(d, \"PyArray_INTP\", PyInt_FromLong(PyArray_INTP));\n PyDict_SetItemString(d, \"PyArray_UINTP\", PyInt_FromLong(PyArray_UINTP));\n PyDict_SetItemString(d, \"PyArray_LONG\", PyInt_FromLong(PyArray_LONG));\n PyDict_SetItemString(d, \"PyArray_ULONG\", PyInt_FromLong(PyArray_ULONG));\n PyDict_SetItemString(d, \"PyArray_LONGLONG\", PyInt_FromLong(PyArray_LONGLONG));\n PyDict_SetItemString(d, \"PyArray_ULONGLONG\", PyInt_FromLong(PyArray_ULONGLONG));\n PyDict_SetItemString(d, \"PyArray_FLOAT\", PyInt_FromLong(PyArray_FLOAT));\n PyDict_SetItemString(d, \"PyArray_DOUBLE\", PyInt_FromLong(PyArray_DOUBLE));\n PyDict_SetItemString(d, \"PyArray_LONGDOUBLE\", PyInt_FromLong(PyArray_LONGDOUBLE));\n PyDict_SetItemString(d, \"PyArray_CFLOAT\", PyInt_FromLong(PyArray_CFLOAT));\n PyDict_SetItemString(d, \"PyArray_CDOUBLE\", PyInt_FromLong(PyArray_CDOUBLE));\n PyDict_SetItemString(d, \"PyArray_CLONGDOUBLE\", PyInt_FromLong(PyArray_CLONGDOUBLE));\n PyDict_SetItemString(d, \"PyArray_OBJECT\", PyInt_FromLong(PyArray_OBJECT));\n PyDict_SetItemString(d, \"PyArray_STRING\", PyInt_FromLong(PyArray_STRING));\n PyDict_SetItemString(d, \"PyArray_UNICODE\", PyInt_FromLong(PyArray_UNICODE));\n PyDict_SetItemString(d, \"PyArray_VOID\", PyInt_FromLong(PyArray_VOID));\n PyDict_SetItemString(d, \"PyArray_NTYPES\", PyInt_FromLong(PyArray_NTYPES));\n PyDict_SetItemString(d, \"PyArray_NOTYPE\", PyInt_FromLong(PyArray_NOTYPE));\n PyDict_SetItemString(d, \"PyArray_UDERDEF\", PyInt_FromLong(PyArray_USERDEF));\n\n PyDict_SetItemString(d, \"CONTIGUOUS\", PyInt_FromLong(CONTIGUOUS));\n PyDict_SetItemString(d, \"FORTRAN\", PyInt_FromLong(FORTRAN));\n PyDict_SetItemString(d, \"OWNDATA\", PyInt_FromLong(OWNDATA));\n PyDict_SetItemString(d, \"ENSURECOPY\", PyInt_FromLong(ENSURECOPY));\n PyDict_SetItemString(d, \"ENSUREARRAY\", PyInt_FromLong(ENSUREARRAY));\n PyDict_SetItemString(d, \"ALIGNED\", PyInt_FromLong(ALIGNED));\n PyDict_SetItemString(d, \"NOTSWAPPED\", PyInt_FromLong(NOTSWAPPED));\n PyDict_SetItemString(d, \"WRITEABLE\", PyInt_FromLong(WRITEABLE));\n PyDict_SetItemString(d, \"UPDATEIFCOPY\", PyInt_FromLong(UPDATEIFCOPY));\n\n PyDict_SetItemString(d, \"BEHAVED_FLAGS\", PyInt_FromLong(BEHAVED_FLAGS));\n PyDict_SetItemString(d, \"BEHAVED_FLAGS_RO\", PyInt_FromLong(BEHAVED_FLAGS_RO));\n PyDict_SetItemString(d, \"CARRAY_FLAGS\", PyInt_FromLong(CARRAY_FLAGS));\n PyDict_SetItemString(d, \"FARRAY_FLAGS\", PyInt_FromLong(FARRAY_FLAGS));\n PyDict_SetItemString(d, \"DEFAULT_FLAGS\", PyInt_FromLong(DEFAULT_FLAGS));\n PyDict_SetItemString(d, \"UPDATE_ALL_FLAGS\", PyInt_FromLong(UPDATE_ALL_FLAGS));\n\n if (PyErr_Occurred())\n Py_FatalError(\"can't initialize module wrap\");\n\n#ifdef F2PY_REPORT_ATEXIT\n on_exit(f2py_report_on_exit,(void*)\"array_from_pyobj.wrap.call\");\n#endif\n\n}\n#ifdef __cplusplus\n}\n#endif\n", + "methods": [ + { + "name": "f2py_rout_wrap_call", + "long_name": "f2py_rout_wrap_call( PyObject * capi_self , PyObject * capi_args)", + "filename": "wrapmodule.c", + "nloc": 25, + "complexity": 4, + "token_count": 180, + "parameters": [ + "capi_self", + "capi_args" + ], + "start_line": 35, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "f2py_rout_wrap_attrs", + "long_name": "f2py_rout_wrap_attrs( PyObject * capi_self , PyObject * capi_args)", + "filename": "wrapmodule.c", + "nloc": 31, + "complexity": 4, + "token_count": 234, + "parameters": [ + "capi_self", + "capi_args" + ], + "start_line": 78, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "initwrap", + "long_name": "initwrap()", + "filename": "wrapmodule.c", + "nloc": 68, + "complexity": 4, + "token_count": 711, + "parameters": [], + "start_line": 117, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 75, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "f2py_rout_wrap_call", + "long_name": "f2py_rout_wrap_call( PyObject * capi_self , PyObject * capi_args)", + "filename": "wrapmodule.c", + "nloc": 25, + "complexity": 4, + "token_count": 180, + "parameters": [ + "capi_self", + "capi_args" + ], + "start_line": 35, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "f2py_rout_wrap_attrs", + "long_name": "f2py_rout_wrap_attrs( PyObject * capi_self , PyObject * capi_args)", + "filename": "wrapmodule.c", + "nloc": 31, + "complexity": 4, + "token_count": 234, + "parameters": [ + "capi_self", + "capi_args" + ], + "start_line": 78, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "initwrap", + "long_name": "initwrap()", + "filename": "wrapmodule.c", + "nloc": 68, + "complexity": 4, + "token_count": 711, + "parameters": [], + "start_line": 117, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 75, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "initwrap", + "long_name": "initwrap()", + "filename": "wrapmodule.c", + "nloc": 68, + "complexity": 4, + "token_count": 711, + "parameters": [], + "start_line": 117, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 75, + "top_nesting_level": 1 + } + ], + "nloc": 161, + "complexity": 12, + "token_count": 1222, + "diff_parsed": { + "added": [ + " Py_FatalError(\"can't initialize module wrap (failed to import numpy)\");" + ], + "deleted": [ + " Py_FatalError(\"can't initialize module wrap (failed to import numpy.base)\");" + ] + } + }, + { + "old_path": "numpy/f2py/tests/f77/return_integer.py", + "new_path": "numpy/f2py/tests/f77/return_integer.py", + "filename": "return_integer.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -8,7 +8,7 @@\n \"\"\"\n \n import numpy.f2py as f2py2e\n-from numpy.base import array\n+from numpy import array\n \n def build(f2py_opts):\n try:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\n__usage__ = \"\"\"\nRun:\n python return_integer.py []\nExamples:\n python return_integer.py --fcompiler=Gnu --no-wrap-functions\n python return_integer.py --quiet\n\"\"\"\n\nimport numpy.f2py as f2py2e\nfrom numpy import array\n\ndef build(f2py_opts):\n try:\n import f77_ext_return_integer\n except ImportError:\n assert not f2py2e.compile('''\\\n function t0(value)\n integer value\n integer t0\n t0 = value\n end\n function t1(value)\n integer*1 value\n integer*1 t1\n t1 = value\n end\n function t2(value)\n integer*2 value\n integer*2 t2\n t2 = value\n end\n function t4(value)\n integer*4 value\n integer*4 t4\n t4 = value\n end\n function t8(value)\n integer*8 value\n integer*8 t8\n t8 = value\n end\n\n subroutine s0(t0,value)\n integer value\n integer t0\ncf2py intent(out) t0\n t0 = value\n end\n subroutine s1(t1,value)\n integer*1 value\n integer*1 t1\ncf2py intent(out) t1\n t1 = value\n end\n subroutine s2(t2,value)\n integer*2 value\n integer*2 t2\ncf2py intent(out) t2\n t2 = value\n end\n subroutine s4(t4,value)\n integer*4 value\n integer*4 t4\ncf2py intent(out) t4\n t4 = value\n end\n subroutine s8(t8,value)\n integer*8 value\n integer*8 t8\ncf2py intent(out) t8\n t8 = value\n end\n\n''','f77_ext_return_integer',f2py_opts,source_fn='f77_ret_int.f')\n\n from f77_ext_return_integer import t0,t1,t2,t4,t8,s0,s1,s2,s4,s8\n test_functions = [t0,t1,t2,t4,t8,s0,s1,s2,s4,s8]\n return test_functions\n\ndef runtest(t):\n import sys\n assert t(123)==123,`t(123)`\n assert t(123.6)==123\n assert t(123l)==123\n if sys.version[:3]<'2.3':\n assert t(123.6+3j)==123\n assert t('123')==123\n assert t(-123)==-123\n assert t([123])==123\n assert t((123,))==123\n assert t(array(123))==123\n assert t(array([123]))==123\n assert t(array([[123]]))==123\n assert t(array([123],'b'))==123\n assert t(array([123],'h'))==123\n assert t(array([123],'i'))==123\n assert t(array([123],'l'))==123\n assert t(array([123],'B'))==123\n assert t(array([123],'f'))==123\n assert t(array([123],'d'))==123\n if sys.version[:3]<'2.3':\n assert t(array([123+3j],'F'))==123\n assert t(array([123],'D'))==123\n\n\n try: raise RuntimeError,`t(array([123],'c'))`\n except ValueError: pass\n try: raise RuntimeError,`t('abc')`\n except ValueError: pass\n\n try: raise RuntimeError,`t([])`\n except IndexError: pass\n try: raise RuntimeError,`t(())`\n except IndexError: pass\n\n try: raise RuntimeError,`t(t)`\n except TypeError: pass\n try: raise RuntimeError,`t({})`\n except TypeError: pass\n\n if t.__doc__.split()[0] in ['t8','s8']:\n try: raise RuntimeError,`t(100000000000000000000000l)`\n except OverflowError: pass\n try: raise RuntimeError,`t(10000000011111111111111.23)`\n except OverflowError: pass\n else:\n if sys.version[:3]<'2.3':\n try: raise RuntimeError,`t(10000000000000l)`\n except OverflowError: pass\n try: raise RuntimeError,`t(10000000000.23)`\n except OverflowError: pass\n\nif __name__=='__main__':\n #import libwadpy\n status = 1\n try:\n repeat,f2py_opts = f2py2e.f2py_testing.cmdline()\n test_functions = build(f2py_opts)\n f2py2e.f2py_testing.run(runtest,test_functions,repeat)\n print 'ok'\n status = 0\n finally:\n if status:\n print '*'*20\n print 'Running f2py2e.diagnose'\n import numpy.f2py.diagnose as diagnose\n #diagnose.run()\n", + "source_code_before": "\n__usage__ = \"\"\"\nRun:\n python return_integer.py []\nExamples:\n python return_integer.py --fcompiler=Gnu --no-wrap-functions\n python return_integer.py --quiet\n\"\"\"\n\nimport numpy.f2py as f2py2e\nfrom numpy.base import array\n\ndef build(f2py_opts):\n try:\n import f77_ext_return_integer\n except ImportError:\n assert not f2py2e.compile('''\\\n function t0(value)\n integer value\n integer t0\n t0 = value\n end\n function t1(value)\n integer*1 value\n integer*1 t1\n t1 = value\n end\n function t2(value)\n integer*2 value\n integer*2 t2\n t2 = value\n end\n function t4(value)\n integer*4 value\n integer*4 t4\n t4 = value\n end\n function t8(value)\n integer*8 value\n integer*8 t8\n t8 = value\n end\n\n subroutine s0(t0,value)\n integer value\n integer t0\ncf2py intent(out) t0\n t0 = value\n end\n subroutine s1(t1,value)\n integer*1 value\n integer*1 t1\ncf2py intent(out) t1\n t1 = value\n end\n subroutine s2(t2,value)\n integer*2 value\n integer*2 t2\ncf2py intent(out) t2\n t2 = value\n end\n subroutine s4(t4,value)\n integer*4 value\n integer*4 t4\ncf2py intent(out) t4\n t4 = value\n end\n subroutine s8(t8,value)\n integer*8 value\n integer*8 t8\ncf2py intent(out) t8\n t8 = value\n end\n\n''','f77_ext_return_integer',f2py_opts,source_fn='f77_ret_int.f')\n\n from f77_ext_return_integer import t0,t1,t2,t4,t8,s0,s1,s2,s4,s8\n test_functions = [t0,t1,t2,t4,t8,s0,s1,s2,s4,s8]\n return test_functions\n\ndef runtest(t):\n import sys\n assert t(123)==123,`t(123)`\n assert t(123.6)==123\n assert t(123l)==123\n if sys.version[:3]<'2.3':\n assert t(123.6+3j)==123\n assert t('123')==123\n assert t(-123)==-123\n assert t([123])==123\n assert t((123,))==123\n assert t(array(123))==123\n assert t(array([123]))==123\n assert t(array([[123]]))==123\n assert t(array([123],'b'))==123\n assert t(array([123],'h'))==123\n assert t(array([123],'i'))==123\n assert t(array([123],'l'))==123\n assert t(array([123],'B'))==123\n assert t(array([123],'f'))==123\n assert t(array([123],'d'))==123\n if sys.version[:3]<'2.3':\n assert t(array([123+3j],'F'))==123\n assert t(array([123],'D'))==123\n\n\n try: raise RuntimeError,`t(array([123],'c'))`\n except ValueError: pass\n try: raise RuntimeError,`t('abc')`\n except ValueError: pass\n\n try: raise RuntimeError,`t([])`\n except IndexError: pass\n try: raise RuntimeError,`t(())`\n except IndexError: pass\n\n try: raise RuntimeError,`t(t)`\n except TypeError: pass\n try: raise RuntimeError,`t({})`\n except TypeError: pass\n\n if t.__doc__.split()[0] in ['t8','s8']:\n try: raise RuntimeError,`t(100000000000000000000000l)`\n except OverflowError: pass\n try: raise RuntimeError,`t(10000000011111111111111.23)`\n except OverflowError: pass\n else:\n if sys.version[:3]<'2.3':\n try: raise RuntimeError,`t(10000000000000l)`\n except OverflowError: pass\n try: raise RuntimeError,`t(10000000000.23)`\n except OverflowError: pass\n\nif __name__=='__main__':\n #import libwadpy\n status = 1\n try:\n repeat,f2py_opts = f2py2e.f2py_testing.cmdline()\n test_functions = build(f2py_opts)\n f2py2e.f2py_testing.run(runtest,test_functions,repeat)\n print 'ok'\n status = 0\n finally:\n if status:\n print '*'*20\n print 'Running f2py2e.diagnose'\n import numpy.f2py.diagnose as diagnose\n #diagnose.run()\n", + "methods": [ + { + "name": "build", + "long_name": "build( f2py_opts )", + "filename": "return_integer.py", + "nloc": 66, + "complexity": 2, + "token_count": 75, + "parameters": [ + "f2py_opts" + ], + "start_line": 13, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "runtest", + "long_name": "runtest( t )", + "filename": "return_integer.py", + "nloc": 47, + "complexity": 15, + "token_count": 464, + "parameters": [ + "t" + ], + "start_line": 81, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "build", + "long_name": "build( f2py_opts )", + "filename": "return_integer.py", + "nloc": 66, + "complexity": 2, + "token_count": 75, + "parameters": [ + "f2py_opts" + ], + "start_line": 13, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 67, + "top_nesting_level": 0 + }, + { + "name": "runtest", + "long_name": "runtest( t )", + "filename": "return_integer.py", + "nloc": 47, + "complexity": 15, + "token_count": 464, + "parameters": [ + "t" + ], + "start_line": 81, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 135, + "complexity": 17, + "token_count": 617, + "diff_parsed": { + "added": [ + "from numpy import array" + ], + "deleted": [ + "from numpy.base import array" + ] + } + }, + { + "old_path": "numpy/f2py/tests/f77/return_real.py", + "new_path": "numpy/f2py/tests/f77/return_real.py", + "filename": "return_real.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -8,7 +8,7 @@\n \n \n import numpy.f2py as f2py2e\n-from numpy.base import array\n+from numpy import array\n \n def build(f2py_opts):\n try:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "__usage__ = \"\"\"\nRun:\n python return_real.py []\nExamples:\n python return_real.py --fcompiler=Gnu --no-wrap-functions\n python return_real.py --quiet\n\"\"\"\n\n\nimport numpy.f2py as f2py2e\nfrom numpy import array\n\ndef build(f2py_opts):\n try:\n import f77_ext_return_real\n except ImportError:\n assert not f2py2e.compile('''\\\n function t0(value)\n real value\n real t0\n t0 = value\n end\n function t4(value)\n real*4 value\n real*4 t4\n t4 = value\n end\n function t8(value)\n real*8 value\n real*8 t8\n t8 = value\n end\n function td(value)\n double precision value\n double precision td\n td = value\n end\n\n subroutine s0(t0,value)\n real value\n real t0\ncf2py intent(out) t0\n t0 = value\n end\n subroutine s4(t4,value)\n real*4 value\n real*4 t4\ncf2py intent(out) t4\n t4 = value\n end\n subroutine s8(t8,value)\n real*8 value\n real*8 t8\ncf2py intent(out) t8\n t8 = value\n end\n subroutine sd(td,value)\n double precision value\n double precision td\ncf2py intent(out) td\n td = value\n end\n''','f77_ext_return_real',f2py_opts,source_fn='f77_ret_real.f')\n\n from f77_ext_return_real import t0,t4,t8,td,s0,s4,s8,sd\n test_functions = [t0,t4,t8,td,s0,s4,s8,sd]\n return test_functions\n\ndef runtest(t):\n import sys\n if t.__doc__.split()[0] in ['t0','t4','s0','s4']:\n err = 1e-5\n else:\n err = 0.0\n assert abs(t(234)-234.0)<=err\n assert abs(t(234.6)-234.6)<=err\n assert abs(t(234l)-234.0)<=err\n if sys.version[:3]<'2.3':\n assert abs(t(234.6+3j)-234.6)<=err\n assert abs(t('234')-234)<=err\n assert abs(t('234.6')-234.6)<=err\n assert abs(t(-234)+234)<=err\n assert abs(t([234])-234)<=err\n assert abs(t((234,))-234.)<=err\n assert abs(t(array(234))-234.)<=err\n assert abs(t(array([234]))-234.)<=err\n assert abs(t(array([[234]]))-234.)<=err\n assert abs(t(array([234],'b'))+22)<=err\n assert abs(t(array([234],'h'))-234.)<=err\n assert abs(t(array([234],'i'))-234.)<=err\n assert abs(t(array([234],'l'))-234.)<=err\n assert abs(t(array([234],'B'))-234.)<=err\n assert abs(t(array([234],'f'))-234.)<=err\n assert abs(t(array([234],'d'))-234.)<=err\n if sys.version[:3]<'2.3':\n assert abs(t(array([234+3j],'F'))-234.)<=err\n assert abs(t(array([234],'D'))-234.)<=err\n if t.__doc__.split()[0] in ['t0','t4','s0','s4']:\n assert t(1e200)==t(1e300) # inf\n\n try: raise RuntimeError,`t(array([234],'c'))`\n except ValueError: pass\n try: raise RuntimeError,`t('abc')`\n except ValueError: pass\n\n try: raise RuntimeError,`t([])`\n except IndexError: pass\n try: raise RuntimeError,`t(())`\n except IndexError: pass\n \n try: raise RuntimeError,`t(t)`\n except TypeError: pass\n try: raise RuntimeError,`t({})`\n except TypeError: pass\n\n try:\n try: raise RuntimeError,`t(10l**400)`\n except OverflowError: pass\n except RuntimeError:\n r = t(10l**400); assert `r` in ['inf','Infinity'],`r`\n\nif __name__=='__main__':\n #import libwadpy\n repeat,f2py_opts = f2py2e.f2py_testing.cmdline()\n test_functions = build(f2py_opts)\n f2py2e.f2py_testing.run(runtest,test_functions,repeat)\n print 'ok'\n", + "source_code_before": "__usage__ = \"\"\"\nRun:\n python return_real.py []\nExamples:\n python return_real.py --fcompiler=Gnu --no-wrap-functions\n python return_real.py --quiet\n\"\"\"\n\n\nimport numpy.f2py as f2py2e\nfrom numpy.base import array\n\ndef build(f2py_opts):\n try:\n import f77_ext_return_real\n except ImportError:\n assert not f2py2e.compile('''\\\n function t0(value)\n real value\n real t0\n t0 = value\n end\n function t4(value)\n real*4 value\n real*4 t4\n t4 = value\n end\n function t8(value)\n real*8 value\n real*8 t8\n t8 = value\n end\n function td(value)\n double precision value\n double precision td\n td = value\n end\n\n subroutine s0(t0,value)\n real value\n real t0\ncf2py intent(out) t0\n t0 = value\n end\n subroutine s4(t4,value)\n real*4 value\n real*4 t4\ncf2py intent(out) t4\n t4 = value\n end\n subroutine s8(t8,value)\n real*8 value\n real*8 t8\ncf2py intent(out) t8\n t8 = value\n end\n subroutine sd(td,value)\n double precision value\n double precision td\ncf2py intent(out) td\n td = value\n end\n''','f77_ext_return_real',f2py_opts,source_fn='f77_ret_real.f')\n\n from f77_ext_return_real import t0,t4,t8,td,s0,s4,s8,sd\n test_functions = [t0,t4,t8,td,s0,s4,s8,sd]\n return test_functions\n\ndef runtest(t):\n import sys\n if t.__doc__.split()[0] in ['t0','t4','s0','s4']:\n err = 1e-5\n else:\n err = 0.0\n assert abs(t(234)-234.0)<=err\n assert abs(t(234.6)-234.6)<=err\n assert abs(t(234l)-234.0)<=err\n if sys.version[:3]<'2.3':\n assert abs(t(234.6+3j)-234.6)<=err\n assert abs(t('234')-234)<=err\n assert abs(t('234.6')-234.6)<=err\n assert abs(t(-234)+234)<=err\n assert abs(t([234])-234)<=err\n assert abs(t((234,))-234.)<=err\n assert abs(t(array(234))-234.)<=err\n assert abs(t(array([234]))-234.)<=err\n assert abs(t(array([[234]]))-234.)<=err\n assert abs(t(array([234],'b'))+22)<=err\n assert abs(t(array([234],'h'))-234.)<=err\n assert abs(t(array([234],'i'))-234.)<=err\n assert abs(t(array([234],'l'))-234.)<=err\n assert abs(t(array([234],'B'))-234.)<=err\n assert abs(t(array([234],'f'))-234.)<=err\n assert abs(t(array([234],'d'))-234.)<=err\n if sys.version[:3]<'2.3':\n assert abs(t(array([234+3j],'F'))-234.)<=err\n assert abs(t(array([234],'D'))-234.)<=err\n if t.__doc__.split()[0] in ['t0','t4','s0','s4']:\n assert t(1e200)==t(1e300) # inf\n\n try: raise RuntimeError,`t(array([234],'c'))`\n except ValueError: pass\n try: raise RuntimeError,`t('abc')`\n except ValueError: pass\n\n try: raise RuntimeError,`t([])`\n except IndexError: pass\n try: raise RuntimeError,`t(())`\n except IndexError: pass\n \n try: raise RuntimeError,`t(t)`\n except TypeError: pass\n try: raise RuntimeError,`t({})`\n except TypeError: pass\n\n try:\n try: raise RuntimeError,`t(10l**400)`\n except OverflowError: pass\n except RuntimeError:\n r = t(10l**400); assert `r` in ['inf','Infinity'],`r`\n\nif __name__=='__main__':\n #import libwadpy\n repeat,f2py_opts = f2py2e.f2py_testing.cmdline()\n test_functions = build(f2py_opts)\n f2py2e.f2py_testing.run(runtest,test_functions,repeat)\n print 'ok'\n", + "methods": [ + { + "name": "build", + "long_name": "build( f2py_opts )", + "filename": "return_real.py", + "nloc": 54, + "complexity": 2, + "token_count": 67, + "parameters": [ + "f2py_opts" + ], + "start_line": 13, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "runtest", + "long_name": "runtest( t )", + "filename": "return_real.py", + "nloc": 48, + "complexity": 13, + "token_count": 606, + "parameters": [ + "t" + ], + "start_line": 69, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "build", + "long_name": "build( f2py_opts )", + "filename": "return_real.py", + "nloc": 54, + "complexity": 2, + "token_count": 67, + "parameters": [ + "f2py_opts" + ], + "start_line": 13, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "runtest", + "long_name": "runtest( t )", + "filename": "return_real.py", + "nloc": 48, + "complexity": 13, + "token_count": 606, + "parameters": [ + "t" + ], + "start_line": 69, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 116, + "complexity": 15, + "token_count": 724, + "diff_parsed": { + "added": [ + "from numpy import array" + ], + "deleted": [ + "from numpy.base import array" + ] + } + }, + { + "old_path": "numpy/lib/convertcode.py", + "new_path": "numpy/lib/convertcode.py", + "filename": "convertcode.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n \n-# This module converts code written for Numeric to run with numpy.base\n+# This module converts code written for Numeric to run with numpy\n \n # Makes the following changes:\n # * Converts typecharacters\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\n# This module converts code written for Numeric to run with numpy\n\n# Makes the following changes:\n# * Converts typecharacters\n# * Changes import statements (warns of use of from Numeric import *)\n# * Changes import statements (using numerix) ...\n# * Makes search and replace changes to:\n# - .typecode()\n# - .iscontiguous()\n# - .byteswapped()\n# - .itemsize()\n# * Converts .flat to .ravel() except for .flat = xxx or .flat[xxx]\n# * Change typecode= to dtype=\n# * Eliminates savespace=xxx\n# * Replace xxx.spacesaver() with True\n# * Convert xx.savespace(?) to pass + ## xx.savespace(?)\n# #### -- not * Convert a.shape = ? to a.reshape(?) \n# * Prints warning for use of bool, int, float, copmlex, object, and unicode\n#\n\n__all__ = ['fromfile', 'fromstr']\n\nimport sys\nimport os\nimport re\nimport glob\n\nflatindex_re = re.compile('([.]flat(\\s*?[[=]))')\n\ndef replacetypechars(astr):\n# astr = astr.replace(\"'s'\",\"'h'\")\n# astr = astr.replace(\"'c'\",\"'S1'\")\n astr = astr.replace(\"'b'\",\"'B'\")\n astr = astr.replace(\"'1'\",\"'b'\")\n# astr = astr.replace(\"'w'\",\"'H'\")\n astr = astr.replace(\"'u'\",\"'I'\")\n return astr\n\ndef changeimports(fstr, name, newname):\n importstr = 'import %s' % name\n importasstr = 'import %s as ' % name\n fromstr = 'from %s import ' % name\n fromall=0\n\n fstr = fstr.replace(importasstr, 'import %s as ' % newname)\n fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name))\n\n ind = 0\n Nlen = len(fromstr)\n Nlen2 = len(\"from %s import \" % newname)\n while 1:\n found = fstr.find(fromstr,ind)\n if (found < 0):\n break\n ind = found + Nlen\n if fstr[ind] == '*':\n continue\n fstr = \"%sfrom %s import %s\" % (fstr[:found], newname, fstr[ind:])\n ind += Nlen2 - Nlen\n return fstr, fromall\n\ndef replaceattr(astr):\n astr = astr.replace(\".typecode()\",\".dtypechar\")\n astr = astr.replace(\".iscontiguous()\",\".flags.contiguous\")\n astr = astr.replace(\".byteswapped()\",\".byteswap()\")\n astr = astr.replace(\".toscalar()\", \".item()\")\n astr = astr.replace(\".itemsize()\",\".itemsize\")\n # preserve uses of flat that should be o.k.\n tmpstr = flatindex_re.sub(\"@@@@\\\\2\",astr)\n # replace other uses of flat\n tmpstr = tmpstr.replace(\".flat\",\".ravel()\")\n # put back .flat where it was valid\n astr = tmpstr.replace(\"@@@@\", \".flat\")\n return astr\n\nsvspc = re.compile(r'(\\S+\\s*[(].+),\\s*savespace\\s*=.+\\s*[)]')\nsvspc2 = re.compile(r'([^,(\\s]+[.]spacesaver[(][)])')\nsvspc3 = re.compile(r'(\\S+[.]savespace[(].*[)])')\n#shpe = re.compile(r'(\\S+\\s*)[.]shape\\s*=[^=]\\s*(.+)')\ndef replaceother(astr):\n astr = astr.replace(\"typecode=\",\"dtype=\")\n astr = astr.replace(\"UserArray\",\"ndarray\")\n astr = svspc.sub('\\\\1)',astr)\n astr = svspc2.sub('True',astr)\n astr = svspc3.sub('pass ## \\\\1', astr)\n #astr = shpe.sub('\\\\1=\\\\1.reshape(\\\\2)', astr)\n return astr\n\nimport datetime\ndef fromstr(filestr):\n filestr = replacetypechars(filestr)\n filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy')\n filestr, fromall1 = changeimports(filestr, 'multiarray',\n 'numpy.core.multiarray')\n filestr, fromall1 = changeimports(filestr, 'umath',\n 'numpy.core.umath')\n filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy')\n filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab')\n filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.linalg')\n filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft')\n filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma')\n fromall = fromall1 or fromall2 or fromall3\n filestr = replaceattr(filestr)\n filestr = replaceother(filestr)\n today = datetime.date.today().strftime('%b %d, %Y')\n name = os.path.split(sys.argv[0])[-1]\n filestr = '## Automatically adapted for '\\\n 'numpy %s by %s\\n\\n%s' % (today, name, filestr)\n return filestr\n\ndef makenewfile(name, filestr):\n fid = file(name, 'w')\n fid.write(filestr)\n fid.close()\n\ndef getandcopy(name):\n fid = file(name)\n filestr = fid.read()\n fid.close()\n base, ext = os.path.splitext(name)\n makenewfile(base+'.orig', filestr)\n return filestr\n\ndef fromfile(filename):\n filestr = getandcopy(filename)\n filestr = fromstr(filestr)\n makenewfile(filename, filestr)\n \ndef fromargs(args):\n filename = args[1]\n fromfile(filename)\n\ndef convertall(direc=''):\n files = glob.glob(os.path.join(direc,'*.py'))\n for afile in files:\n fromfile(afile)\n\nif __name__ == '__main__':\n fromargs(sys.argv)\n \n \n\n", + "source_code_before": "\n# This module converts code written for Numeric to run with numpy.base\n\n# Makes the following changes:\n# * Converts typecharacters\n# * Changes import statements (warns of use of from Numeric import *)\n# * Changes import statements (using numerix) ...\n# * Makes search and replace changes to:\n# - .typecode()\n# - .iscontiguous()\n# - .byteswapped()\n# - .itemsize()\n# * Converts .flat to .ravel() except for .flat = xxx or .flat[xxx]\n# * Change typecode= to dtype=\n# * Eliminates savespace=xxx\n# * Replace xxx.spacesaver() with True\n# * Convert xx.savespace(?) to pass + ## xx.savespace(?)\n# #### -- not * Convert a.shape = ? to a.reshape(?) \n# * Prints warning for use of bool, int, float, copmlex, object, and unicode\n#\n\n__all__ = ['fromfile', 'fromstr']\n\nimport sys\nimport os\nimport re\nimport glob\n\nflatindex_re = re.compile('([.]flat(\\s*?[[=]))')\n\ndef replacetypechars(astr):\n# astr = astr.replace(\"'s'\",\"'h'\")\n# astr = astr.replace(\"'c'\",\"'S1'\")\n astr = astr.replace(\"'b'\",\"'B'\")\n astr = astr.replace(\"'1'\",\"'b'\")\n# astr = astr.replace(\"'w'\",\"'H'\")\n astr = astr.replace(\"'u'\",\"'I'\")\n return astr\n\ndef changeimports(fstr, name, newname):\n importstr = 'import %s' % name\n importasstr = 'import %s as ' % name\n fromstr = 'from %s import ' % name\n fromall=0\n\n fstr = fstr.replace(importasstr, 'import %s as ' % newname)\n fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name))\n\n ind = 0\n Nlen = len(fromstr)\n Nlen2 = len(\"from %s import \" % newname)\n while 1:\n found = fstr.find(fromstr,ind)\n if (found < 0):\n break\n ind = found + Nlen\n if fstr[ind] == '*':\n continue\n fstr = \"%sfrom %s import %s\" % (fstr[:found], newname, fstr[ind:])\n ind += Nlen2 - Nlen\n return fstr, fromall\n\ndef replaceattr(astr):\n astr = astr.replace(\".typecode()\",\".dtypechar\")\n astr = astr.replace(\".iscontiguous()\",\".flags.contiguous\")\n astr = astr.replace(\".byteswapped()\",\".byteswap()\")\n astr = astr.replace(\".toscalar()\", \".item()\")\n astr = astr.replace(\".itemsize()\",\".itemsize\")\n # preserve uses of flat that should be o.k.\n tmpstr = flatindex_re.sub(\"@@@@\\\\2\",astr)\n # replace other uses of flat\n tmpstr = tmpstr.replace(\".flat\",\".ravel()\")\n # put back .flat where it was valid\n astr = tmpstr.replace(\"@@@@\", \".flat\")\n return astr\n\nsvspc = re.compile(r'(\\S+\\s*[(].+),\\s*savespace\\s*=.+\\s*[)]')\nsvspc2 = re.compile(r'([^,(\\s]+[.]spacesaver[(][)])')\nsvspc3 = re.compile(r'(\\S+[.]savespace[(].*[)])')\n#shpe = re.compile(r'(\\S+\\s*)[.]shape\\s*=[^=]\\s*(.+)')\ndef replaceother(astr):\n astr = astr.replace(\"typecode=\",\"dtype=\")\n astr = astr.replace(\"UserArray\",\"ndarray\")\n astr = svspc.sub('\\\\1)',astr)\n astr = svspc2.sub('True',astr)\n astr = svspc3.sub('pass ## \\\\1', astr)\n #astr = shpe.sub('\\\\1=\\\\1.reshape(\\\\2)', astr)\n return astr\n\nimport datetime\ndef fromstr(filestr):\n filestr = replacetypechars(filestr)\n filestr, fromall1 = changeimports(filestr, 'Numeric', 'numpy')\n filestr, fromall1 = changeimports(filestr, 'multiarray',\n 'numpy.core.multiarray')\n filestr, fromall1 = changeimports(filestr, 'umath',\n 'numpy.core.umath')\n filestr, fromall1 = changeimports(filestr, 'Precision', 'numpy')\n filestr, fromall2 = changeimports(filestr, 'numerix', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'numpy_base', 'numpy')\n filestr, fromall3 = changeimports(filestr, 'MLab', 'numpy.lib.mlab')\n filestr, fromall3 = changeimports(filestr, 'LinearAlgebra', 'numpy.linalg')\n filestr, fromall3 = changeimports(filestr, 'RNG', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'RandomArray', 'numpy.random')\n filestr, fromall3 = changeimports(filestr, 'FFT', 'numpy.dft')\n filestr, fromall3 = changeimports(filestr, 'MA', 'numpy.core.ma')\n fromall = fromall1 or fromall2 or fromall3\n filestr = replaceattr(filestr)\n filestr = replaceother(filestr)\n today = datetime.date.today().strftime('%b %d, %Y')\n name = os.path.split(sys.argv[0])[-1]\n filestr = '## Automatically adapted for '\\\n 'numpy %s by %s\\n\\n%s' % (today, name, filestr)\n return filestr\n\ndef makenewfile(name, filestr):\n fid = file(name, 'w')\n fid.write(filestr)\n fid.close()\n\ndef getandcopy(name):\n fid = file(name)\n filestr = fid.read()\n fid.close()\n base, ext = os.path.splitext(name)\n makenewfile(base+'.orig', filestr)\n return filestr\n\ndef fromfile(filename):\n filestr = getandcopy(filename)\n filestr = fromstr(filestr)\n makenewfile(filename, filestr)\n \ndef fromargs(args):\n filename = args[1]\n fromfile(filename)\n\ndef convertall(direc=''):\n files = glob.glob(os.path.join(direc,'*.py'))\n for afile in files:\n fromfile(afile)\n\nif __name__ == '__main__':\n fromargs(sys.argv)\n \n \n\n", + "methods": [ + { + "name": "replacetypechars", + "long_name": "replacetypechars( astr )", + "filename": "convertcode.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "astr" + ], + "start_line": 31, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "changeimports", + "long_name": "changeimports( fstr , name , newname )", + "filename": "convertcode.py", + "nloc": 20, + "complexity": 4, + "token_count": 135, + "parameters": [ + "fstr", + "name", + "newname" + ], + "start_line": 40, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "replaceattr", + "long_name": "replaceattr( astr )", + "filename": "convertcode.py", + "nloc": 10, + "complexity": 1, + "token_count": 87, + "parameters": [ + "astr" + ], + "start_line": 63, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "replaceother", + "long_name": "replaceother( astr )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 57, + "parameters": [ + "astr" + ], + "start_line": 81, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fromstr", + "long_name": "fromstr( filestr )", + "filename": "convertcode.py", + "nloc": 24, + "complexity": 3, + "token_count": 222, + "parameters": [ + "filestr" + ], + "start_line": 91, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "makenewfile", + "long_name": "makenewfile( name , filestr )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "name", + "filestr" + ], + "start_line": 116, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getandcopy", + "long_name": "getandcopy( name )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 45, + "parameters": [ + "name" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "fromfile", + "long_name": "fromfile( filename )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "filename" + ], + "start_line": 129, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "fromargs", + "long_name": "fromargs( args )", + "filename": "convertcode.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "args" + ], + "start_line": 134, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "convertall", + "long_name": "convertall( direc = '' )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 2, + "token_count": 33, + "parameters": [ + "direc" + ], + "start_line": 138, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "replacetypechars", + "long_name": "replacetypechars( astr )", + "filename": "convertcode.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "astr" + ], + "start_line": 31, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "changeimports", + "long_name": "changeimports( fstr , name , newname )", + "filename": "convertcode.py", + "nloc": 20, + "complexity": 4, + "token_count": 135, + "parameters": [ + "fstr", + "name", + "newname" + ], + "start_line": 40, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "replaceattr", + "long_name": "replaceattr( astr )", + "filename": "convertcode.py", + "nloc": 10, + "complexity": 1, + "token_count": 87, + "parameters": [ + "astr" + ], + "start_line": 63, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "replaceother", + "long_name": "replaceother( astr )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 57, + "parameters": [ + "astr" + ], + "start_line": 81, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fromstr", + "long_name": "fromstr( filestr )", + "filename": "convertcode.py", + "nloc": 24, + "complexity": 3, + "token_count": 222, + "parameters": [ + "filestr" + ], + "start_line": 91, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "makenewfile", + "long_name": "makenewfile( name , filestr )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "name", + "filestr" + ], + "start_line": 116, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getandcopy", + "long_name": "getandcopy( name )", + "filename": "convertcode.py", + "nloc": 7, + "complexity": 1, + "token_count": 45, + "parameters": [ + "name" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "fromfile", + "long_name": "fromfile( filename )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "filename" + ], + "start_line": 129, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "fromargs", + "long_name": "fromargs( args )", + "filename": "convertcode.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "args" + ], + "start_line": 134, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "convertall", + "long_name": "convertall( direc = '' )", + "filename": "convertcode.py", + "nloc": 4, + "complexity": 2, + "token_count": 33, + "parameters": [ + "direc" + ], + "start_line": 138, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 100, + "complexity": 16, + "token_count": 753, + "diff_parsed": { + "added": [ + "# This module converts code written for Numeric to run with numpy" + ], + "deleted": [ + "# This module converts code written for Numeric to run with numpy.base" + ] + } + }, + { + "old_path": "numpy/lib/utils.py", + "new_path": "numpy/lib/utils.py", + "filename": "utils.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -15,7 +15,7 @@ def get_numpy_include():\n \"\"\"Return the directory in the package that contains the numpy/*.h header \n files.\n \n- Extension modules that need to compile against numpy.base should use this\n+ Extension modules that need to compile against numpy should use this\n function to locate the appropriate include directory. Using distutils:\n \n import numpy\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "from numpy.core.numerictypes import obj2dtype\n\n__all__ = ['issubclass_', 'get_numpy_include', 'issubdtype']\n\ndef issubclass_(arg1, arg2):\n try:\n return issubclass(arg1, arg2)\n except TypeError:\n return False\n\ndef issubdtype(arg1, arg2):\n return issubclass(obj2dtype(arg1), obj2dtype(arg2))\n \ndef get_numpy_include():\n \"\"\"Return the directory in the package that contains the numpy/*.h header \n files.\n \n Extension modules that need to compile against numpy should use this\n function to locate the appropriate include directory. Using distutils:\n \n import numpy\n Extension('extension_name', ...\n include_dirs=[numpy.get_numpy_include()])\n \"\"\"\n from numpy.distutils.misc_util import get_numpy_include_dirs\n include_dirs = get_numpy_include_dirs()\n assert len(include_dirs)==1,`include_dirs`\n return include_dirs[0]\n", + "source_code_before": "from numpy.core.numerictypes import obj2dtype\n\n__all__ = ['issubclass_', 'get_numpy_include', 'issubdtype']\n\ndef issubclass_(arg1, arg2):\n try:\n return issubclass(arg1, arg2)\n except TypeError:\n return False\n\ndef issubdtype(arg1, arg2):\n return issubclass(obj2dtype(arg1), obj2dtype(arg2))\n \ndef get_numpy_include():\n \"\"\"Return the directory in the package that contains the numpy/*.h header \n files.\n \n Extension modules that need to compile against numpy.base should use this\n function to locate the appropriate include directory. Using distutils:\n \n import numpy\n Extension('extension_name', ...\n include_dirs=[numpy.get_numpy_include()])\n \"\"\"\n from numpy.distutils.misc_util import get_numpy_include_dirs\n include_dirs = get_numpy_include_dirs()\n assert len(include_dirs)==1,`include_dirs`\n return include_dirs[0]\n", + "methods": [ + { + "name": "issubclass_", + "long_name": "issubclass_( arg1 , arg2 )", + "filename": "utils.py", + "nloc": 5, + "complexity": 2, + "token_count": 21, + "parameters": [ + "arg1", + "arg2" + ], + "start_line": 5, + "end_line": 9, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "issubdtype", + "long_name": "issubdtype( arg1 , arg2 )", + "filename": "utils.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "arg1", + "arg2" + ], + "start_line": 11, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include", + "long_name": "get_numpy_include( )", + "filename": "utils.py", + "nloc": 5, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 14, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "issubclass_", + "long_name": "issubclass_( arg1 , arg2 )", + "filename": "utils.py", + "nloc": 5, + "complexity": 2, + "token_count": 21, + "parameters": [ + "arg1", + "arg2" + ], + "start_line": 5, + "end_line": 9, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "issubdtype", + "long_name": "issubdtype( arg1 , arg2 )", + "filename": "utils.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "arg1", + "arg2" + ], + "start_line": 11, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include", + "long_name": "get_numpy_include( )", + "filename": "utils.py", + "nloc": 5, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 14, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_numpy_include", + "long_name": "get_numpy_include( )", + "filename": "utils.py", + "nloc": 5, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 14, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 14, + "complexity": 4, + "token_count": 95, + "diff_parsed": { + "added": [ + " Extension modules that need to compile against numpy should use this" + ], + "deleted": [ + " Extension modules that need to compile against numpy.base should use this" + ] + } + } + ] + }, + { + "hash": "2f01cc8b3c368242224f7ff63e1e5343cf890e9c", + "msg": "Move package loader to _import_tools.py", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T01:14:35+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T01:14:35+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "f115fdf57332da17fd43202a1512b02902a77048" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 266, + "insertions": 267, + "lines": 533, + "files": 2, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/__init__.py", + "new_path": "numpy/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -24,276 +24,13 @@\n except ImportError:\n show_core_config = None\n \n-class PackageLoader:\n- def __init__(self):\n- \"\"\" Manages loading NumPy packages.\n- \"\"\"\n-\n- self.parent_frame = frame = sys._getframe(1)\n- self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n- self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n- if not frame.f_locals.has_key('__all__'):\n- exec('__all__ = []',frame.f_globals,frame.f_locals)\n- self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n-\n- self.info_modules = None\n- self.imported_packages = []\n- self.verbose = None\n-\n- def _get_info_files(self, package_dir, parent_path, parent_package=None):\n- \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n- \"\"\"\n- from glob import glob\n- files = glob(os.path.join(parent_path,package_dir,'info.py'))\n- for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n- if info_file[:-1] not in files:\n- files.append(info_file)\n- info_files = []\n- for info_file in files:\n- package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n- .replace(os.sep,'.')\n- if parent_package:\n- package_name = parent_package + '.' + package_name\n- info_files.append((package_name,info_file))\n- info_files.extend(self._get_info_files('*',\n- os.path.dirname(info_file),\n- package_name))\n- return info_files\n-\n- def _init_info_modules(self, packages=None):\n- \"\"\"Initialize info_modules = {: }.\n- \"\"\"\n- import imp\n- info_files = []\n- if packages is None:\n- for path in self.parent_path:\n- info_files.extend(self._get_info_files('*',path))\n- else:\n- for package_name in packages:\n- package_dir = os.path.join(*package_name.split('.'))\n- for path in self.parent_path:\n- names_files = self._get_info_files(package_dir, path)\n- if names_files:\n- info_files.extend(names_files)\n- break\n- else:\n- self.warn('Package %r does not have info.py file. Ignoring.'\\\n- % package_name)\n-\n- info_modules = self.info_modules\n- for package_name,info_file in info_files:\n- if info_modules.has_key(package_name):\n- continue\n- fullname = self.parent_name +'.'+ package_name\n- if info_file[-1]=='c':\n- filedescriptor = ('.pyc','rb',2)\n- else:\n- filedescriptor = ('.py','U',1)\n-\n- try:\n- info_module = imp.load_module(fullname+'.info',\n- open(info_file,filedescriptor[1]),\n- info_file,\n- filedescriptor)\n- except Exception,msg:\n- self.error(msg)\n- info_module = None\n-\n- if info_module is None or getattr(info_module,'ignore',False):\n- info_modules.pop(package_name,None)\n- else:\n- self._init_info_modules(getattr(info_module,'depends',[]))\n- info_modules[package_name] = info_module\n-\n- return\n-\n- def _get_sorted_names(self):\n- \"\"\" Return package names sorted in the order as they should be\n- imported due to dependence relations between packages. \n- \"\"\"\n-\n- depend_dict = {}\n- for name,info_module in self.info_modules.items():\n- depend_dict[name] = getattr(info_module,'depends',[])\n- package_names = []\n-\n- for name in depend_dict.keys():\n- if not depend_dict[name]:\n- package_names.append(name)\n- del depend_dict[name]\n-\n- while depend_dict:\n- for name, lst in depend_dict.items():\n- new_lst = [n for n in lst if depend_dict.has_key(n)]\n- if not new_lst:\n- package_names.append(name)\n- del depend_dict[name]\n- else:\n- depend_dict[name] = new_lst\n-\n- return package_names\n-\n- def __call__(self,*packages, **options):\n- \"\"\"Load one or more packages into numpy's top-level namespace.\n-\n- Usage:\n-\n- This function is intended to shorten the need to import many of numpy's\n- submodules constantly with statements such as\n-\n- import numpy.linalg, numpy.fft, numpy.etc...\n-\n- Instead, you can say:\n-\n- import numpy\n- numpy.pkgload('linalg','fft',...)\n-\n- or\n-\n- numpy.pkgload()\n-\n- to load all of them in one call.\n-\n- If a name which doesn't exist in numpy's namespace is\n- given, an exception [[WHAT? ImportError, probably?]] is raised.\n- [NotImplemented]\n-\n- Inputs:\n-\n- - the names (one or more strings) of all the numpy modules one wishes to\n- load into the top-level namespace.\n-\n- Optional keyword inputs:\n-\n- - verbose - integer specifying verbosity level [default: 0].\n- - force - when True, force reloading loaded packages [default: False].\n- - postpone - when True, don't load packages [default: False]\n-\n- If no input arguments are given, then all of numpy's subpackages are\n- imported.\n-\n-\n- Outputs:\n-\n- The function returns a tuple with all the names of the modules which\n- were actually imported. [NotImplemented]\n-\n- \"\"\"\n- frame = self.parent_frame\n- self.info_modules = {}\n- if options.get('force',False):\n- self.imported_packages = []\n- self.verbose = verbose = options.get('verbose',False)\n- postpone = options.get('postpone',False)\n-\n- self._init_info_modules(packages or None)\n-\n- self.log('Imports to %r namespace\\n----------------------------'\\\n- % self.parent_name)\n-\n- for package_name in self._get_sorted_names():\n- if package_name in self.imported_packages:\n- continue\n- info_module = self.info_modules[package_name]\n- global_symbols = getattr(info_module,'global_symbols',[]) \n- if postpone and not global_symbols:\n- self.log('__all__.append(%r)' % (package_name))\n- if '.' not in package_name:\n- self.parent_export_names.append(package_name)\n- continue\n- \n- old_object = frame.f_locals.get(package_name,None)\n-\n- cmdstr = 'import '+package_name\n- if self._execcmd(cmdstr):\n- continue\n- self.imported_packages.append(package_name)\n- \n- if verbose!=-1:\n- new_object = frame.f_locals.get(package_name)\n- if old_object is not None and old_object is not new_object:\n- self.warn('Overwriting %s=%s (was %s)' \\\n- % (package_name,self._obj2str(new_object),\n- self._obj2str(old_object)))\n-\n- if '.' not in package_name:\n- self.parent_export_names.append(package_name)\n-\n- for symbol in global_symbols:\n- if symbol=='*':\n- symbols = eval('getattr(%s,\"__all__\",None)'\\\n- % (package_name),\n- frame.f_globals,frame.f_locals)\n- if symbols is None:\n- symbols = eval('dir(%s)' % (package_name),\n- frame.f_globals,frame.f_locals)\n- symbols = filter(lambda s:not s.startswith('_'),symbols)\n- else:\n- symbols = [symbol]\n-\n- if verbose!=-1:\n- old_objects = {}\n- for s in symbols:\n- if frame.f_locals.has_key(s):\n- old_objects[s] = frame.f_locals[s]\n-\n- cmdstr = 'from '+package_name+' import '+symbol\n- if self._execcmd(cmdstr):\n- continue\n-\n- if verbose!=-1:\n- for s,old_object in old_objects.items():\n- new_object = frame.f_locals[s]\n- if new_object is not old_object:\n- self.warn('Overwriting %s=%s (was %s)' \\\n- % (s,self._obj2repr(new_object),\n- self._obj2repr(old_object)))\n-\n- if symbol=='*':\n- self.parent_export_names.extend(symbols)\n- else:\n- self.parent_export_names.append(symbol)\n-\n- return\n-\n- def _execcmd(self,cmdstr):\n- \"\"\" Execute command in parent_frame.\"\"\"\n- frame = self.parent_frame\n- try:\n- exec (cmdstr, frame.f_globals,frame.f_locals)\n- except Exception,msg:\n- self.error('%s -> failed: %s' % (cmdstr,msg))\n- return True\n- else:\n- self.log('%s -> success' % (cmdstr)) \n- return\n-\n- def _obj2repr(self,obj):\n- \"\"\" Return repr(obj) with\"\"\"\n- module = getattr(obj,'__module__',None)\n- file = getattr(obj,'__file__',None)\n- if module is not None:\n- return repr(obj) + ' from ' + module\n- if file is not None:\n- return repr(obj) + ' from ' + file\n- return repr(obj)\n-\n- def log(self,mess):\n- if self.verbose>1:\n- print >> sys.stderr, str(mess)\n- def warn(self,mess):\n- if self.verbose>=0:\n- print >> sys.stderr, str(mess)\n- def error(self,mess):\n- if self.verbose!=-1:\n- print >> sys.stderr, str(mess)\n-\n try:\n import pkg_resources # activate namespace packages (manipulates __path__)\n except ImportError:\n pass\n \n-pkgload = PackageLoader()\n+import _import_tools\n+pkgload = _import_tools.PackageLoader()\n \n if show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\n@@ -303,7 +40,6 @@ def error(self,mess):\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n \n-\n test = ScipyTest('numpy').test\n __all__.append('test')\n \n", + "added_lines": 2, + "deleted_lines": 266, + "source_code": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __core_config__ import show as show_core_config\nexcept ImportError:\n show_core_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nimport _import_tools\npkgload = _import_tools.PackageLoader()\n\nif show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\nelse:\n from version import version as __version__\n\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n\n test = ScipyTest('numpy').test\n __all__.append('test')\n\n__numpy_doc__ = \"\"\"\n\nNumPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nif show_core_config is None:\n show_numpy_config = None\nelse:\n try:\n from __numpy_config__ import show as show_numpy_config\n except ImportError:\n show_numpy_config = None\n\n\nif show_numpy_config is not None:\n from numpy_version import numpy_version as __numpy_version__\n __doc__ += __numpy_doc__\n pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n", + "source_code_before": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __core_config__ import show as show_core_config\nexcept ImportError:\n show_core_config = None\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\npkgload = PackageLoader()\n\nif show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\nelse:\n from version import version as __version__\n\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n\n\n test = ScipyTest('numpy').test\n __all__.append('test')\n\n__numpy_doc__ = \"\"\"\n\nNumPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nif show_core_config is None:\n show_numpy_config = None\nelse:\n try:\n from __numpy_config__ import show as show_numpy_config\n except ImportError:\n show_numpy_config = None\n\n\nif show_numpy_config is not None:\n from numpy_version import numpy_version as __numpy_version__\n __doc__ += __numpy_doc__\n pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n", + "methods": [], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "__init__.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 43, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "__init__.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 63, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "__init__.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "__init__.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 136, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 259, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "__init__.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 271, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 281, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 287, + "end_line": 289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "__init__.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 43, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "__init__.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 136, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 287, + "end_line": 289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "__init__.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 259, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "__init__.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "__init__.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 63, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 281, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "__init__.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "__init__.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 271, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + } + ], + "nloc": 56, + "complexity": 0, + "token_count": 156, + "diff_parsed": { + "added": [ + "import _import_tools", + "pkgload = _import_tools.PackageLoader()" + ], + "deleted": [ + "class PackageLoader:", + " def __init__(self):", + " \"\"\" Manages loading NumPy packages.", + " \"\"\"", + "", + " self.parent_frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)", + " if not frame.f_locals.has_key('__all__'):", + " exec('__all__ = []',frame.f_globals,frame.f_locals)", + " self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)", + "", + " self.info_modules = None", + " self.imported_packages = []", + " self.verbose = None", + "", + " def _get_info_files(self, package_dir, parent_path, parent_package=None):", + " \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.", + " \"\"\"", + " from glob import glob", + " files = glob(os.path.join(parent_path,package_dir,'info.py'))", + " for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):", + " if info_file[:-1] not in files:", + " files.append(info_file)", + " info_files = []", + " for info_file in files:", + " package_name = os.path.dirname(info_file[len(parent_path)+1:])\\", + " .replace(os.sep,'.')", + " if parent_package:", + " package_name = parent_package + '.' + package_name", + " info_files.append((package_name,info_file))", + " info_files.extend(self._get_info_files('*',", + " os.path.dirname(info_file),", + " package_name))", + " return info_files", + "", + " def _init_info_modules(self, packages=None):", + " \"\"\"Initialize info_modules = {: }.", + " \"\"\"", + " import imp", + " info_files = []", + " if packages is None:", + " for path in self.parent_path:", + " info_files.extend(self._get_info_files('*',path))", + " else:", + " for package_name in packages:", + " package_dir = os.path.join(*package_name.split('.'))", + " for path in self.parent_path:", + " names_files = self._get_info_files(package_dir, path)", + " if names_files:", + " info_files.extend(names_files)", + " break", + " else:", + " self.warn('Package %r does not have info.py file. Ignoring.'\\", + " % package_name)", + "", + " info_modules = self.info_modules", + " for package_name,info_file in info_files:", + " if info_modules.has_key(package_name):", + " continue", + " fullname = self.parent_name +'.'+ package_name", + " if info_file[-1]=='c':", + " filedescriptor = ('.pyc','rb',2)", + " else:", + " filedescriptor = ('.py','U',1)", + "", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,filedescriptor[1]),", + " info_file,", + " filedescriptor)", + " except Exception,msg:", + " self.error(msg)", + " info_module = None", + "", + " if info_module is None or getattr(info_module,'ignore',False):", + " info_modules.pop(package_name,None)", + " else:", + " self._init_info_modules(getattr(info_module,'depends',[]))", + " info_modules[package_name] = info_module", + "", + " return", + "", + " def _get_sorted_names(self):", + " \"\"\" Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + "", + " depend_dict = {}", + " for name,info_module in self.info_modules.items():", + " depend_dict[name] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def __call__(self,*packages, **options):", + " \"\"\"Load one or more packages into numpy's top-level namespace.", + "", + " Usage:", + "", + " This function is intended to shorten the need to import many of numpy's", + " submodules constantly with statements such as", + "", + " import numpy.linalg, numpy.fft, numpy.etc...", + "", + " Instead, you can say:", + "", + " import numpy", + " numpy.pkgload('linalg','fft',...)", + "", + " or", + "", + " numpy.pkgload()", + "", + " to load all of them in one call.", + "", + " If a name which doesn't exist in numpy's namespace is", + " given, an exception [[WHAT? ImportError, probably?]] is raised.", + " [NotImplemented]", + "", + " Inputs:", + "", + " - the names (one or more strings) of all the numpy modules one wishes to", + " load into the top-level namespace.", + "", + " Optional keyword inputs:", + "", + " - verbose - integer specifying verbosity level [default: 0].", + " - force - when True, force reloading loaded packages [default: False].", + " - postpone - when True, don't load packages [default: False]", + "", + " If no input arguments are given, then all of numpy's subpackages are", + " imported.", + "", + "", + " Outputs:", + "", + " The function returns a tuple with all the names of the modules which", + " were actually imported. [NotImplemented]", + "", + " \"\"\"", + " frame = self.parent_frame", + " self.info_modules = {}", + " if options.get('force',False):", + " self.imported_packages = []", + " self.verbose = verbose = options.get('verbose',False)", + " postpone = options.get('postpone',False)", + "", + " self._init_info_modules(packages or None)", + "", + " self.log('Imports to %r namespace\\n----------------------------'\\", + " % self.parent_name)", + "", + " for package_name in self._get_sorted_names():", + " if package_name in self.imported_packages:", + " continue", + " info_module = self.info_modules[package_name]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " if postpone and not global_symbols:", + " self.log('__all__.append(%r)' % (package_name))", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + " continue", + "", + " old_object = frame.f_locals.get(package_name,None)", + "", + " cmdstr = 'import '+package_name", + " if self._execcmd(cmdstr):", + " continue", + " self.imported_packages.append(package_name)", + "", + " if verbose!=-1:", + " new_object = frame.f_locals.get(package_name)", + " if old_object is not None and old_object is not new_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (package_name,self._obj2str(new_object),", + " self._obj2str(old_object)))", + "", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + "", + " for symbol in global_symbols:", + " if symbol=='*':", + " symbols = eval('getattr(%s,\"__all__\",None)'\\", + " % (package_name),", + " frame.f_globals,frame.f_locals)", + " if symbols is None:", + " symbols = eval('dir(%s)' % (package_name),", + " frame.f_globals,frame.f_locals)", + " symbols = filter(lambda s:not s.startswith('_'),symbols)", + " else:", + " symbols = [symbol]", + "", + " if verbose!=-1:", + " old_objects = {}", + " for s in symbols:", + " if frame.f_locals.has_key(s):", + " old_objects[s] = frame.f_locals[s]", + "", + " cmdstr = 'from '+package_name+' import '+symbol", + " if self._execcmd(cmdstr):", + " continue", + "", + " if verbose!=-1:", + " for s,old_object in old_objects.items():", + " new_object = frame.f_locals[s]", + " if new_object is not old_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (s,self._obj2repr(new_object),", + " self._obj2repr(old_object)))", + "", + " if symbol=='*':", + " self.parent_export_names.extend(symbols)", + " else:", + " self.parent_export_names.append(symbol)", + "", + " return", + "", + " def _execcmd(self,cmdstr):", + " \"\"\" Execute command in parent_frame.\"\"\"", + " frame = self.parent_frame", + " try:", + " exec (cmdstr, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " self.error('%s -> failed: %s' % (cmdstr,msg))", + " return True", + " else:", + " self.log('%s -> success' % (cmdstr))", + " return", + "", + " def _obj2repr(self,obj):", + " \"\"\" Return repr(obj) with\"\"\"", + " module = getattr(obj,'__module__',None)", + " file = getattr(obj,'__file__',None)", + " if module is not None:", + " return repr(obj) + ' from ' + module", + " if file is not None:", + " return repr(obj) + ' from ' + file", + " return repr(obj)", + "", + " def log(self,mess):", + " if self.verbose>1:", + " print >> sys.stderr, str(mess)", + " def warn(self,mess):", + " if self.verbose>=0:", + " print >> sys.stderr, str(mess)", + " def error(self,mess):", + " if self.verbose!=-1:", + " print >> sys.stderr, str(mess)", + "", + "pkgload = PackageLoader()", + "" + ] + } + }, + { + "old_path": "numpy/_import_tools.py", + "new_path": "numpy/_import_tools.py", + "filename": "_import_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -146,3 +146,268 @@ def import_packages(self, packages=None):\n print >> sys.stderr, msg\n \n return self._format_titles(titles)\n+\n+class PackageLoader:\n+ def __init__(self):\n+ \"\"\" Manages loading NumPy packages.\n+ \"\"\"\n+\n+ self.parent_frame = frame = sys._getframe(1)\n+ self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n+ self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n+ if not frame.f_locals.has_key('__all__'):\n+ exec('__all__ = []',frame.f_globals,frame.f_locals)\n+ self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n+\n+ self.info_modules = None\n+ self.imported_packages = []\n+ self.verbose = None\n+\n+ def _get_info_files(self, package_dir, parent_path, parent_package=None):\n+ \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n+ \"\"\"\n+ from glob import glob\n+ files = glob(os.path.join(parent_path,package_dir,'info.py'))\n+ for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n+ if info_file[:-1] not in files:\n+ files.append(info_file)\n+ info_files = []\n+ for info_file in files:\n+ package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n+ .replace(os.sep,'.')\n+ if parent_package:\n+ package_name = parent_package + '.' + package_name\n+ info_files.append((package_name,info_file))\n+ info_files.extend(self._get_info_files('*',\n+ os.path.dirname(info_file),\n+ package_name))\n+ return info_files\n+\n+ def _init_info_modules(self, packages=None):\n+ \"\"\"Initialize info_modules = {: }.\n+ \"\"\"\n+ import imp\n+ info_files = []\n+ if packages is None:\n+ for path in self.parent_path:\n+ info_files.extend(self._get_info_files('*',path))\n+ else:\n+ for package_name in packages:\n+ package_dir = os.path.join(*package_name.split('.'))\n+ for path in self.parent_path:\n+ names_files = self._get_info_files(package_dir, path)\n+ if names_files:\n+ info_files.extend(names_files)\n+ break\n+ else:\n+ self.warn('Package %r does not have info.py file. Ignoring.'\\\n+ % package_name)\n+\n+ info_modules = self.info_modules\n+ for package_name,info_file in info_files:\n+ if info_modules.has_key(package_name):\n+ continue\n+ fullname = self.parent_name +'.'+ package_name\n+ if info_file[-1]=='c':\n+ filedescriptor = ('.pyc','rb',2)\n+ else:\n+ filedescriptor = ('.py','U',1)\n+\n+ try:\n+ info_module = imp.load_module(fullname+'.info',\n+ open(info_file,filedescriptor[1]),\n+ info_file,\n+ filedescriptor)\n+ except Exception,msg:\n+ self.error(msg)\n+ info_module = None\n+\n+ if info_module is None or getattr(info_module,'ignore',False):\n+ info_modules.pop(package_name,None)\n+ else:\n+ self._init_info_modules(getattr(info_module,'depends',[]))\n+ info_modules[package_name] = info_module\n+\n+ return\n+\n+ def _get_sorted_names(self):\n+ \"\"\" Return package names sorted in the order as they should be\n+ imported due to dependence relations between packages. \n+ \"\"\"\n+\n+ depend_dict = {}\n+ for name,info_module in self.info_modules.items():\n+ depend_dict[name] = getattr(info_module,'depends',[])\n+ package_names = []\n+\n+ for name in depend_dict.keys():\n+ if not depend_dict[name]:\n+ package_names.append(name)\n+ del depend_dict[name]\n+\n+ while depend_dict:\n+ for name, lst in depend_dict.items():\n+ new_lst = [n for n in lst if depend_dict.has_key(n)]\n+ if not new_lst:\n+ package_names.append(name)\n+ del depend_dict[name]\n+ else:\n+ depend_dict[name] = new_lst\n+\n+ return package_names\n+\n+ def __call__(self,*packages, **options):\n+ \"\"\"Load one or more packages into numpy's top-level namespace.\n+\n+ Usage:\n+\n+ This function is intended to shorten the need to import many of numpy's\n+ submodules constantly with statements such as\n+\n+ import numpy.linalg, numpy.fft, numpy.etc...\n+\n+ Instead, you can say:\n+\n+ import numpy\n+ numpy.pkgload('linalg','fft',...)\n+\n+ or\n+\n+ numpy.pkgload()\n+\n+ to load all of them in one call.\n+\n+ If a name which doesn't exist in numpy's namespace is\n+ given, an exception [[WHAT? ImportError, probably?]] is raised.\n+ [NotImplemented]\n+\n+ Inputs:\n+\n+ - the names (one or more strings) of all the numpy modules one wishes to\n+ load into the top-level namespace.\n+\n+ Optional keyword inputs:\n+\n+ - verbose - integer specifying verbosity level [default: 0].\n+ - force - when True, force reloading loaded packages [default: False].\n+ - postpone - when True, don't load packages [default: False]\n+\n+ If no input arguments are given, then all of numpy's subpackages are\n+ imported.\n+\n+\n+ Outputs:\n+\n+ The function returns a tuple with all the names of the modules which\n+ were actually imported. [NotImplemented]\n+\n+ \"\"\"\n+ frame = self.parent_frame\n+ self.info_modules = {}\n+ if options.get('force',False):\n+ self.imported_packages = []\n+ self.verbose = verbose = options.get('verbose',False)\n+ postpone = options.get('postpone',False)\n+\n+ self._init_info_modules(packages or None)\n+\n+ self.log('Imports to %r namespace\\n----------------------------'\\\n+ % self.parent_name)\n+\n+ for package_name in self._get_sorted_names():\n+ if package_name in self.imported_packages:\n+ continue\n+ info_module = self.info_modules[package_name]\n+ global_symbols = getattr(info_module,'global_symbols',[]) \n+ if postpone and not global_symbols:\n+ self.log('__all__.append(%r)' % (package_name))\n+ if '.' not in package_name:\n+ self.parent_export_names.append(package_name)\n+ continue\n+ \n+ old_object = frame.f_locals.get(package_name,None)\n+\n+ cmdstr = 'import '+package_name\n+ if self._execcmd(cmdstr):\n+ continue\n+ self.imported_packages.append(package_name)\n+ \n+ if verbose!=-1:\n+ new_object = frame.f_locals.get(package_name)\n+ if old_object is not None and old_object is not new_object:\n+ self.warn('Overwriting %s=%s (was %s)' \\\n+ % (package_name,self._obj2str(new_object),\n+ self._obj2str(old_object)))\n+\n+ if '.' not in package_name:\n+ self.parent_export_names.append(package_name)\n+\n+ for symbol in global_symbols:\n+ if symbol=='*':\n+ symbols = eval('getattr(%s,\"__all__\",None)'\\\n+ % (package_name),\n+ frame.f_globals,frame.f_locals)\n+ if symbols is None:\n+ symbols = eval('dir(%s)' % (package_name),\n+ frame.f_globals,frame.f_locals)\n+ symbols = filter(lambda s:not s.startswith('_'),symbols)\n+ else:\n+ symbols = [symbol]\n+\n+ if verbose!=-1:\n+ old_objects = {}\n+ for s in symbols:\n+ if frame.f_locals.has_key(s):\n+ old_objects[s] = frame.f_locals[s]\n+\n+ cmdstr = 'from '+package_name+' import '+symbol\n+ if self._execcmd(cmdstr):\n+ continue\n+\n+ if verbose!=-1:\n+ for s,old_object in old_objects.items():\n+ new_object = frame.f_locals[s]\n+ if new_object is not old_object:\n+ self.warn('Overwriting %s=%s (was %s)' \\\n+ % (s,self._obj2repr(new_object),\n+ self._obj2repr(old_object)))\n+\n+ if symbol=='*':\n+ self.parent_export_names.extend(symbols)\n+ else:\n+ self.parent_export_names.append(symbol)\n+\n+ return\n+\n+ def _execcmd(self,cmdstr):\n+ \"\"\" Execute command in parent_frame.\"\"\"\n+ frame = self.parent_frame\n+ try:\n+ exec (cmdstr, frame.f_globals,frame.f_locals)\n+ except Exception,msg:\n+ self.error('%s -> failed: %s' % (cmdstr,msg))\n+ return True\n+ else:\n+ self.log('%s -> success' % (cmdstr)) \n+ return\n+\n+ def _obj2repr(self,obj):\n+ \"\"\" Return repr(obj) with\"\"\"\n+ module = getattr(obj,'__module__',None)\n+ file = getattr(obj,'__file__',None)\n+ if module is not None:\n+ return repr(obj) + ' from ' + module\n+ if file is not None:\n+ return repr(obj) + ' from ' + file\n+ return repr(obj)\n+\n+ def log(self,mess):\n+ if self.verbose>1:\n+ print >> sys.stderr, str(mess)\n+ def warn(self,mess):\n+ if self.verbose>=0:\n+ print >> sys.stderr, str(mess)\n+ def error(self,mess):\n+ if self.verbose!=-1:\n+ print >> sys.stderr, str(mess)\n+\n", + "added_lines": 265, + "deleted_lines": 0, + "source_code": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\n", + "source_code_before": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + } + ], + "nloc": 287, + "complexity": 93, + "token_count": 2071, + "diff_parsed": { + "added": [ + "", + "class PackageLoader:", + " def __init__(self):", + " \"\"\" Manages loading NumPy packages.", + " \"\"\"", + "", + " self.parent_frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)", + " if not frame.f_locals.has_key('__all__'):", + " exec('__all__ = []',frame.f_globals,frame.f_locals)", + " self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)", + "", + " self.info_modules = None", + " self.imported_packages = []", + " self.verbose = None", + "", + " def _get_info_files(self, package_dir, parent_path, parent_package=None):", + " \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.", + " \"\"\"", + " from glob import glob", + " files = glob(os.path.join(parent_path,package_dir,'info.py'))", + " for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):", + " if info_file[:-1] not in files:", + " files.append(info_file)", + " info_files = []", + " for info_file in files:", + " package_name = os.path.dirname(info_file[len(parent_path)+1:])\\", + " .replace(os.sep,'.')", + " if parent_package:", + " package_name = parent_package + '.' + package_name", + " info_files.append((package_name,info_file))", + " info_files.extend(self._get_info_files('*',", + " os.path.dirname(info_file),", + " package_name))", + " return info_files", + "", + " def _init_info_modules(self, packages=None):", + " \"\"\"Initialize info_modules = {: }.", + " \"\"\"", + " import imp", + " info_files = []", + " if packages is None:", + " for path in self.parent_path:", + " info_files.extend(self._get_info_files('*',path))", + " else:", + " for package_name in packages:", + " package_dir = os.path.join(*package_name.split('.'))", + " for path in self.parent_path:", + " names_files = self._get_info_files(package_dir, path)", + " if names_files:", + " info_files.extend(names_files)", + " break", + " else:", + " self.warn('Package %r does not have info.py file. Ignoring.'\\", + " % package_name)", + "", + " info_modules = self.info_modules", + " for package_name,info_file in info_files:", + " if info_modules.has_key(package_name):", + " continue", + " fullname = self.parent_name +'.'+ package_name", + " if info_file[-1]=='c':", + " filedescriptor = ('.pyc','rb',2)", + " else:", + " filedescriptor = ('.py','U',1)", + "", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,filedescriptor[1]),", + " info_file,", + " filedescriptor)", + " except Exception,msg:", + " self.error(msg)", + " info_module = None", + "", + " if info_module is None or getattr(info_module,'ignore',False):", + " info_modules.pop(package_name,None)", + " else:", + " self._init_info_modules(getattr(info_module,'depends',[]))", + " info_modules[package_name] = info_module", + "", + " return", + "", + " def _get_sorted_names(self):", + " \"\"\" Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + "", + " depend_dict = {}", + " for name,info_module in self.info_modules.items():", + " depend_dict[name] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def __call__(self,*packages, **options):", + " \"\"\"Load one or more packages into numpy's top-level namespace.", + "", + " Usage:", + "", + " This function is intended to shorten the need to import many of numpy's", + " submodules constantly with statements such as", + "", + " import numpy.linalg, numpy.fft, numpy.etc...", + "", + " Instead, you can say:", + "", + " import numpy", + " numpy.pkgload('linalg','fft',...)", + "", + " or", + "", + " numpy.pkgload()", + "", + " to load all of them in one call.", + "", + " If a name which doesn't exist in numpy's namespace is", + " given, an exception [[WHAT? ImportError, probably?]] is raised.", + " [NotImplemented]", + "", + " Inputs:", + "", + " - the names (one or more strings) of all the numpy modules one wishes to", + " load into the top-level namespace.", + "", + " Optional keyword inputs:", + "", + " - verbose - integer specifying verbosity level [default: 0].", + " - force - when True, force reloading loaded packages [default: False].", + " - postpone - when True, don't load packages [default: False]", + "", + " If no input arguments are given, then all of numpy's subpackages are", + " imported.", + "", + "", + " Outputs:", + "", + " The function returns a tuple with all the names of the modules which", + " were actually imported. [NotImplemented]", + "", + " \"\"\"", + " frame = self.parent_frame", + " self.info_modules = {}", + " if options.get('force',False):", + " self.imported_packages = []", + " self.verbose = verbose = options.get('verbose',False)", + " postpone = options.get('postpone',False)", + "", + " self._init_info_modules(packages or None)", + "", + " self.log('Imports to %r namespace\\n----------------------------'\\", + " % self.parent_name)", + "", + " for package_name in self._get_sorted_names():", + " if package_name in self.imported_packages:", + " continue", + " info_module = self.info_modules[package_name]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " if postpone and not global_symbols:", + " self.log('__all__.append(%r)' % (package_name))", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + " continue", + "", + " old_object = frame.f_locals.get(package_name,None)", + "", + " cmdstr = 'import '+package_name", + " if self._execcmd(cmdstr):", + " continue", + " self.imported_packages.append(package_name)", + "", + " if verbose!=-1:", + " new_object = frame.f_locals.get(package_name)", + " if old_object is not None and old_object is not new_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (package_name,self._obj2str(new_object),", + " self._obj2str(old_object)))", + "", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + "", + " for symbol in global_symbols:", + " if symbol=='*':", + " symbols = eval('getattr(%s,\"__all__\",None)'\\", + " % (package_name),", + " frame.f_globals,frame.f_locals)", + " if symbols is None:", + " symbols = eval('dir(%s)' % (package_name),", + " frame.f_globals,frame.f_locals)", + " symbols = filter(lambda s:not s.startswith('_'),symbols)", + " else:", + " symbols = [symbol]", + "", + " if verbose!=-1:", + " old_objects = {}", + " for s in symbols:", + " if frame.f_locals.has_key(s):", + " old_objects[s] = frame.f_locals[s]", + "", + " cmdstr = 'from '+package_name+' import '+symbol", + " if self._execcmd(cmdstr):", + " continue", + "", + " if verbose!=-1:", + " for s,old_object in old_objects.items():", + " new_object = frame.f_locals[s]", + " if new_object is not old_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (s,self._obj2repr(new_object),", + " self._obj2repr(old_object)))", + "", + " if symbol=='*':", + " self.parent_export_names.extend(symbols)", + " else:", + " self.parent_export_names.append(symbol)", + "", + " return", + "", + " def _execcmd(self,cmdstr):", + " \"\"\" Execute command in parent_frame.\"\"\"", + " frame = self.parent_frame", + " try:", + " exec (cmdstr, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " self.error('%s -> failed: %s' % (cmdstr,msg))", + " return True", + " else:", + " self.log('%s -> success' % (cmdstr))", + " return", + "", + " def _obj2repr(self,obj):", + " \"\"\" Return repr(obj) with\"\"\"", + " module = getattr(obj,'__module__',None)", + " file = getattr(obj,'__file__',None)", + " if module is not None:", + " return repr(obj) + ' from ' + module", + " if file is not None:", + " return repr(obj) + ' from ' + file", + " return repr(obj)", + "", + " def log(self,mess):", + " if self.verbose>1:", + " print >> sys.stderr, str(mess)", + " def warn(self,mess):", + " if self.verbose>=0:", + " print >> sys.stderr, str(mess)", + " def error(self,mess):", + " if self.verbose!=-1:", + " print >> sys.stderr, str(mess)", + "" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "5b83476f1ea82ce4655f5030e3081cb49e3315ce", + "msg": "Made matrix tests work.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T01:21:44+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T01:21:44+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "2f01cc8b3c368242224f7ff63e1e5343cf890e9c" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 9, + "insertions": 11, + "lines": 20, + "files": 2, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/core/defmatrix.py", + "new_path": "numpy/core/defmatrix.py", + "filename": "defmatrix.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -199,7 +199,7 @@ def getH(self):\n return self.transpose()\n \n def getI(self):\n- from numpy.corelinalg import inv\n+ from numpy.linalg import inv\n return matrix(inv(self))\n \n A = property(getA, None, doc=\"base array\")\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\n__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']\n\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power, \\\n isscalar, binary_repr\nimport types\nimport string as str_\nimport sys\n\n# make translation table\n_table = [None]*256\nfor k in range(256):\n _table[k] = chr(k)\n_table = ''.join(_table)\n\n_numchars = str_.digits + \".-+jeEL\"\ndel str_\n_todelete = []\nfor k in _table:\n if k not in _numchars:\n _todelete.append(k)\n_todelete = ''.join(_todelete)\ndel k\n\ndef _eval(astr):\n return eval(astr.translate(_table,_todelete))\n\ndef _convert_from_string(data):\n rows = data.split(';')\n newdata = []\n count = 0\n for row in rows:\n trow = row.split(',')\n newrow = []\n for col in trow:\n temp = col.split()\n newrow.extend(map(_eval,temp))\n if count == 0:\n Ncols = len(newrow)\n elif len(newrow) != Ncols:\n raise ValueError, \"Rows not the same size.\"\n count += 1\n newdata.append(newrow)\n return newdata\n\ndef asmatrix(data, dtype=None): \n \"\"\" Returns 'data' as a matrix. Unlike matrix(), no copy is performed \n if 'data' is already a matrix or array. Equivalent to: \n matrix(data, copy=False) \n \"\"\" \n return matrix(data, dtype=dtype, copy=False) \n\nclass matrix(N.ndarray):\n __array_priority__ = 10.0\n def __new__(subtype, data, dtype=None, copy=True):\n if isinstance(data, matrix):\n dtype2 = data.dtype\n if (dtype is None):\n dtype = dtype2\n if (dtype2 is dtype) and (not copy):\n return data\n return data.astype(dtype)\n\n if dtype is None:\n if isinstance(data, N.ndarray):\n dtype = data.dtype\n intype = N.obj2dtype(dtype)\n\n if isinstance(data, types.StringType):\n data = _convert_from_string(data)\n\n # now convert data to an array\n arr = N.array(data, dtype=intype, copy=copy)\n ndim = arr.ndim\n shape = arr.shape\n if (ndim > 2):\n raise ValueError, \"matrix must be 2-dimensional\"\n elif ndim == 0:\n shape = (1,1)\n elif ndim == 1:\n shape = (1,shape[0])\n\n fortran = False\n if (ndim == 2) and arr.flags.fortran:\n fortran = True\n \n if not (fortran or arr.flags.contiguous):\n arr = arr.copy()\n\n ret = N.ndarray.__new__(subtype, shape, arr.dtypedescr,\n buffer=arr,\n fortran=fortran)\n return ret\n\n def __array_finalize__(self, obj):\n ndim = self.ndim\n if ndim == 0:\n self.shape = (1,1)\n elif ndim == 1:\n self.shape = (1,self.shape[0])\n return\n\n def __getitem__(self, index):\n out = N.ndarray.__getitem__(self, index)\n # Need to swap if slice is on first index\n retscal = False\n try:\n n = len(index)\n if (n==2):\n if isinstance(index[0], types.SliceType):\n if (isscalar(index[1])):\n sh = out.shape\n out.shape = (sh[1], sh[0])\n else:\n if (isscalar(index[0])) and (isscalar(index[1])):\n retscal = True\n except TypeError:\n pass\n if retscal and out.shape == (1,1): # convert scalars\n return out.A[0,0]\n return out\n\n def __mul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(self, other)\n else:\n return N.dot(self, other)\n\n def __rmul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(other, self)\n else:\n return N.dot(other, self)\n\n def __imul__(self, other):\n self[:] = self * other\n return self\n\n def __pow__(self, other):\n shape = self.shape\n if len(shape) != 2 or shape[0] != shape[1]:\n raise TypeError, \"matrix is not square\"\n if type(other) in (type(1), type(1L)):\n if other==0:\n return matrix(N.identity(shape[0]))\n if other<0:\n x = self.I\n other=-other\n else:\n x=self\n result = x\n if other <= 3:\n while(other>1):\n result=result*x\n other=other-1\n return result\n # binary decomposition to reduce the number of Matrix\n # Multiplies for other > 3.\n beta = binary_repr(other)\n t = len(beta)\n Z,q = x.copy(),0\n while beta[t-q-1] == '0':\n Z *= Z\n q += 1\n result = Z.copy()\n for k in range(q+1,t):\n Z *= Z\n if beta[t-k-1] == '1':\n result *= Z\n return result\n else:\n raise TypeError, \"exponent must be an integer\"\n\n def __rpow__(self, other):\n raise NotImplementedError\n\n def __repr__(self):\n return repr(self.__array__()).replace('array','matrix')\n\n def __str__(self):\n return str(self.__array__())\n\n # Needed becase tolist method expects a[i] \n # to have dimension a.ndim-1\n def tolist(self):\n return self.__array__().tolist()\n\n def getA(self):\n return self.__array__()\n\n def getT(self):\n return self.transpose()\n\n def getH(self):\n if issubclass(self.dtype, N.complexfloating):\n return self.transpose().conjugate()\n else:\n return self.transpose()\n\n def getI(self):\n from numpy.linalg import inv\n return matrix(inv(self))\n\n A = property(getA, None, doc=\"base array\")\n T = property(getT, None, doc=\"transpose\")\n H = property(getH, None, doc=\"hermitian (conjugate) transpose\")\n I = property(getI, None, doc=\"inverse\")\n\n\ndef _from_string(str,gdict,ldict):\n rows = str.split(';')\n rowtup = []\n for row in rows:\n trow = row.split(',')\n newrow = []\n for x in trow:\n newrow.extend(x.split())\n trow = newrow\n coltup = []\n for col in trow:\n col = col.strip()\n try:\n thismat = ldict[col]\n except KeyError:\n try:\n thismat = gdict[col]\n except KeyError:\n raise KeyError, \"%s not found\" % (col,)\n\n coltup.append(thismat)\n rowtup.append(concatenate(coltup,axis=-1))\n return concatenate(rowtup,axis=0)\n\n\ndef bmat(obj,ldict=None, gdict=None):\n \"\"\"Build a matrix object from string, nested sequence, or array.\n\n Ex: F = bmat('A, B; C, D') \n F = bmat([[A,B],[C,D]])\n F = bmat(r_[c_[A,B],c_[C,D]])\n\n all produce the same Matrix Object [ A B ]\n [ C D ]\n\n if A, B, C, and D are appropriately shaped 2-d arrays.\n \"\"\"\n if isinstance(obj, types.StringType):\n if gdict is None:\n # get previous frame\n frame = sys._getframe().f_back\n glob_dict = frame.f_globals\n loc_dict = frame.f_locals\n else:\n glob_dict = gdict\n loc_dict = ldict\n\n return matrix(_from_string(obj, glob_dict, loc_dict))\n\n if isinstance(obj, (types.TupleType, types.ListType)):\n # [[A,B],[C,D]]\n arr_rows = []\n for row in obj:\n if isinstance(row, ArrayType): # not 2-d\n return matrix(concatenate(obj,axis=-1))\n else:\n arr_rows.append(concatenate(row,axis=-1))\n return matrix(concatenate(arr_rows,axis=0))\n if isinstance(obj, ArrayType):\n return matrix(obj)\n\nmat = matrix\n", + "source_code_before": "\n__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']\n\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power, \\\n isscalar, binary_repr\nimport types\nimport string as str_\nimport sys\n\n# make translation table\n_table = [None]*256\nfor k in range(256):\n _table[k] = chr(k)\n_table = ''.join(_table)\n\n_numchars = str_.digits + \".-+jeEL\"\ndel str_\n_todelete = []\nfor k in _table:\n if k not in _numchars:\n _todelete.append(k)\n_todelete = ''.join(_todelete)\ndel k\n\ndef _eval(astr):\n return eval(astr.translate(_table,_todelete))\n\ndef _convert_from_string(data):\n rows = data.split(';')\n newdata = []\n count = 0\n for row in rows:\n trow = row.split(',')\n newrow = []\n for col in trow:\n temp = col.split()\n newrow.extend(map(_eval,temp))\n if count == 0:\n Ncols = len(newrow)\n elif len(newrow) != Ncols:\n raise ValueError, \"Rows not the same size.\"\n count += 1\n newdata.append(newrow)\n return newdata\n\ndef asmatrix(data, dtype=None): \n \"\"\" Returns 'data' as a matrix. Unlike matrix(), no copy is performed \n if 'data' is already a matrix or array. Equivalent to: \n matrix(data, copy=False) \n \"\"\" \n return matrix(data, dtype=dtype, copy=False) \n\nclass matrix(N.ndarray):\n __array_priority__ = 10.0\n def __new__(subtype, data, dtype=None, copy=True):\n if isinstance(data, matrix):\n dtype2 = data.dtype\n if (dtype is None):\n dtype = dtype2\n if (dtype2 is dtype) and (not copy):\n return data\n return data.astype(dtype)\n\n if dtype is None:\n if isinstance(data, N.ndarray):\n dtype = data.dtype\n intype = N.obj2dtype(dtype)\n\n if isinstance(data, types.StringType):\n data = _convert_from_string(data)\n\n # now convert data to an array\n arr = N.array(data, dtype=intype, copy=copy)\n ndim = arr.ndim\n shape = arr.shape\n if (ndim > 2):\n raise ValueError, \"matrix must be 2-dimensional\"\n elif ndim == 0:\n shape = (1,1)\n elif ndim == 1:\n shape = (1,shape[0])\n\n fortran = False\n if (ndim == 2) and arr.flags.fortran:\n fortran = True\n \n if not (fortran or arr.flags.contiguous):\n arr = arr.copy()\n\n ret = N.ndarray.__new__(subtype, shape, arr.dtypedescr,\n buffer=arr,\n fortran=fortran)\n return ret\n\n def __array_finalize__(self, obj):\n ndim = self.ndim\n if ndim == 0:\n self.shape = (1,1)\n elif ndim == 1:\n self.shape = (1,self.shape[0])\n return\n\n def __getitem__(self, index):\n out = N.ndarray.__getitem__(self, index)\n # Need to swap if slice is on first index\n retscal = False\n try:\n n = len(index)\n if (n==2):\n if isinstance(index[0], types.SliceType):\n if (isscalar(index[1])):\n sh = out.shape\n out.shape = (sh[1], sh[0])\n else:\n if (isscalar(index[0])) and (isscalar(index[1])):\n retscal = True\n except TypeError:\n pass\n if retscal and out.shape == (1,1): # convert scalars\n return out.A[0,0]\n return out\n\n def __mul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(self, other)\n else:\n return N.dot(self, other)\n\n def __rmul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(other, self)\n else:\n return N.dot(other, self)\n\n def __imul__(self, other):\n self[:] = self * other\n return self\n\n def __pow__(self, other):\n shape = self.shape\n if len(shape) != 2 or shape[0] != shape[1]:\n raise TypeError, \"matrix is not square\"\n if type(other) in (type(1), type(1L)):\n if other==0:\n return matrix(N.identity(shape[0]))\n if other<0:\n x = self.I\n other=-other\n else:\n x=self\n result = x\n if other <= 3:\n while(other>1):\n result=result*x\n other=other-1\n return result\n # binary decomposition to reduce the number of Matrix\n # Multiplies for other > 3.\n beta = binary_repr(other)\n t = len(beta)\n Z,q = x.copy(),0\n while beta[t-q-1] == '0':\n Z *= Z\n q += 1\n result = Z.copy()\n for k in range(q+1,t):\n Z *= Z\n if beta[t-k-1] == '1':\n result *= Z\n return result\n else:\n raise TypeError, \"exponent must be an integer\"\n\n def __rpow__(self, other):\n raise NotImplementedError\n\n def __repr__(self):\n return repr(self.__array__()).replace('array','matrix')\n\n def __str__(self):\n return str(self.__array__())\n\n # Needed becase tolist method expects a[i] \n # to have dimension a.ndim-1\n def tolist(self):\n return self.__array__().tolist()\n\n def getA(self):\n return self.__array__()\n\n def getT(self):\n return self.transpose()\n\n def getH(self):\n if issubclass(self.dtype, N.complexfloating):\n return self.transpose().conjugate()\n else:\n return self.transpose()\n\n def getI(self):\n from numpy.corelinalg import inv\n return matrix(inv(self))\n\n A = property(getA, None, doc=\"base array\")\n T = property(getT, None, doc=\"transpose\")\n H = property(getH, None, doc=\"hermitian (conjugate) transpose\")\n I = property(getI, None, doc=\"inverse\")\n\n\ndef _from_string(str,gdict,ldict):\n rows = str.split(';')\n rowtup = []\n for row in rows:\n trow = row.split(',')\n newrow = []\n for x in trow:\n newrow.extend(x.split())\n trow = newrow\n coltup = []\n for col in trow:\n col = col.strip()\n try:\n thismat = ldict[col]\n except KeyError:\n try:\n thismat = gdict[col]\n except KeyError:\n raise KeyError, \"%s not found\" % (col,)\n\n coltup.append(thismat)\n rowtup.append(concatenate(coltup,axis=-1))\n return concatenate(rowtup,axis=0)\n\n\ndef bmat(obj,ldict=None, gdict=None):\n \"\"\"Build a matrix object from string, nested sequence, or array.\n\n Ex: F = bmat('A, B; C, D') \n F = bmat([[A,B],[C,D]])\n F = bmat(r_[c_[A,B],c_[C,D]])\n\n all produce the same Matrix Object [ A B ]\n [ C D ]\n\n if A, B, C, and D are appropriately shaped 2-d arrays.\n \"\"\"\n if isinstance(obj, types.StringType):\n if gdict is None:\n # get previous frame\n frame = sys._getframe().f_back\n glob_dict = frame.f_globals\n loc_dict = frame.f_locals\n else:\n glob_dict = gdict\n loc_dict = ldict\n\n return matrix(_from_string(obj, glob_dict, loc_dict))\n\n if isinstance(obj, (types.TupleType, types.ListType)):\n # [[A,B],[C,D]]\n arr_rows = []\n for row in obj:\n if isinstance(row, ArrayType): # not 2-d\n return matrix(concatenate(obj,axis=-1))\n else:\n arr_rows.append(concatenate(row,axis=-1))\n return matrix(concatenate(arr_rows,axis=0))\n if isinstance(obj, ArrayType):\n return matrix(obj)\n\nmat = matrix\n", + "methods": [ + { + "name": "_eval", + "long_name": "_eval( astr )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "astr" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_string", + "long_name": "_convert_from_string( data )", + "filename": "defmatrix.py", + "nloc": 17, + "complexity": 5, + "token_count": 94, + "parameters": [ + "data" + ], + "start_line": 29, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "asmatrix", + "long_name": "asmatrix( data , dtype = None )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "data", + "dtype" + ], + "start_line": 47, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__new__", + "long_name": "__new__( subtype , data , dtype = None , copy = True )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 15, + "token_count": 231, + "parameters": [ + "subtype", + "data", + "dtype", + "copy" + ], + "start_line": 56, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "__array_finalize__", + "long_name": "__array_finalize__( self , obj )", + "filename": "defmatrix.py", + "nloc": 7, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self", + "obj" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , index )", + "filename": "defmatrix.py", + "nloc": 18, + "complexity": 9, + "token_count": 135, + "parameters": [ + "self", + "index" + ], + "start_line": 104, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 124, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 130, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "other" + ], + "start_line": 136, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 11, + "token_count": 205, + "parameters": [ + "self", + "other" + ], + "start_line": 140, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "__rpow__", + "long_name": "__rpow__( self , other )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "other" + ], + "start_line": 175, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 181, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 186, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getA", + "long_name": "getA( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getT", + "long_name": "getT( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 193, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getH", + "long_name": "getH( self )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_from_string", + "long_name": "_from_string( str , gdict , ldict )", + "filename": "defmatrix.py", + "nloc": 22, + "complexity": 6, + "token_count": 132, + "parameters": [ + "str", + "gdict", + "ldict" + ], + "start_line": 211, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "bmat", + "long_name": "bmat( obj , ldict = None , gdict = None )", + "filename": "defmatrix.py", + "nloc": 20, + "complexity": 7, + "token_count": 155, + "parameters": [ + "obj", + "ldict", + "gdict" + ], + "start_line": 236, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_eval", + "long_name": "_eval( astr )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "astr" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_string", + "long_name": "_convert_from_string( data )", + "filename": "defmatrix.py", + "nloc": 17, + "complexity": 5, + "token_count": 94, + "parameters": [ + "data" + ], + "start_line": 29, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "asmatrix", + "long_name": "asmatrix( data , dtype = None )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "data", + "dtype" + ], + "start_line": 47, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__new__", + "long_name": "__new__( subtype , data , dtype = None , copy = True )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 15, + "token_count": 231, + "parameters": [ + "subtype", + "data", + "dtype", + "copy" + ], + "start_line": 56, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "__array_finalize__", + "long_name": "__array_finalize__( self , obj )", + "filename": "defmatrix.py", + "nloc": 7, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self", + "obj" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , index )", + "filename": "defmatrix.py", + "nloc": 18, + "complexity": 9, + "token_count": 135, + "parameters": [ + "self", + "index" + ], + "start_line": 104, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 124, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 130, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "other" + ], + "start_line": 136, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 11, + "token_count": 205, + "parameters": [ + "self", + "other" + ], + "start_line": 140, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "__rpow__", + "long_name": "__rpow__( self , other )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "other" + ], + "start_line": 175, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 181, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 186, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getA", + "long_name": "getA( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getT", + "long_name": "getT( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 193, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getH", + "long_name": "getH( self )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_from_string", + "long_name": "_from_string( str , gdict , ldict )", + "filename": "defmatrix.py", + "nloc": 22, + "complexity": 6, + "token_count": 132, + "parameters": [ + "str", + "gdict", + "ldict" + ], + "start_line": 211, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "bmat", + "long_name": "bmat( obj , ldict = None , gdict = None )", + "filename": "defmatrix.py", + "nloc": 20, + "complexity": 7, + "token_count": 155, + "parameters": [ + "obj", + "ldict", + "gdict" + ], + "start_line": 236, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "nloc": 211, + "complexity": 74, + "token_count": 1472, + "diff_parsed": { + "added": [ + " from numpy.linalg import inv" + ], + "deleted": [ + " from numpy.corelinalg import inv" + ] + } + }, + { + "old_path": "numpy/core/tests/test_matrix.py", + "new_path": "numpy/core/tests/test_defmatrix.py", + "filename": "test_defmatrix.py", + "extension": "py", + "change_type": "RENAME", + "diff": "@@ -6,7 +6,7 @@\n restore_path()\n \n class test_ctor(ScipyTestCase):\n- def test_basic(self):\n+ def check_basic(self):\n A = array([[1,2],[3,4]])\n mA = matrix(A)\n assert all(mA.A == A)\n@@ -25,8 +25,8 @@ def test_basic(self):\n assert mvec.shape == (1,5)\n \n class test_properties(ScipyTestCase):\n- def test_basic(self):\n- import numpy.corelinalg as linalg\n+ def check_basic(self):\n+ import numpy.linalg as linalg\n \n A = array([[1., 2.], \n [3., 4.]])\n@@ -42,7 +42,7 @@ def test_basic(self):\n assert all(array(transpose(B) == mB.T))\n assert all(array(conjugate(transpose(B)) == mB.H))\n \n- def test_comparisons(self):\n+ def check_comparisons(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n mB = matrix(A) + 0.1\n@@ -66,7 +66,7 @@ def test_comparisons(self):\n assert not all(abs(mA) > 0)\n assert all(abs(mB > 0))\n \n- def test_asmatrix(self):\n+ def check_asmatrix(self):\n A = arange(100).reshape(10,10)\n mA = asmatrix(A)\n mB = matrix(A)\n@@ -75,7 +75,7 @@ def test_asmatrix(self):\n assert A[0,0] != mB[0,0]\n \n class test_autocasting(ScipyTestCase):\n- def test_basic(self):\n+ def check_basic(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n \n@@ -93,8 +93,8 @@ def test_basic(self):\n assert all(mA != mB)\n \n class test_algebra(ScipyTestCase):\n- def test_basic(self):\n- import numpy.corelinalg as linalg\n+ def check_basic(self):\n+ import numpy.linalg as linalg\n \n A = array([[1., 2.],\n [3., 4.]])\n@@ -115,3 +115,5 @@ def test_basic(self):\n assert allclose((mA + mA).A, (A + A)) \n assert allclose((3*mA).A, (3*A))\n \n+if __name__ == \"__main__\":\n+ ScipyTest().run()\n", + "added_lines": 10, + "deleted_lines": 8, + "source_code": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.core;reload(numpy.core)\nfrom numpy.core import *\nrestore_path()\n\nclass test_ctor(ScipyTestCase):\n def check_basic(self):\n A = array([[1,2],[3,4]])\n mA = matrix(A)\n assert all(mA.A == A)\n\n B = bmat(\"A,A;A,A\")\n C = bmat([[A,A], [A,A]])\n D = array([[1,2,1,2],\n [3,4,3,4],\n [1,2,1,2],\n [3,4,3,4]])\n assert all(B.A == D)\n assert all(C.A == D)\n \n vec = arange(5)\n mvec = matrix(vec)\n assert mvec.shape == (1,5)\n \nclass test_properties(ScipyTestCase):\n def check_basic(self):\n import numpy.linalg as linalg\n \n A = array([[1., 2.], \n [3., 4.]])\n mA = matrix(A)\n assert allclose(linalg.inv(A), mA.I)\n assert all(array(transpose(A) == mA.T))\n assert all(array(transpose(A) == mA.H))\n assert all(A == mA.A)\n \n B = A + 2j*A\n mB = matrix(B)\n assert allclose(linalg.inv(B), mB.I)\n assert all(array(transpose(B) == mB.T))\n assert all(array(conjugate(transpose(B)) == mB.H))\n\n def check_comparisons(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n mB = matrix(A) + 0.1\n assert all(mB == A+0.1)\n assert all(mB == matrix(A+0.1))\n assert not any(mB == matrix(A-0.1))\n assert all(mA < mB)\n assert all(mA <= mB)\n assert all(mA <= mA)\n assert not any(mA < mA)\n \n assert not any(mB < mA)\n assert all(mB >= mA)\n assert all(mB >= mB)\n assert not any(mB > mB)\n \n assert all(mA == mA)\n assert not any(mA == mB)\n assert all(mB != mA)\n \n assert not all(abs(mA) > 0)\n assert all(abs(mB > 0))\n \n def check_asmatrix(self):\n A = arange(100).reshape(10,10)\n mA = asmatrix(A)\n mB = matrix(A)\n A[0,0] = -10\n assert A[0,0] == mA[0,0]\n assert A[0,0] != mB[0,0]\n\nclass test_autocasting(ScipyTestCase):\n def check_basic(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n \n mB = mA.copy()\n O = ones((10,10), float64) * 0.1\n mB = mB + O\n assert mB.dtype == float64\n assert all(mA != mB)\n assert all(mB == mA+0.1)\n \n mC = mA.copy()\n O = ones((10,10), complex128)\n mC = mC * O\n assert mC.dtype == complex128\n assert all(mA != mB)\n\nclass test_algebra(ScipyTestCase):\n def check_basic(self):\n import numpy.linalg as linalg\n \n A = array([[1., 2.],\n [3., 4.]])\n mA = matrix(A)\n\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** i).A, B)\n B = dot(B, A)\n \n Ainv = linalg.inv(A)\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** -i).A, B)\n B = dot(B, Ainv)\n\n assert allclose((mA * mA).A, dot(A, A))\n assert allclose((mA + mA).A, (A + A)) \n assert allclose((3*mA).A, (3*A))\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.core;reload(numpy.core)\nfrom numpy.core import *\nrestore_path()\n\nclass test_ctor(ScipyTestCase):\n def test_basic(self):\n A = array([[1,2],[3,4]])\n mA = matrix(A)\n assert all(mA.A == A)\n\n B = bmat(\"A,A;A,A\")\n C = bmat([[A,A], [A,A]])\n D = array([[1,2,1,2],\n [3,4,3,4],\n [1,2,1,2],\n [3,4,3,4]])\n assert all(B.A == D)\n assert all(C.A == D)\n \n vec = arange(5)\n mvec = matrix(vec)\n assert mvec.shape == (1,5)\n \nclass test_properties(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.], \n [3., 4.]])\n mA = matrix(A)\n assert allclose(linalg.inv(A), mA.I)\n assert all(array(transpose(A) == mA.T))\n assert all(array(transpose(A) == mA.H))\n assert all(A == mA.A)\n \n B = A + 2j*A\n mB = matrix(B)\n assert allclose(linalg.inv(B), mB.I)\n assert all(array(transpose(B) == mB.T))\n assert all(array(conjugate(transpose(B)) == mB.H))\n\n def test_comparisons(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n mB = matrix(A) + 0.1\n assert all(mB == A+0.1)\n assert all(mB == matrix(A+0.1))\n assert not any(mB == matrix(A-0.1))\n assert all(mA < mB)\n assert all(mA <= mB)\n assert all(mA <= mA)\n assert not any(mA < mA)\n \n assert not any(mB < mA)\n assert all(mB >= mA)\n assert all(mB >= mB)\n assert not any(mB > mB)\n \n assert all(mA == mA)\n assert not any(mA == mB)\n assert all(mB != mA)\n \n assert not all(abs(mA) > 0)\n assert all(abs(mB > 0))\n \n def test_asmatrix(self):\n A = arange(100).reshape(10,10)\n mA = asmatrix(A)\n mB = matrix(A)\n A[0,0] = -10\n assert A[0,0] == mA[0,0]\n assert A[0,0] != mB[0,0]\n\nclass test_autocasting(ScipyTestCase):\n def test_basic(self):\n A = arange(100).reshape(10,10)\n mA = matrix(A)\n \n mB = mA.copy()\n O = ones((10,10), float64) * 0.1\n mB = mB + O\n assert mB.dtype == float64\n assert all(mA != mB)\n assert all(mB == mA+0.1)\n \n mC = mA.copy()\n O = ones((10,10), complex128)\n mC = mC * O\n assert mC.dtype == complex128\n assert all(mA != mB)\n\nclass test_algebra(ScipyTestCase):\n def test_basic(self):\n import numpy.corelinalg as linalg\n \n A = array([[1., 2.],\n [3., 4.]])\n mA = matrix(A)\n\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** i).A, B)\n B = dot(B, A)\n \n Ainv = linalg.inv(A)\n B = identity(2)\n for i in xrange(6):\n assert allclose((mA ** -i).A, B)\n B = dot(B, Ainv)\n\n assert allclose((mA * mA).A, dot(A, A))\n assert allclose((mA + mA).A, (A + A)) \n assert allclose((3*mA).A, (3*A))\n\n", + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_comparisons", + "long_name": "check_comparisons( self )", + "filename": "test_defmatrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "check_asmatrix", + "long_name": "check_asmatrix( self )", + "filename": "test_defmatrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 78, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 17, + "complexity": 3, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_comparisons", + "long_name": "test_comparisons( self )", + "filename": "test_defmatrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test_asmatrix", + "long_name": "test_asmatrix( self )", + "filename": "test_defmatrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 14, + "complexity": 1, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 78, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 17, + "complexity": 3, + "token_count": 170, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "check_comparisons", + "long_name": "check_comparisons( self )", + "filename": "test_defmatrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test_basic", + "long_name": "test_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "test_comparisons", + "long_name": "test_comparisons( self )", + "filename": "test_defmatrix.py", + "nloc": 20, + "complexity": 1, + "token_count": 176, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_defmatrix.py", + "nloc": 15, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_asmatrix", + "long_name": "check_asmatrix( self )", + "filename": "test_defmatrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_asmatrix", + "long_name": "test_asmatrix( self )", + "filename": "test_defmatrix.py", + "nloc": 7, + "complexity": 1, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 69, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + } + ], + "nloc": 98, + "complexity": 8, + "token_count": 897, + "diff_parsed": { + "added": [ + " def check_basic(self):", + " def check_basic(self):", + " import numpy.linalg as linalg", + " def check_comparisons(self):", + " def check_asmatrix(self):", + " def check_basic(self):", + " def check_basic(self):", + " import numpy.linalg as linalg", + "if __name__ == \"__main__\":", + " ScipyTest().run()" + ], + "deleted": [ + " def test_basic(self):", + " def test_basic(self):", + " import numpy.corelinalg as linalg", + " def test_comparisons(self):", + " def test_asmatrix(self):", + " def test_basic(self):", + " def test_basic(self):", + " import numpy.corelinalg as linalg" + ] + } + } + ] + }, + { + "hash": "959e0ba32d1fb84295601736a66e22d70f149014", + "msg": "Fixed corelinalg in mtrand.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T01:23:47+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T01:23:47+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "5b83476f1ea82ce4655f5030e3081cb49e3315ce" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1, + "insertions": 1, + "lines": 2, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/random/mtrand/mtrand.pyx", + "new_path": "numpy/random/mtrand/mtrand.pyx", + "filename": "mtrand.pyx", + "extension": "pyx", + "change_type": "MODIFY", + "diff": "@@ -833,7 +833,7 @@ def multivariate_normal(self, mean, cov, size=None):\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n \n- from numpy.corelinalg import svd\n+ from numpy.linalg import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "# mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit\n#\n# Copyright 2005 Robert Kern (robert.kern@gmail.com)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\ninclude \"Python.pxi\"\ninclude \"numpy.pxi\"\n\ncdef extern from \"math.h\":\n double exp(double x)\n double log(double x)\n double floor(double x)\n double sin(double x)\n double cos(double x)\n\ncdef extern from \"randomkit.h\":\n\n ctypedef struct rk_state:\n unsigned long key[624]\n int pos\n\n ctypedef enum rk_error:\n RK_NOERR = 0\n RK_ENODEV = 1\n RK_ERR_MAX = 2\n\n char *rk_strerror[2]\n \n # 0xFFFFFFFFUL\n unsigned long RK_MAX\n\n void rk_seed(unsigned long seed, rk_state *state)\n rk_error rk_randomseed(rk_state *state)\n unsigned long rk_random(rk_state *state)\n long rk_long(rk_state *state)\n unsigned long rk_ulong(rk_state *state)\n unsigned long rk_interval(unsigned long max, rk_state *state)\n double rk_double(rk_state *state)\n void rk_fill(void *buffer, size_t size, rk_state *state)\n rk_error rk_devfill(void *buffer, size_t size, int strong)\n rk_error rk_altfill(void *buffer, size_t size, int strong,\n rk_state *state)\n double rk_gauss(rk_state *state)\n\ncdef extern from \"distributions.h\":\n \n double rk_normal(rk_state *state, double loc, double scale)\n double rk_standard_exponential(rk_state *state)\n double rk_exponential(rk_state *state, double scale)\n double rk_uniform(rk_state *state, double loc, double scale)\n double rk_standard_gamma(rk_state *state, double shape)\n double rk_gamma(rk_state *state, double shape, double scale)\n double rk_beta(rk_state *state, double a, double b)\n double rk_chisquare(rk_state *state, double df)\n double rk_noncentral_chisquare(rk_state *state, double df, double nonc)\n double rk_f(rk_state *state, double dfnum, double dfden)\n double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)\n double rk_standard_cauchy(rk_state *state)\n double rk_standard_t(rk_state *state, double df)\n double rk_vonmises(rk_state *state, double mu, double kappa)\n double rk_pareto(rk_state *state, double a)\n double rk_weibull(rk_state *state, double a)\n double rk_power(rk_state *state, double a)\n double rk_laplace(rk_state *state, double loc, double scale)\n double rk_gumbel(rk_state *state, double loc, double scale)\n double rk_logistic(rk_state *state, double loc, double scale)\n double rk_lognormal(rk_state *state, double mode, double sigma)\n double rk_rayleigh(rk_state *state, double mode)\n double rk_wald(rk_state *state, double mean, double scale)\n double rk_triangular(rk_state *state, double left, double mode, double right)\n \n long rk_binomial(rk_state *state, long n, double p)\n long rk_binomial_btpe(rk_state *state, long n, double p)\n long rk_binomial_inversion(rk_state *state, long n, double p)\n long rk_negative_binomial(rk_state *state, long n, double p)\n long rk_poisson(rk_state *state, double lam)\n long rk_poisson_mult(rk_state *state, double lam)\n long rk_poisson_ptrs(rk_state *state, double lam)\n long rk_zipf(rk_state *state, double a)\n long rk_geometric(rk_state *state, double p)\n long rk_hypergeometric(rk_state *state, long good, long bad, long sample)\n long rk_logseries(rk_state *state, double p)\n\nctypedef double (* rk_cont0)(rk_state *state)\nctypedef double (* rk_cont1)(rk_state *state, double a)\nctypedef double (* rk_cont2)(rk_state *state, double a, double b)\nctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)\n\nctypedef long (* rk_disc0)(rk_state *state)\nctypedef long (* rk_discnp)(rk_state *state, long n, double p)\nctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N)\nctypedef long (* rk_discd)(rk_state *state, double a)\n\n\ncdef extern from \"initarray.h\":\n void init_by_array(rk_state *self, unsigned long *init_key, \n unsigned long key_length)\n\n# Initialize numpy\nimport_array()\n\nimport numpy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a, \n double b):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a, b)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b)\n return array\n\ncdef object cont3_array(rk_state *state, rk_cont3 func, object size, double a, \n double b, double c):\n\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n \n if size is None:\n return func(state, a, b, c)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b, c)\n return array\n\ncdef object disc0_array(rk_state *state, rk_disc0 func, object size):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, double p):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, p)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, p)\n return array\n\ncdef object discnmN_array(rk_state *state, rk_discnmN func, object size, \n long n, long m, long N):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, m, N)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, m, N)\n return array\n\ncdef object discd_array(rk_state *state, rk_discd func, object size, double a):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef double kahan_sum(double *darr, long n):\n cdef double c, y, t, sum\n cdef long i\n sum = darr[0]\n c = 0.0\n for i from 1 <= i < n:\n y = darr[i] - c\n t = sum + y\n c = (t-sum) - y\n sum = t\n return sum\n\ncdef class RandomState:\n \"\"\"Container for the Mersenne Twister PRNG.\n\n Constructor\n -----------\n RandomState(seed=None): initializes the PRNG with the given seed. See the\n seed() method for details.\n\n Distribution Methods\n -----------------\n RandomState exposes a number of methods for generating random numbers drawn\n from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n size=None. If size is None, then a single value is generated and returned.\n If size is an integer, then a 1-D numpy array filled with generated values\n is returned. If size is a tuple, then a numpy array with that shape is\n filled and returned.\n \"\"\"\n cdef rk_state *internal_state\n\n def __init__(self, seed=None):\n self.internal_state = PyMem_Malloc(sizeof(rk_state))\n\n self.seed(seed)\n\n def __dealloc__(self):\n if self.internal_state != NULL:\n PyMem_Free(self.internal_state)\n\n def seed(self, seed=None):\n \"\"\"Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n \"\"\"\n cdef rk_error errcode\n cdef ndarray obj \"arrayObject_obj\"\n if seed is None:\n errcode = rk_randomseed(self.internal_state)\n elif type(seed) is int:\n rk_seed(seed, self.internal_state)\n else:\n obj = PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n init_by_array(self.internal_state, (obj.data),\n obj.dimensions[0])\n\n def get_state(self):\n \"\"\"Return a tuple representing the internal state of the generator.\n\n get_state() -> ('MT19937', int key[624], int pos)\n \"\"\"\n cdef ndarray state \"arrayObject_state\"\n state = _sp.empty(624, _sp.Int)\n memcpy((state.data), self.internal_state.key, 624*sizeof(long))\n return ('MT19937', state, self.internal_state.pos)\n \n def set_state(self, state):\n \"\"\"Set the state from a tuple.\n \n state = ('MT19937', int key[624], int pos)\n \n set_state(state)\n \"\"\"\n cdef ndarray obj \"arrayObject_obj\"\n cdef int pos\n algorithm_name = state[0]\n if algorithm_name != 'MT19937':\n raise ValueError(\"algorithm must be 'MT19937'\")\n key, pos = state[1:]\n obj = PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)\n if obj.dimensions[0] != 624:\n raise ValueError(\"state must be 624 longs\")\n memcpy(self.internal_state.key, (obj.data), 624*sizeof(long))\n self.internal_state.pos = pos\n \n # Pickling support:\n def __getstate__(self):\n return self.get_state()\n\n def __setstate__(self, state):\n self.set_state(state)\n\n def __reduce__(self):\n return (_sp.random.__RandomState_ctor, (), self.get_state())\n\n # Basic distributions:\n def random_sample(self, size=None):\n \"\"\"Return random floats in the half-open interval [0.0, 1.0).\n\n random_sample(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_double, size)\n\n def tomaxint(self, size=None):\n \"\"\"Returns random integers x such that 0 <= x <= sys.maxint.\n\n tomaxint(size=None) -> random values\n \"\"\"\n return disc0_array(self.internal_state, rk_long, size)\n\n def randint(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x < high.\n\n randint(low, high=None, size=None) -> random values\n\n If high is None, then 0 <= x < low.\n \"\"\"\n cdef long lo, hi, diff\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if high is None:\n lo = 0\n hi = low\n else:\n lo = low\n hi = high\n\n diff = hi - lo - 1\n if diff < 0:\n raise ValueError(\"low >= high\")\n \n if size is None:\n return rk_interval(diff, self.internal_state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = lo + rk_interval(diff, self.internal_state)\n return array\n\n def bytes(self, unsigned int length):\n \"\"\"Return random bytes.\n\n bytes(length) -> str\n \"\"\"\n cdef void *bytes\n bytes = PyMem_Malloc(length)\n rk_fill(bytes, length, self.internal_state)\n bytestring = PyString_FromString(bytes)\n PyMem_Free(bytes)\n return bytestring\n\n def uniform(self, double low=0.0, double high=1.0, size=None):\n \"\"\"Uniform distribution over [low, high).\n\n uniform(low=0.0, high=1.0, size=None) -> random values\n \"\"\"\n return cont2_array(self.internal_state, rk_uniform, size, low, \n high-low)\n\n def rand(self, *args):\n \"\"\"Return an array of the given dimensions which is initialized to \n random numbers from a uniform distribution in the range [0,1).\n\n rand(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.random_sample()\n else:\n return self.random_sample(size=args)\n\n def randn(self, *args):\n \"\"\"Returns zero-mean, unit-variance Gaussian random numbers in an \n array of shape (d0, d1, ..., dn).\n\n randn(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.standard_normal()\n else:\n return self.standard_normal(args)\n\n def random_integers(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x <= high.\n\n random_integers(low, high=None, size=None) -> random values.\n\n If high is None, then 1 <= x <= low.\n \"\"\"\n if high is None:\n high = low\n low = 1\n return self.randint(low, high+1, size)\n\n # Complicated, continuous distributions:\n def standard_normal(self, size=None):\n \"\"\"Standard Normal distribution (mean=0, stdev=1).\n\n standard_normal(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_gauss, size)\n\n def normal(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Normal distribution (mean=loc, stdev=scale).\n\n normal(loc=0.0, scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_normal, size, loc, scale)\n\n def beta(self, double a, double b, size=None):\n \"\"\"Beta distribution over [0, 1].\n\n beta(a, b, size=None) -> random values\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n elif b <= 0:\n raise ValueError(\"b <= 0\")\n return cont2_array(self.internal_state, rk_beta, size, a, b)\n\n def exponential(self, double scale=1.0, size=None):\n \"\"\"Exponential distribution.\n\n exponential(scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont1_array(self.internal_state, rk_exponential, size, scale)\n\n def standard_exponential(self, size=None):\n \"\"\"Standard exponential distribution (scale=1).\n\n standard_exponential(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_exponential, size)\n\n def standard_gamma(self, double shape, size=None):\n \"\"\"Standard Gamma distribution.\n\n standard_gamma(shape, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n return cont1_array(self.internal_state, rk_standard_gamma, size, shape)\n\n def gamma(self, double shape, double scale=1.0, size=None):\n \"\"\"Gamma distribution.\n\n gamma(shape, scale=1.0, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n elif scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_gamma, size, shape, scale)\n\n def f(self, double dfnum, double dfden, size=None):\n \"\"\"F distribution.\n\n f(dfnum, dfden, size=None) -> random values\n \"\"\"\n if dfnum <= 0:\n raise ValueError(\"dfnum <= 0\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n return cont2_array(self.internal_state, rk_f, size, dfnum, dfden)\n\n def noncentral_f(self, double dfnum, double dfden, double nonc, size=None):\n \"\"\"Noncentral F distribution.\n\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\n \"\"\"\n if dfnum <= 1:\n raise ValueError(\"dfnum <= 1\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont3_array(self.internal_state, rk_noncentral_f, size, dfnum,\n dfden, nonc)\n\n def chisquare(self, double df, size=None):\n \"\"\"Chi^2 distribution.\n\n chisquare(df, size=None) -> random values\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_chisquare, size, df)\n\n def noncentral_chisquare(self, double df, double nonc, size=None):\n \"\"\"Noncentral Chi^2 distribution.\n\n noncentral_chisquare(df, nonc, size=None) -> random values\n \"\"\"\n if df <= 1:\n raise ValueError(\"df <= 1\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont2_array(self.internal_state, rk_noncentral_chisquare, size,\n df, nonc)\n \n def standard_cauchy(self, size=None):\n \"\"\"Standard Cauchy with mode=0.\n\n standard_cauchy(size=None)\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_cauchy, size)\n\n def standard_t(self, double df, size=None):\n \"\"\"Standard Student's t distribution with df degrees of freedom.\n\n standard_t(df, size=None)\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_standard_t, size, df)\n\n def vonmises(self, double mu, double kappa, size=None):\n \"\"\"von Mises circular distribution with mode mu and dispersion parameter\n kappa on [-pi, pi].\n\n vonmises(mu, kappa, size=None)\n \"\"\"\n if kappa < 0:\n raise ValueError(\"kappa < 0\")\n return cont2_array(self.internal_state, rk_vonmises, size, mu, kappa)\n\n def pareto(self, double a, size=None):\n \"\"\"Pareto distribution.\n\n pareto(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_pareto, size, a)\n\n def weibull(self, double a, size=None):\n \"\"\"Weibull distribution.\n\n weibull(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_weibull, size, a)\n\n def power(self, double a, size=None):\n \"\"\"Power distribution.\n\n power(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_power, size, a)\n\n def laplace(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Laplace distribution.\n \n laplace(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_laplace, size, loc, scale)\n \n def gumbel(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Gumbel distribution.\n \n gumbel(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_gumbel, size, loc, scale)\n \n def logistic(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Logistic distribution.\n \n logistic(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_logistic, size, loc, scale)\n\n def lognormal(self, double mean=0.0, double sigma=1.0, size=None):\n \"\"\"Log-normal distribution.\n \n Note that the mean parameter is not the mean of this distribution, but \n the underlying normal distribution.\n \n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\n \n lognormal(mean=0.0, sigma=1.0, size=None)\n \"\"\"\n if sigma <= 0.0:\n raise ValueError(\"sigma <= 0.0\")\n return cont2_array(self.internal_state, rk_lognormal, size, mean, sigma)\n \n def rayleigh(self, double scale=1.0, size=None):\n \"\"\"Rayleigh distribution.\n \n rayleigh(scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont1_array(self.internal_state, rk_rayleigh, size, scale)\n \n def wald(self, double mean, double scale, size=None):\n \"\"\"Wald (inverse Gaussian) distribution.\n \n wald(mean, scale, size=None)\n \"\"\"\n if mean <= 0.0:\n raise ValueError(\"mean <= 0.0\")\n elif scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_wald, size, mean, scale)\n\n def triangular(self, double left, double mode, double right, size=None):\n \"\"\"Triangular distribution starting at left, peaking at mode, and \n ending at right (left <= mode <= right).\n \n triangular(left, mode, right, size=None)\n \"\"\"\n if left > mode:\n raise ValueError(\"left > mode\")\n elif mode > right:\n raise ValueError(\"mode > right\")\n elif left == right:\n raise ValueError(\"left == right\")\n return cont3_array(self.internal_state, rk_triangular, size, left, \n mode, right)\n\n # Complicated, discrete distributions:\n def binomial(self, long n, double p, size=None):\n \"\"\"Binomial distribution of n trials and p probability of success.\n\n binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_binomial, size, n, p)\n\n def negative_binomial(self, long n, double p, size=None):\n \"\"\"Negative Binomial distribution.\n\n negative_binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_negative_binomial, size, n,\n p)\n\n def poisson(self, double lam=1.0, size=None):\n \"\"\"Poisson distribution.\n\n poisson(lam=1.0, size=None) -> random values\n \"\"\"\n if lam <= 0:\n raise ValueError(\"lam <= 0\")\n return discd_array(self.internal_state, rk_poisson, size, lam)\n\n def zipf(self, double a, size=None):\n \"\"\"Zipf distribution.\n \n zipf(a, size=None)\n \"\"\"\n if a <= 1.0:\n raise ValueError(\"a <= 1.0\")\n return discd_array(self.internal_state, rk_zipf, size, a)\n \n def geometric(self, double p, size=None):\n \"\"\"Geometric distribution with p being the probability of \"success\" on\n an individual trial.\n \n geometric(p, size=None)\n \"\"\"\n if p < 0.0:\n raise ValueError(\"p < 0.0\")\n elif p > 1.0:\n raise ValueError(\"p > 1.0\")\n return discd_array(self.internal_state, rk_geometric, size, p)\n \n def hypergeometric(self, long ngood, long nbad, long nsample, size=None):\n \"\"\"Hypergeometric distribution.\n \n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one \n were to draw nsample balls from the urn without replacement, then \n the hypergeometric distribution describes the distribution of \"good\" \n balls in the sample.\n \n hypergeometric(ngood, nbad, nsample, size=None) \n \"\"\"\n if ngood < 1:\n raise ValueError(\"ngood < 1\")\n elif nbad < 1:\n raise ValueError(\"nbad < 1\")\n elif ngood + nbad < nsample:\n raise ValueError(\"ngood + nbad < nsample\")\n elif nsample < 1:\n raise ValueError(\"nsample < 1\")\n return discnmN_array(self.internal_state, rk_hypergeometric, size,\n ngood, nbad, nsample)\n\n def logseries(self, double p, size=None):\n \"\"\"Logarithmic series distribution.\n \n logseries(p, size=None)\n \"\"\"\n if p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discd_array(self.internal_state, rk_logseries, size, p)\n\n # Multivariate distributions:\n def multivariate_normal(self, mean, cov, size=None):\n \"\"\"Return an array containing multivariate normally distributed random numbers\n with specified mean and covariance.\n\n multivariate_normal(mean, cov) -> random values\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\n\n mean must be a 1 dimensional array. cov must be a square two dimensional\n array with the same number of rows and columns as mean has elements.\n\n The first form returns a single 1-D array containing a multivariate\n normal.\n\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\n normal.\n \"\"\"\n # Check preconditions on arguments\n mean = _sp.array(mean)\n cov = _sp.array(cov)\n if size is None:\n shape = []\n else:\n shape = size\n if len(mean.shape) != 1:\n raise ArgumentError(\"mean must be 1 dimensional\")\n if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):\n raise ArgumentError(\"cov must be 2 dimensional and square\")\n if mean.shape[0] != cov.shape[0]:\n raise ArgumentError(\"mean and cov must have same length\")\n # Compute shape of output\n if isinstance(shape, int):\n shape = [shape]\n final_shape = list(shape[:])\n final_shape.append(mean.shape[0])\n # Create a matrix of independent standard normally distributed random\n # numbers. The matrix has rows with the same length as mean and as\n # many rows are necessary to form a matrix of shape final_shape.\n x = standard_normal(_sp.multiply.reduce(final_shape))\n x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),\n mean.shape[0])\n # Transform matrix of standard normals into matrix where each row\n # contains multivariate normals with the desired covariance.\n # Compute A such that matrixmultiply(transpose(A),A) == cov.\n # Then the matrix products of the rows of x and A has the desired\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n \n from numpy.linalg import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n # The rows of x now have the correct covariance but mean 0. Add\n # mean to each row. Then each row will have mean mean.\n _sp.add(mean,x,x)\n x.shape = tuple(final_shape)\n return x\n\n def multinomial(self, long n, object pvals, size=None):\n \"\"\"Multinomial distribution.\n \n multinomial(n, pvals, size=None) -> random values\n\n pvals is a sequence of probabilities that should sum to 1 (however, the\n last element is always assumed to account for the remaining probability\n as long as sum(pvals[:-1]) <= 1).\n \"\"\"\n cdef long d\n cdef ndarray parr \"arrayObject_parr\", mnarr \"arrayObject_mnarr\"\n cdef double *pix\n cdef long *mnix\n cdef long i, j, dn\n cdef double Sum\n\n d = len(pvals)\n parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n pix = parr.data\n\n if kahan_sum(pix, d-1) > 1.0:\n raise ValueError(\"sum(pvals) > 1.0\")\n\n if size is None:\n shape = (d,)\n elif type(size) is int:\n shape = (size, d)\n else:\n shape = size + (d,)\n\n multin = _sp.zeros(shape, _sp.Int)\n mnarr = multin\n mnix = mnarr.data\n i = 0\n while i < PyArray_SIZE(mnarr):\n Sum = 1.0\n dn = n\n for j from 0 <= j < d-1:\n mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)\n dn = dn - mnix[i+j]\n if dn <= 0:\n break\n Sum = Sum - pix[j]\n if dn > 0:\n mnix[i+d-1] = dn\n\n i = i + d\n\n return multin\n\n # Shuffling and permutations:\n def shuffle(self, object x):\n \"\"\"Modify a sequence in-place by shuffling its contents.\n \n shuffle(x)\n \"\"\"\n cdef long i, j\n\n # adaptation of random.shuffle()\n i = len(x) - 1\n while i > 0:\n j = rk_interval(i, self.internal_state)\n x[i], x[j] = x[j], x[i]\n i = i - 1\n \n def permutation(self, object x):\n \"\"\"Given an integer, return a shuffled sequence of integers >= 0 and \n < x; given a sequence, return a shuffled array copy.\n\n permutation(x)\n \"\"\"\n if type(x) is int:\n arr = _sp.arange(x)\n else:\n arr = _sp.array(x)\n self.shuffle(arr)\n return arr \n\n_rand = RandomState()\nseed = _rand.seed\nget_state = _rand.get_state\nset_state = _rand.set_state\nrandom_sample = _rand.random_sample\nrandint = _rand.randint\nbytes = _rand.bytes\nuniform = _rand.uniform\nrand = _rand.rand\nrandn = _rand.randn\nrandom_integers = _rand.random_integers\nstandard_normal = _rand.standard_normal\nnormal = _rand.normal\nbeta = _rand.beta\nexponential = _rand.exponential\nstandard_exponential = _rand.standard_exponential\nstandard_gamma = _rand.standard_gamma\ngamma = _rand.gamma\nf = _rand.f\nnoncentral_f = _rand.noncentral_f\nchisquare = _rand.chisquare\nnoncentral_chisquare = _rand.noncentral_chisquare\nstandard_cauchy = _rand.standard_cauchy\nstandard_t = _rand.standard_t\nvonmises = _rand.vonmises\npareto = _rand.pareto\nweibull = _rand.weibull\npower = _rand.power\nlaplace = _rand.laplace\ngumbel = _rand.gumbel\nlogistic = _rand.logistic\nlognormal = _rand.lognormal\nrayleigh = _rand.rayleigh\nwald = _rand.wald\ntriangular = _rand.triangular\n\nbinomial = _rand.binomial\nnegative_binomial = _rand.negative_binomial\npoisson = _rand.poisson\nzipf = _rand.zipf\ngeometric = _rand.geometric\nhypergeometric = _rand.hypergeometric\nlogseries = _rand.logseries\n\nmultivariate_normal = _rand.multivariate_normal\nmultinomial = _rand.multinomial\n\nshuffle = _rand.shuffle\npermutation = _rand.permutation\n", + "source_code_before": "# mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit\n#\n# Copyright 2005 Robert Kern (robert.kern@gmail.com)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\ninclude \"Python.pxi\"\ninclude \"numpy.pxi\"\n\ncdef extern from \"math.h\":\n double exp(double x)\n double log(double x)\n double floor(double x)\n double sin(double x)\n double cos(double x)\n\ncdef extern from \"randomkit.h\":\n\n ctypedef struct rk_state:\n unsigned long key[624]\n int pos\n\n ctypedef enum rk_error:\n RK_NOERR = 0\n RK_ENODEV = 1\n RK_ERR_MAX = 2\n\n char *rk_strerror[2]\n \n # 0xFFFFFFFFUL\n unsigned long RK_MAX\n\n void rk_seed(unsigned long seed, rk_state *state)\n rk_error rk_randomseed(rk_state *state)\n unsigned long rk_random(rk_state *state)\n long rk_long(rk_state *state)\n unsigned long rk_ulong(rk_state *state)\n unsigned long rk_interval(unsigned long max, rk_state *state)\n double rk_double(rk_state *state)\n void rk_fill(void *buffer, size_t size, rk_state *state)\n rk_error rk_devfill(void *buffer, size_t size, int strong)\n rk_error rk_altfill(void *buffer, size_t size, int strong,\n rk_state *state)\n double rk_gauss(rk_state *state)\n\ncdef extern from \"distributions.h\":\n \n double rk_normal(rk_state *state, double loc, double scale)\n double rk_standard_exponential(rk_state *state)\n double rk_exponential(rk_state *state, double scale)\n double rk_uniform(rk_state *state, double loc, double scale)\n double rk_standard_gamma(rk_state *state, double shape)\n double rk_gamma(rk_state *state, double shape, double scale)\n double rk_beta(rk_state *state, double a, double b)\n double rk_chisquare(rk_state *state, double df)\n double rk_noncentral_chisquare(rk_state *state, double df, double nonc)\n double rk_f(rk_state *state, double dfnum, double dfden)\n double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)\n double rk_standard_cauchy(rk_state *state)\n double rk_standard_t(rk_state *state, double df)\n double rk_vonmises(rk_state *state, double mu, double kappa)\n double rk_pareto(rk_state *state, double a)\n double rk_weibull(rk_state *state, double a)\n double rk_power(rk_state *state, double a)\n double rk_laplace(rk_state *state, double loc, double scale)\n double rk_gumbel(rk_state *state, double loc, double scale)\n double rk_logistic(rk_state *state, double loc, double scale)\n double rk_lognormal(rk_state *state, double mode, double sigma)\n double rk_rayleigh(rk_state *state, double mode)\n double rk_wald(rk_state *state, double mean, double scale)\n double rk_triangular(rk_state *state, double left, double mode, double right)\n \n long rk_binomial(rk_state *state, long n, double p)\n long rk_binomial_btpe(rk_state *state, long n, double p)\n long rk_binomial_inversion(rk_state *state, long n, double p)\n long rk_negative_binomial(rk_state *state, long n, double p)\n long rk_poisson(rk_state *state, double lam)\n long rk_poisson_mult(rk_state *state, double lam)\n long rk_poisson_ptrs(rk_state *state, double lam)\n long rk_zipf(rk_state *state, double a)\n long rk_geometric(rk_state *state, double p)\n long rk_hypergeometric(rk_state *state, long good, long bad, long sample)\n long rk_logseries(rk_state *state, double p)\n\nctypedef double (* rk_cont0)(rk_state *state)\nctypedef double (* rk_cont1)(rk_state *state, double a)\nctypedef double (* rk_cont2)(rk_state *state, double a, double b)\nctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)\n\nctypedef long (* rk_disc0)(rk_state *state)\nctypedef long (* rk_discnp)(rk_state *state, long n, double p)\nctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N)\nctypedef long (* rk_discd)(rk_state *state, double a)\n\n\ncdef extern from \"initarray.h\":\n void init_by_array(rk_state *self, unsigned long *init_key, \n unsigned long key_length)\n\n# Initialize numpy\nimport_array()\n\nimport numpy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a, \n double b):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a, b)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b)\n return array\n\ncdef object cont3_array(rk_state *state, rk_cont3 func, object size, double a, \n double b, double c):\n\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n \n if size is None:\n return func(state, a, b, c)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b, c)\n return array\n\ncdef object disc0_array(rk_state *state, rk_disc0 func, object size):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, double p):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, p)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, p)\n return array\n\ncdef object discnmN_array(rk_state *state, rk_discnmN func, object size, \n long n, long m, long N):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, m, N)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, m, N)\n return array\n\ncdef object discd_array(rk_state *state, rk_discd func, object size, double a):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef double kahan_sum(double *darr, long n):\n cdef double c, y, t, sum\n cdef long i\n sum = darr[0]\n c = 0.0\n for i from 1 <= i < n:\n y = darr[i] - c\n t = sum + y\n c = (t-sum) - y\n sum = t\n return sum\n\ncdef class RandomState:\n \"\"\"Container for the Mersenne Twister PRNG.\n\n Constructor\n -----------\n RandomState(seed=None): initializes the PRNG with the given seed. See the\n seed() method for details.\n\n Distribution Methods\n -----------------\n RandomState exposes a number of methods for generating random numbers drawn\n from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n size=None. If size is None, then a single value is generated and returned.\n If size is an integer, then a 1-D numpy array filled with generated values\n is returned. If size is a tuple, then a numpy array with that shape is\n filled and returned.\n \"\"\"\n cdef rk_state *internal_state\n\n def __init__(self, seed=None):\n self.internal_state = PyMem_Malloc(sizeof(rk_state))\n\n self.seed(seed)\n\n def __dealloc__(self):\n if self.internal_state != NULL:\n PyMem_Free(self.internal_state)\n\n def seed(self, seed=None):\n \"\"\"Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n \"\"\"\n cdef rk_error errcode\n cdef ndarray obj \"arrayObject_obj\"\n if seed is None:\n errcode = rk_randomseed(self.internal_state)\n elif type(seed) is int:\n rk_seed(seed, self.internal_state)\n else:\n obj = PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n init_by_array(self.internal_state, (obj.data),\n obj.dimensions[0])\n\n def get_state(self):\n \"\"\"Return a tuple representing the internal state of the generator.\n\n get_state() -> ('MT19937', int key[624], int pos)\n \"\"\"\n cdef ndarray state \"arrayObject_state\"\n state = _sp.empty(624, _sp.Int)\n memcpy((state.data), self.internal_state.key, 624*sizeof(long))\n return ('MT19937', state, self.internal_state.pos)\n \n def set_state(self, state):\n \"\"\"Set the state from a tuple.\n \n state = ('MT19937', int key[624], int pos)\n \n set_state(state)\n \"\"\"\n cdef ndarray obj \"arrayObject_obj\"\n cdef int pos\n algorithm_name = state[0]\n if algorithm_name != 'MT19937':\n raise ValueError(\"algorithm must be 'MT19937'\")\n key, pos = state[1:]\n obj = PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)\n if obj.dimensions[0] != 624:\n raise ValueError(\"state must be 624 longs\")\n memcpy(self.internal_state.key, (obj.data), 624*sizeof(long))\n self.internal_state.pos = pos\n \n # Pickling support:\n def __getstate__(self):\n return self.get_state()\n\n def __setstate__(self, state):\n self.set_state(state)\n\n def __reduce__(self):\n return (_sp.random.__RandomState_ctor, (), self.get_state())\n\n # Basic distributions:\n def random_sample(self, size=None):\n \"\"\"Return random floats in the half-open interval [0.0, 1.0).\n\n random_sample(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_double, size)\n\n def tomaxint(self, size=None):\n \"\"\"Returns random integers x such that 0 <= x <= sys.maxint.\n\n tomaxint(size=None) -> random values\n \"\"\"\n return disc0_array(self.internal_state, rk_long, size)\n\n def randint(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x < high.\n\n randint(low, high=None, size=None) -> random values\n\n If high is None, then 0 <= x < low.\n \"\"\"\n cdef long lo, hi, diff\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if high is None:\n lo = 0\n hi = low\n else:\n lo = low\n hi = high\n\n diff = hi - lo - 1\n if diff < 0:\n raise ValueError(\"low >= high\")\n \n if size is None:\n return rk_interval(diff, self.internal_state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = lo + rk_interval(diff, self.internal_state)\n return array\n\n def bytes(self, unsigned int length):\n \"\"\"Return random bytes.\n\n bytes(length) -> str\n \"\"\"\n cdef void *bytes\n bytes = PyMem_Malloc(length)\n rk_fill(bytes, length, self.internal_state)\n bytestring = PyString_FromString(bytes)\n PyMem_Free(bytes)\n return bytestring\n\n def uniform(self, double low=0.0, double high=1.0, size=None):\n \"\"\"Uniform distribution over [low, high).\n\n uniform(low=0.0, high=1.0, size=None) -> random values\n \"\"\"\n return cont2_array(self.internal_state, rk_uniform, size, low, \n high-low)\n\n def rand(self, *args):\n \"\"\"Return an array of the given dimensions which is initialized to \n random numbers from a uniform distribution in the range [0,1).\n\n rand(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.random_sample()\n else:\n return self.random_sample(size=args)\n\n def randn(self, *args):\n \"\"\"Returns zero-mean, unit-variance Gaussian random numbers in an \n array of shape (d0, d1, ..., dn).\n\n randn(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.standard_normal()\n else:\n return self.standard_normal(args)\n\n def random_integers(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x <= high.\n\n random_integers(low, high=None, size=None) -> random values.\n\n If high is None, then 1 <= x <= low.\n \"\"\"\n if high is None:\n high = low\n low = 1\n return self.randint(low, high+1, size)\n\n # Complicated, continuous distributions:\n def standard_normal(self, size=None):\n \"\"\"Standard Normal distribution (mean=0, stdev=1).\n\n standard_normal(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_gauss, size)\n\n def normal(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Normal distribution (mean=loc, stdev=scale).\n\n normal(loc=0.0, scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_normal, size, loc, scale)\n\n def beta(self, double a, double b, size=None):\n \"\"\"Beta distribution over [0, 1].\n\n beta(a, b, size=None) -> random values\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n elif b <= 0:\n raise ValueError(\"b <= 0\")\n return cont2_array(self.internal_state, rk_beta, size, a, b)\n\n def exponential(self, double scale=1.0, size=None):\n \"\"\"Exponential distribution.\n\n exponential(scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont1_array(self.internal_state, rk_exponential, size, scale)\n\n def standard_exponential(self, size=None):\n \"\"\"Standard exponential distribution (scale=1).\n\n standard_exponential(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_exponential, size)\n\n def standard_gamma(self, double shape, size=None):\n \"\"\"Standard Gamma distribution.\n\n standard_gamma(shape, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n return cont1_array(self.internal_state, rk_standard_gamma, size, shape)\n\n def gamma(self, double shape, double scale=1.0, size=None):\n \"\"\"Gamma distribution.\n\n gamma(shape, scale=1.0, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n elif scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_gamma, size, shape, scale)\n\n def f(self, double dfnum, double dfden, size=None):\n \"\"\"F distribution.\n\n f(dfnum, dfden, size=None) -> random values\n \"\"\"\n if dfnum <= 0:\n raise ValueError(\"dfnum <= 0\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n return cont2_array(self.internal_state, rk_f, size, dfnum, dfden)\n\n def noncentral_f(self, double dfnum, double dfden, double nonc, size=None):\n \"\"\"Noncentral F distribution.\n\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\n \"\"\"\n if dfnum <= 1:\n raise ValueError(\"dfnum <= 1\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont3_array(self.internal_state, rk_noncentral_f, size, dfnum,\n dfden, nonc)\n\n def chisquare(self, double df, size=None):\n \"\"\"Chi^2 distribution.\n\n chisquare(df, size=None) -> random values\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_chisquare, size, df)\n\n def noncentral_chisquare(self, double df, double nonc, size=None):\n \"\"\"Noncentral Chi^2 distribution.\n\n noncentral_chisquare(df, nonc, size=None) -> random values\n \"\"\"\n if df <= 1:\n raise ValueError(\"df <= 1\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont2_array(self.internal_state, rk_noncentral_chisquare, size,\n df, nonc)\n \n def standard_cauchy(self, size=None):\n \"\"\"Standard Cauchy with mode=0.\n\n standard_cauchy(size=None)\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_cauchy, size)\n\n def standard_t(self, double df, size=None):\n \"\"\"Standard Student's t distribution with df degrees of freedom.\n\n standard_t(df, size=None)\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_standard_t, size, df)\n\n def vonmises(self, double mu, double kappa, size=None):\n \"\"\"von Mises circular distribution with mode mu and dispersion parameter\n kappa on [-pi, pi].\n\n vonmises(mu, kappa, size=None)\n \"\"\"\n if kappa < 0:\n raise ValueError(\"kappa < 0\")\n return cont2_array(self.internal_state, rk_vonmises, size, mu, kappa)\n\n def pareto(self, double a, size=None):\n \"\"\"Pareto distribution.\n\n pareto(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_pareto, size, a)\n\n def weibull(self, double a, size=None):\n \"\"\"Weibull distribution.\n\n weibull(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_weibull, size, a)\n\n def power(self, double a, size=None):\n \"\"\"Power distribution.\n\n power(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_power, size, a)\n\n def laplace(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Laplace distribution.\n \n laplace(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_laplace, size, loc, scale)\n \n def gumbel(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Gumbel distribution.\n \n gumbel(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_gumbel, size, loc, scale)\n \n def logistic(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Logistic distribution.\n \n logistic(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_logistic, size, loc, scale)\n\n def lognormal(self, double mean=0.0, double sigma=1.0, size=None):\n \"\"\"Log-normal distribution.\n \n Note that the mean parameter is not the mean of this distribution, but \n the underlying normal distribution.\n \n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\n \n lognormal(mean=0.0, sigma=1.0, size=None)\n \"\"\"\n if sigma <= 0.0:\n raise ValueError(\"sigma <= 0.0\")\n return cont2_array(self.internal_state, rk_lognormal, size, mean, sigma)\n \n def rayleigh(self, double scale=1.0, size=None):\n \"\"\"Rayleigh distribution.\n \n rayleigh(scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont1_array(self.internal_state, rk_rayleigh, size, scale)\n \n def wald(self, double mean, double scale, size=None):\n \"\"\"Wald (inverse Gaussian) distribution.\n \n wald(mean, scale, size=None)\n \"\"\"\n if mean <= 0.0:\n raise ValueError(\"mean <= 0.0\")\n elif scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_wald, size, mean, scale)\n\n def triangular(self, double left, double mode, double right, size=None):\n \"\"\"Triangular distribution starting at left, peaking at mode, and \n ending at right (left <= mode <= right).\n \n triangular(left, mode, right, size=None)\n \"\"\"\n if left > mode:\n raise ValueError(\"left > mode\")\n elif mode > right:\n raise ValueError(\"mode > right\")\n elif left == right:\n raise ValueError(\"left == right\")\n return cont3_array(self.internal_state, rk_triangular, size, left, \n mode, right)\n\n # Complicated, discrete distributions:\n def binomial(self, long n, double p, size=None):\n \"\"\"Binomial distribution of n trials and p probability of success.\n\n binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_binomial, size, n, p)\n\n def negative_binomial(self, long n, double p, size=None):\n \"\"\"Negative Binomial distribution.\n\n negative_binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_negative_binomial, size, n,\n p)\n\n def poisson(self, double lam=1.0, size=None):\n \"\"\"Poisson distribution.\n\n poisson(lam=1.0, size=None) -> random values\n \"\"\"\n if lam <= 0:\n raise ValueError(\"lam <= 0\")\n return discd_array(self.internal_state, rk_poisson, size, lam)\n\n def zipf(self, double a, size=None):\n \"\"\"Zipf distribution.\n \n zipf(a, size=None)\n \"\"\"\n if a <= 1.0:\n raise ValueError(\"a <= 1.0\")\n return discd_array(self.internal_state, rk_zipf, size, a)\n \n def geometric(self, double p, size=None):\n \"\"\"Geometric distribution with p being the probability of \"success\" on\n an individual trial.\n \n geometric(p, size=None)\n \"\"\"\n if p < 0.0:\n raise ValueError(\"p < 0.0\")\n elif p > 1.0:\n raise ValueError(\"p > 1.0\")\n return discd_array(self.internal_state, rk_geometric, size, p)\n \n def hypergeometric(self, long ngood, long nbad, long nsample, size=None):\n \"\"\"Hypergeometric distribution.\n \n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one \n were to draw nsample balls from the urn without replacement, then \n the hypergeometric distribution describes the distribution of \"good\" \n balls in the sample.\n \n hypergeometric(ngood, nbad, nsample, size=None) \n \"\"\"\n if ngood < 1:\n raise ValueError(\"ngood < 1\")\n elif nbad < 1:\n raise ValueError(\"nbad < 1\")\n elif ngood + nbad < nsample:\n raise ValueError(\"ngood + nbad < nsample\")\n elif nsample < 1:\n raise ValueError(\"nsample < 1\")\n return discnmN_array(self.internal_state, rk_hypergeometric, size,\n ngood, nbad, nsample)\n\n def logseries(self, double p, size=None):\n \"\"\"Logarithmic series distribution.\n \n logseries(p, size=None)\n \"\"\"\n if p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discd_array(self.internal_state, rk_logseries, size, p)\n\n # Multivariate distributions:\n def multivariate_normal(self, mean, cov, size=None):\n \"\"\"Return an array containing multivariate normally distributed random numbers\n with specified mean and covariance.\n\n multivariate_normal(mean, cov) -> random values\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\n\n mean must be a 1 dimensional array. cov must be a square two dimensional\n array with the same number of rows and columns as mean has elements.\n\n The first form returns a single 1-D array containing a multivariate\n normal.\n\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\n normal.\n \"\"\"\n # Check preconditions on arguments\n mean = _sp.array(mean)\n cov = _sp.array(cov)\n if size is None:\n shape = []\n else:\n shape = size\n if len(mean.shape) != 1:\n raise ArgumentError(\"mean must be 1 dimensional\")\n if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):\n raise ArgumentError(\"cov must be 2 dimensional and square\")\n if mean.shape[0] != cov.shape[0]:\n raise ArgumentError(\"mean and cov must have same length\")\n # Compute shape of output\n if isinstance(shape, int):\n shape = [shape]\n final_shape = list(shape[:])\n final_shape.append(mean.shape[0])\n # Create a matrix of independent standard normally distributed random\n # numbers. The matrix has rows with the same length as mean and as\n # many rows are necessary to form a matrix of shape final_shape.\n x = standard_normal(_sp.multiply.reduce(final_shape))\n x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),\n mean.shape[0])\n # Transform matrix of standard normals into matrix where each row\n # contains multivariate normals with the desired covariance.\n # Compute A such that matrixmultiply(transpose(A),A) == cov.\n # Then the matrix products of the rows of x and A has the desired\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n \n from numpy.corelinalg import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n # The rows of x now have the correct covariance but mean 0. Add\n # mean to each row. Then each row will have mean mean.\n _sp.add(mean,x,x)\n x.shape = tuple(final_shape)\n return x\n\n def multinomial(self, long n, object pvals, size=None):\n \"\"\"Multinomial distribution.\n \n multinomial(n, pvals, size=None) -> random values\n\n pvals is a sequence of probabilities that should sum to 1 (however, the\n last element is always assumed to account for the remaining probability\n as long as sum(pvals[:-1]) <= 1).\n \"\"\"\n cdef long d\n cdef ndarray parr \"arrayObject_parr\", mnarr \"arrayObject_mnarr\"\n cdef double *pix\n cdef long *mnix\n cdef long i, j, dn\n cdef double Sum\n\n d = len(pvals)\n parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n pix = parr.data\n\n if kahan_sum(pix, d-1) > 1.0:\n raise ValueError(\"sum(pvals) > 1.0\")\n\n if size is None:\n shape = (d,)\n elif type(size) is int:\n shape = (size, d)\n else:\n shape = size + (d,)\n\n multin = _sp.zeros(shape, _sp.Int)\n mnarr = multin\n mnix = mnarr.data\n i = 0\n while i < PyArray_SIZE(mnarr):\n Sum = 1.0\n dn = n\n for j from 0 <= j < d-1:\n mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)\n dn = dn - mnix[i+j]\n if dn <= 0:\n break\n Sum = Sum - pix[j]\n if dn > 0:\n mnix[i+d-1] = dn\n\n i = i + d\n\n return multin\n\n # Shuffling and permutations:\n def shuffle(self, object x):\n \"\"\"Modify a sequence in-place by shuffling its contents.\n \n shuffle(x)\n \"\"\"\n cdef long i, j\n\n # adaptation of random.shuffle()\n i = len(x) - 1\n while i > 0:\n j = rk_interval(i, self.internal_state)\n x[i], x[j] = x[j], x[i]\n i = i - 1\n \n def permutation(self, object x):\n \"\"\"Given an integer, return a shuffled sequence of integers >= 0 and \n < x; given a sequence, return a shuffled array copy.\n\n permutation(x)\n \"\"\"\n if type(x) is int:\n arr = _sp.arange(x)\n else:\n arr = _sp.array(x)\n self.shuffle(arr)\n return arr \n\n_rand = RandomState()\nseed = _rand.seed\nget_state = _rand.get_state\nset_state = _rand.set_state\nrandom_sample = _rand.random_sample\nrandint = _rand.randint\nbytes = _rand.bytes\nuniform = _rand.uniform\nrand = _rand.rand\nrandn = _rand.randn\nrandom_integers = _rand.random_integers\nstandard_normal = _rand.standard_normal\nnormal = _rand.normal\nbeta = _rand.beta\nexponential = _rand.exponential\nstandard_exponential = _rand.standard_exponential\nstandard_gamma = _rand.standard_gamma\ngamma = _rand.gamma\nf = _rand.f\nnoncentral_f = _rand.noncentral_f\nchisquare = _rand.chisquare\nnoncentral_chisquare = _rand.noncentral_chisquare\nstandard_cauchy = _rand.standard_cauchy\nstandard_t = _rand.standard_t\nvonmises = _rand.vonmises\npareto = _rand.pareto\nweibull = _rand.weibull\npower = _rand.power\nlaplace = _rand.laplace\ngumbel = _rand.gumbel\nlogistic = _rand.logistic\nlognormal = _rand.lognormal\nrayleigh = _rand.rayleigh\nwald = _rand.wald\ntriangular = _rand.triangular\n\nbinomial = _rand.binomial\nnegative_binomial = _rand.negative_binomial\npoisson = _rand.poisson\nzipf = _rand.zipf\ngeometric = _rand.geometric\nhypergeometric = _rand.hypergeometric\nlogseries = _rand.logseries\n\nmultivariate_normal = _rand.multivariate_normal\nmultinomial = _rand.multinomial\n\nshuffle = _rand.shuffle\npermutation = _rand.permutation\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + " from numpy.linalg import svd" + ], + "deleted": [ + " from numpy.corelinalg import svd" + ] + } + } + ] + }, + { + "hash": "416bf3771b9d78ca0a4371b7b92d426d32922e48", + "msg": "Trying to delete mtrand.c", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T01:28:47+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T01:28:47+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "959e0ba32d1fb84295601736a66e22d70f149014" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 5990, + "insertions": 0, + "lines": 5990, + "files": 1, + "dmm_unit_size": 0.9782761037140855, + "dmm_unit_complexity": 0.9096005606166784, + "dmm_unit_interfacing": 0.8722261153935996, + "modified_files": [ + { + "old_path": "numpy/random/mtrand/mtrand.c", + "new_path": null, + "filename": "mtrand.c", + "extension": "c", + "change_type": "DELETE", + "diff": "@@ -1,5990 +0,0 @@\n-/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 12:43:35 2006 */\n-\n-#include \"Python.h\"\n-#include \"structmember.h\"\n-#ifndef PY_LONG_LONG\n- #define PY_LONG_LONG LONG_LONG\n-#endif\n-#include \"string.h\"\n-#include \"math.h\"\n-#include \"numpy/arrayobject.h\"\n-#include \"randomkit.h\"\n-#include \"distributions.h\"\n-#include \"initarray.h\"\n-\n-\n-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\n-typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\n-static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\n-static int __Pyx_EndUnpack(PyObject *, int); /*proto*/\n-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\n-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\n-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\n-static void __Pyx_WriteUnraisable(char *name); /*proto*/\n-static void __Pyx_AddTraceback(char *funcname); /*proto*/\n-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\n-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\n-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\n-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n-\n-static PyObject *__pyx_m;\n-static PyObject *__pyx_b;\n-static int __pyx_lineno;\n-static char *__pyx_filename;\n-staticforward char **__pyx_f;\n-\n-/* Declarations from mtrand */\n-\n-staticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n-\n-struct __pyx_obj_6mtrand_RandomState {\n- PyObject_HEAD\n- rk_state (*internal_state);\n-};\n-\n-static PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\n-static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\n-static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\n-static PyObject *__pyx_k2;\n-static PyObject *__pyx_k3;\n-static PyObject *__pyx_k4;\n-static PyObject *__pyx_k5;\n-static PyObject *__pyx_k6;\n-static PyObject *__pyx_k7;\n-static double __pyx_k8;\n-static double __pyx_k9;\n-static PyObject *__pyx_k10;\n-static PyObject *__pyx_k11;\n-static PyObject *__pyx_k12;\n-static PyObject *__pyx_k13;\n-static double __pyx_k14;\n-static double __pyx_k15;\n-static PyObject *__pyx_k16;\n-static PyObject *__pyx_k17;\n-static double __pyx_k18;\n-static PyObject *__pyx_k19;\n-static PyObject *__pyx_k20;\n-static PyObject *__pyx_k21;\n-static double __pyx_k22;\n-static PyObject *__pyx_k23;\n-static PyObject *__pyx_k24;\n-static PyObject *__pyx_k25;\n-static PyObject *__pyx_k26;\n-static PyObject *__pyx_k27;\n-static PyObject *__pyx_k28;\n-static PyObject *__pyx_k29;\n-static PyObject *__pyx_k30;\n-static PyObject *__pyx_k31;\n-static PyObject *__pyx_k32;\n-static PyObject *__pyx_k33;\n-static double __pyx_k34;\n-static double __pyx_k35;\n-static PyObject *__pyx_k36;\n-static double __pyx_k37;\n-static double __pyx_k38;\n-static PyObject *__pyx_k39;\n-static double __pyx_k40;\n-static double __pyx_k41;\n-static PyObject *__pyx_k42;\n-static double __pyx_k43;\n-static double __pyx_k44;\n-static PyObject *__pyx_k45;\n-static double __pyx_k46;\n-static PyObject *__pyx_k47;\n-static PyObject *__pyx_k48;\n-static PyObject *__pyx_k49;\n-static PyObject *__pyx_k50;\n-static PyObject *__pyx_k51;\n-static double __pyx_k52;\n-static PyObject *__pyx_k53;\n-static PyObject *__pyx_k54;\n-static PyObject *__pyx_k55;\n-static PyObject *__pyx_k56;\n-static PyObject *__pyx_k57;\n-static PyObject *__pyx_k58;\n-static PyObject *__pyx_k59;\n-static PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\n-static PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\n-static double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n-\n-/* Implementation of mtrand */\n-\n-\n-static PyObject *__pyx_n__sp;\n-static PyObject *__pyx_n__rand;\n-static PyObject *__pyx_n_seed;\n-static PyObject *__pyx_n_get_state;\n-static PyObject *__pyx_n_set_state;\n-static PyObject *__pyx_n_random_sample;\n-static PyObject *__pyx_n_randint;\n-static PyObject *__pyx_n_bytes;\n-static PyObject *__pyx_n_uniform;\n-static PyObject *__pyx_n_rand;\n-static PyObject *__pyx_n_randn;\n-static PyObject *__pyx_n_random_integers;\n-static PyObject *__pyx_n_standard_normal;\n-static PyObject *__pyx_n_normal;\n-static PyObject *__pyx_n_beta;\n-static PyObject *__pyx_n_exponential;\n-static PyObject *__pyx_n_standard_exponential;\n-static PyObject *__pyx_n_standard_gamma;\n-static PyObject *__pyx_n_gamma;\n-static PyObject *__pyx_n_f;\n-static PyObject *__pyx_n_noncentral_f;\n-static PyObject *__pyx_n_chisquare;\n-static PyObject *__pyx_n_noncentral_chisquare;\n-static PyObject *__pyx_n_standard_cauchy;\n-static PyObject *__pyx_n_standard_t;\n-static PyObject *__pyx_n_vonmises;\n-static PyObject *__pyx_n_pareto;\n-static PyObject *__pyx_n_weibull;\n-static PyObject *__pyx_n_power;\n-static PyObject *__pyx_n_laplace;\n-static PyObject *__pyx_n_gumbel;\n-static PyObject *__pyx_n_logistic;\n-static PyObject *__pyx_n_lognormal;\n-static PyObject *__pyx_n_rayleigh;\n-static PyObject *__pyx_n_wald;\n-static PyObject *__pyx_n_triangular;\n-static PyObject *__pyx_n_binomial;\n-static PyObject *__pyx_n_negative_binomial;\n-static PyObject *__pyx_n_poisson;\n-static PyObject *__pyx_n_zipf;\n-static PyObject *__pyx_n_geometric;\n-static PyObject *__pyx_n_hypergeometric;\n-static PyObject *__pyx_n_logseries;\n-static PyObject *__pyx_n_multivariate_normal;\n-static PyObject *__pyx_n_multinomial;\n-static PyObject *__pyx_n_shuffle;\n-static PyObject *__pyx_n_permutation;\n-static PyObject *__pyx_n_numpy;\n-\n-static PyObject *__pyx_n_empty;\n-static PyObject *__pyx_n_Float64;\n-\n-static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n- double (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n- __pyx_v_array_data = ((double (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.cont0_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n- double (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n- __pyx_v_array_data = ((double (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.cont1_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n- double (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n- __pyx_v_array_data = ((double (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.cont2_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n- double (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n- __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n- __pyx_v_array_data = ((double (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.cont3_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_Int;\n-\n-static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n- long (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n- __pyx_v_array_data = ((long (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.disc0_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n- long (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n- __pyx_v_array_data = ((long (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.discnp_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n- long (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n- __pyx_v_array_data = ((long (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n- long (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n- __pyx_v_array_data = ((long (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.discd_array\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n- double __pyx_v_c;\n- double __pyx_v_y;\n- double __pyx_v_t;\n- double __pyx_v_sum;\n- long __pyx_v_i;\n- double __pyx_r;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n- __pyx_v_sum = (__pyx_v_darr[0]);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n- __pyx_v_c = 0.0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n- for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n- __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n- __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n- __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n- __pyx_v_sum = __pyx_v_t;\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n- __pyx_r = __pyx_v_sum;\n- goto __pyx_L0;\n-\n- __pyx_r = 0;\n- goto __pyx_L0;\n- __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n- __pyx_L0:;\n- return __pyx_r;\n-}\n-\n-static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_seed = 0;\n- int __pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- static char *__pyx_argnames[] = {\"seed\",0};\n- __pyx_v_seed = __pyx_k2;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_seed);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n- ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_seed);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- __pyx_r = 0;\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n- __pyx_r = -1;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_seed);\n- return __pyx_r;\n-}\n-\n-static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\n-static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n- int __pyx_1;\n- Py_INCREF(__pyx_v_self);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n- __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n- PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- goto __pyx_L0;\n- __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n-}\n-\n-static PyObject *__pyx_n_type;\n-static PyObject *__pyx_n_int;\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_seed = 0;\n- rk_error __pyx_v_errcode;\n- PyArrayObject *arrayObject_obj;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- unsigned long __pyx_5;\n- static char *__pyx_argnames[] = {\"seed\",0};\n- __pyx_v_seed = __pyx_k3;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_seed);\n- arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n- __pyx_1 = __pyx_v_seed == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n- __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n- goto __pyx_L2;\n- }\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_seed);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n- __pyx_1 = __pyx_4 == __pyx_2;\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n- __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n- rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n- __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n- Py_INCREF(((PyObject *)__pyx_3));\n- Py_DECREF(((PyObject *)arrayObject_obj));\n- arrayObject_obj = ((PyArrayObject *)__pyx_3);\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n- init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject_obj);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_seed);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_MT19937;\n-\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyArrayObject *arrayObject_state;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n- Py_INCREF(__pyx_v_self);\n- arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n- __pyx_1 = 0;\n- __pyx_4 = 0;\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_INCREF(((PyObject *)__pyx_1));\n- Py_DECREF(((PyObject *)arrayObject_state));\n- arrayObject_state = ((PyArrayObject *)__pyx_1);\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n- memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n- __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n- Py_INCREF(__pyx_n_MT19937);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n- Py_INCREF(((PyObject *)arrayObject_state));\n- PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n- PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject_state);\n- Py_DECREF(__pyx_v_self);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_ValueError;\n-\n-static PyObject *__pyx_k62p;\n-static PyObject *__pyx_k63p;\n-\n-static char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\n-static char (__pyx_k63[]) = \"state must be 624 longs\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_state = 0;\n- PyArrayObject *arrayObject_obj;\n- int __pyx_v_pos;\n- PyObject *__pyx_v_algorithm_name;\n- PyObject *__pyx_v_key;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- int __pyx_3;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"state\",0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_state);\n- arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n- __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n- __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n- __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_v_algorithm_name);\n- __pyx_v_algorithm_name = __pyx_2;\n- __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n- if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n- __pyx_3 = __pyx_3 != 0;\n- if (__pyx_3) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n- Py_INCREF(__pyx_k62p);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n- __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n- __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n- __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_key);\n- __pyx_v_key = __pyx_2;\n- __pyx_2 = 0;\n- __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n- __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- __pyx_v_pos = __pyx_3;\n- if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n- __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject_obj));\n- arrayObject_obj = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n- __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n- if (__pyx_3) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n- Py_INCREF(__pyx_k63p);\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n- goto __pyx_L3;\n- }\n- __pyx_L3:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n- memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n- ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject_obj);\n- Py_DECREF(__pyx_v_algorithm_name);\n- Py_DECREF(__pyx_v_key);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_state);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- static char *__pyx_argnames[] = {0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n- Py_INCREF(__pyx_v_self);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_r = __pyx_3;\n- __pyx_3 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_state = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- static char *__pyx_argnames[] = {\"state\",0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_state);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_state);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_state);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_random;\n-static PyObject *__pyx_n___RandomState_ctor;\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- PyObject *__pyx_5 = 0;\n- static char *__pyx_argnames[] = {0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n- Py_INCREF(__pyx_v_self);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n- __pyx_1 = 0;\n- __pyx_2 = 0;\n- __pyx_5 = 0;\n- __pyx_r = __pyx_3;\n- __pyx_3 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- Py_XDECREF(__pyx_5);\n- __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"size\",0};\n- __pyx_v_size = __pyx_k4;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"size\",0};\n- __pyx_v_size = __pyx_k5;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n- __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k64p;\n-\n-static char (__pyx_k64[]) = \"low >= high\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_low = 0;\n- PyObject *__pyx_v_high = 0;\n- PyObject *__pyx_v_size = 0;\n- long __pyx_v_lo;\n- long __pyx_v_hi;\n- long __pyx_v_diff;\n- long (*__pyx_v_array_data);\n- PyArrayObject *arrayObject;\n- long __pyx_v_length;\n- long __pyx_v_i;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- long __pyx_2;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- PyObject *__pyx_5 = 0;\n- static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n- __pyx_v_high = __pyx_k6;\n- __pyx_v_size = __pyx_k7;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_low);\n- Py_INCREF(__pyx_v_high);\n- Py_INCREF(__pyx_v_size);\n- arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n- __pyx_1 = __pyx_v_high == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n- __pyx_v_lo = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n- __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n- __pyx_v_hi = __pyx_2;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n- __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n- __pyx_v_lo = __pyx_2;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n- __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n- __pyx_v_hi = __pyx_2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n- __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n- __pyx_1 = (__pyx_v_diff < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n- Py_INCREF(__pyx_k64p);\n- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n- __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- __Pyx_Raise(__pyx_5, 0, 0);\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n- goto __pyx_L3;\n- }\n- __pyx_L3:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n- __pyx_1 = __pyx_v_size == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n- __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n- __pyx_r = __pyx_3;\n- __pyx_3 = 0;\n- goto __pyx_L0;\n- goto __pyx_L4;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_INCREF(((PyObject *)__pyx_4));\n- Py_DECREF(((PyObject *)arrayObject));\n- arrayObject = ((PyArrayObject *)__pyx_4);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n- __pyx_v_length = PyArray_SIZE(arrayObject);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n- __pyx_v_array_data = ((long (*))arrayObject->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n- (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n- Py_INCREF(((PyObject *)arrayObject));\n- __pyx_r = ((PyObject *)arrayObject);\n- goto __pyx_L0;\n- }\n- __pyx_L4:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- Py_XDECREF(__pyx_5);\n- __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_low);\n- Py_DECREF(__pyx_v_high);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- unsigned int __pyx_v_length;\n- void (*__pyx_v_bytes);\n- PyObject *__pyx_v_bytestring;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"length\",0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n- Py_INCREF(__pyx_v_self);\n- __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n- __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n- rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n- __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_bytestring);\n- __pyx_v_bytestring = __pyx_1;\n- __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n- PyMem_Free(__pyx_v_bytes);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n- Py_INCREF(__pyx_v_bytestring);\n- __pyx_r = __pyx_v_bytestring;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_bytestring);\n- Py_DECREF(__pyx_v_self);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_low;\n- double __pyx_v_high;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n- __pyx_v_low = __pyx_k8;\n- __pyx_v_high = __pyx_k9;\n- __pyx_v_size = __pyx_k10;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n- __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_len;\n-static PyObject *__pyx_n_size;\n-\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_args = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- int __pyx_4;\n- PyObject *__pyx_5 = 0;\n- static char *__pyx_argnames[] = {0};\n- if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n- Py_XDECREF(__pyx_args);\n- Py_XDECREF(__pyx_kwds);\n- Py_XDECREF(__pyx_v_args);\n- return 0;\n- }\n- Py_INCREF(__pyx_v_self);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_args);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n- if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 == 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n- __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n- if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n- __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_r = __pyx_5;\n- __pyx_5 = 0;\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_5);\n- __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_XDECREF(__pyx_v_args);\n- Py_DECREF(__pyx_v_self);\n- Py_XDECREF(__pyx_args);\n- Py_XDECREF(__pyx_kwds);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_args = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- int __pyx_4;\n- static char *__pyx_argnames[] = {0};\n- if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n- Py_XDECREF(__pyx_args);\n- Py_XDECREF(__pyx_kwds);\n- Py_XDECREF(__pyx_v_args);\n- return 0;\n- }\n- Py_INCREF(__pyx_v_self);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_args);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n- if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 == 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_args);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n- }\n- __pyx_L2:;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_XDECREF(__pyx_v_args);\n- Py_DECREF(__pyx_v_self);\n- Py_XDECREF(__pyx_args);\n- Py_XDECREF(__pyx_kwds);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_low = 0;\n- PyObject *__pyx_v_high = 0;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n- __pyx_v_high = __pyx_k11;\n- __pyx_v_size = __pyx_k12;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_low);\n- Py_INCREF(__pyx_v_high);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n- __pyx_1 = __pyx_v_high == Py_None;\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n- Py_INCREF(__pyx_v_low);\n- Py_DECREF(__pyx_v_high);\n- __pyx_v_high = __pyx_v_low;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_low);\n- __pyx_v_low = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n- __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n- __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n- __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_low);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n- __pyx_4 = 0;\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_r = __pyx_4;\n- __pyx_4 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_low);\n- Py_DECREF(__pyx_v_high);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"size\",0};\n- __pyx_v_size = __pyx_k13;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k66p;\n-\n-static char (__pyx_k66[]) = \"scale <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_loc;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n- __pyx_v_loc = __pyx_k14;\n- __pyx_v_scale = __pyx_k15;\n- __pyx_v_size = __pyx_k16;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n- __pyx_1 = (__pyx_v_scale <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n- Py_INCREF(__pyx_k66p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k67p;\n-static PyObject *__pyx_k68p;\n-\n-static char (__pyx_k67[]) = \"a <= 0\";\n-static char (__pyx_k68[]) = \"b <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_a;\n- double __pyx_v_b;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n- __pyx_v_size = __pyx_k17;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n- __pyx_1 = (__pyx_v_a <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n- Py_INCREF(__pyx_k67p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_b <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n- Py_INCREF(__pyx_k68p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k69p;\n-\n-static char (__pyx_k69[]) = \"scale <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n- __pyx_v_scale = __pyx_k18;\n- __pyx_v_size = __pyx_k19;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n- __pyx_1 = (__pyx_v_scale <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n- Py_INCREF(__pyx_k69p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"size\",0};\n- __pyx_v_size = __pyx_k20;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k70p;\n-\n-static char (__pyx_k70[]) = \"shape <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_shape;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n- __pyx_v_size = __pyx_k21;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n- __pyx_1 = (__pyx_v_shape <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n- Py_INCREF(__pyx_k70p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k71p;\n-static PyObject *__pyx_k72p;\n-\n-static char (__pyx_k71[]) = \"shape <= 0\";\n-static char (__pyx_k72[]) = \"scale <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_shape;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n- __pyx_v_scale = __pyx_k22;\n- __pyx_v_size = __pyx_k23;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n- __pyx_1 = (__pyx_v_shape <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n- Py_INCREF(__pyx_k71p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_scale <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n- Py_INCREF(__pyx_k72p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k73p;\n-static PyObject *__pyx_k74p;\n-\n-static char (__pyx_k73[]) = \"dfnum <= 0\";\n-static char (__pyx_k74[]) = \"dfden <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_dfnum;\n- double __pyx_v_dfden;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n- __pyx_v_size = __pyx_k24;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n- __pyx_1 = (__pyx_v_dfnum <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n- Py_INCREF(__pyx_k73p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_dfden <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n- Py_INCREF(__pyx_k74p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k75p;\n-static PyObject *__pyx_k76p;\n-static PyObject *__pyx_k77p;\n-\n-static char (__pyx_k75[]) = \"dfnum <= 1\";\n-static char (__pyx_k76[]) = \"dfden <= 0\";\n-static char (__pyx_k77[]) = \"nonc < 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_dfnum;\n- double __pyx_v_dfden;\n- double __pyx_v_nonc;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n- __pyx_v_size = __pyx_k25;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n- __pyx_1 = (__pyx_v_dfnum <= 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n- Py_INCREF(__pyx_k75p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_dfden <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n- Py_INCREF(__pyx_k76p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_nonc < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n- Py_INCREF(__pyx_k77p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n- __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k78p;\n-\n-static char (__pyx_k78[]) = \"df <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_df;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"df\",\"size\",0};\n- __pyx_v_size = __pyx_k26;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n- __pyx_1 = (__pyx_v_df <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n- Py_INCREF(__pyx_k78p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k79p;\n-static PyObject *__pyx_k80p;\n-\n-static char (__pyx_k79[]) = \"df <= 1\";\n-static char (__pyx_k80[]) = \"nonc < 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_df;\n- double __pyx_v_nonc;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n- __pyx_v_size = __pyx_k27;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n- __pyx_1 = (__pyx_v_df <= 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n- Py_INCREF(__pyx_k79p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_nonc < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n- Py_INCREF(__pyx_k80p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- static char *__pyx_argnames[] = {\"size\",0};\n- __pyx_v_size = __pyx_k28;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n- __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n- __pyx_r = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k81p;\n-\n-static char (__pyx_k81[]) = \"df <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_df;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"df\",\"size\",0};\n- __pyx_v_size = __pyx_k29;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n- __pyx_1 = (__pyx_v_df <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n- Py_INCREF(__pyx_k81p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k82p;\n-\n-static char (__pyx_k82[]) = \"kappa < 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_mu;\n- double __pyx_v_kappa;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n- __pyx_v_size = __pyx_k30;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n- __pyx_1 = (__pyx_v_kappa < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n- Py_INCREF(__pyx_k82p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k83p;\n-\n-static char (__pyx_k83[]) = \"a <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_a;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"a\",\"size\",0};\n- __pyx_v_size = __pyx_k31;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n- __pyx_1 = (__pyx_v_a <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n- Py_INCREF(__pyx_k83p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k84p;\n-\n-static char (__pyx_k84[]) = \"a <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_a;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"a\",\"size\",0};\n- __pyx_v_size = __pyx_k32;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n- __pyx_1 = (__pyx_v_a <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n- Py_INCREF(__pyx_k84p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k85p;\n-\n-static char (__pyx_k85[]) = \"a <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_a;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"a\",\"size\",0};\n- __pyx_v_size = __pyx_k33;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n- __pyx_1 = (__pyx_v_a <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n- Py_INCREF(__pyx_k85p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k86p;\n-\n-static char (__pyx_k86[]) = \"scale <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_loc;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n- __pyx_v_loc = __pyx_k34;\n- __pyx_v_scale = __pyx_k35;\n- __pyx_v_size = __pyx_k36;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n- __pyx_1 = (__pyx_v_scale <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n- Py_INCREF(__pyx_k86p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k87p;\n-\n-static char (__pyx_k87[]) = \"scale <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_loc;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n- __pyx_v_loc = __pyx_k37;\n- __pyx_v_scale = __pyx_k38;\n- __pyx_v_size = __pyx_k39;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n- __pyx_1 = (__pyx_v_scale <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n- Py_INCREF(__pyx_k87p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k88p;\n-\n-static char (__pyx_k88[]) = \"scale <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_loc;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n- __pyx_v_loc = __pyx_k40;\n- __pyx_v_scale = __pyx_k41;\n- __pyx_v_size = __pyx_k42;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n- __pyx_1 = (__pyx_v_scale <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n- Py_INCREF(__pyx_k88p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k89p;\n-\n-static char (__pyx_k89[]) = \"sigma <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_mean;\n- double __pyx_v_sigma;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n- __pyx_v_mean = __pyx_k43;\n- __pyx_v_sigma = __pyx_k44;\n- __pyx_v_size = __pyx_k45;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n- __pyx_1 = (__pyx_v_sigma <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n- Py_INCREF(__pyx_k89p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k90p;\n-\n-static char (__pyx_k90[]) = \"scale <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n- __pyx_v_scale = __pyx_k46;\n- __pyx_v_size = __pyx_k47;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n- __pyx_1 = (__pyx_v_scale <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n- Py_INCREF(__pyx_k90p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n- __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k91p;\n-static PyObject *__pyx_k92p;\n-\n-static char (__pyx_k91[]) = \"mean <= 0.0\";\n-static char (__pyx_k92[]) = \"scale <= 0.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_mean;\n- double __pyx_v_scale;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n- __pyx_v_size = __pyx_k48;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n- __pyx_1 = (__pyx_v_mean <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n- Py_INCREF(__pyx_k91p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_scale <= 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n- Py_INCREF(__pyx_k92p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n- __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k93p;\n-static PyObject *__pyx_k94p;\n-static PyObject *__pyx_k95p;\n-\n-static char (__pyx_k93[]) = \"left > mode\";\n-static char (__pyx_k94[]) = \"mode > right\";\n-static char (__pyx_k95[]) = \"left == right\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_left;\n- double __pyx_v_mode;\n- double __pyx_v_right;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n- __pyx_v_size = __pyx_k49;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n- __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n- Py_INCREF(__pyx_k93p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n- Py_INCREF(__pyx_k94p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_left == __pyx_v_right);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n- Py_INCREF(__pyx_k95p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n- __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k96p;\n-static PyObject *__pyx_k97p;\n-static PyObject *__pyx_k98p;\n-\n-static char (__pyx_k96[]) = \"n <= 0\";\n-static char (__pyx_k97[]) = \"p < 0\";\n-static char (__pyx_k98[]) = \"p > 1\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- long __pyx_v_n;\n- double __pyx_v_p;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n- __pyx_v_size = __pyx_k50;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n- __pyx_1 = (__pyx_v_n <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n- Py_INCREF(__pyx_k96p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n- Py_INCREF(__pyx_k97p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p > 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n- Py_INCREF(__pyx_k98p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n- __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k99p;\n-static PyObject *__pyx_k100p;\n-static PyObject *__pyx_k101p;\n-\n-static char (__pyx_k99[]) = \"n <= 0\";\n-static char (__pyx_k100[]) = \"p < 0\";\n-static char (__pyx_k101[]) = \"p > 1\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- long __pyx_v_n;\n- double __pyx_v_p;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n- __pyx_v_size = __pyx_k51;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n- __pyx_1 = (__pyx_v_n <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n- Py_INCREF(__pyx_k99p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n- Py_INCREF(__pyx_k100p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p > 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n- Py_INCREF(__pyx_k101p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n- __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k102p;\n-\n-static char (__pyx_k102[]) = \"lam <= 0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_lam;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n- __pyx_v_lam = __pyx_k52;\n- __pyx_v_size = __pyx_k53;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n- __pyx_1 = (__pyx_v_lam <= 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n- Py_INCREF(__pyx_k102p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n- __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k103p;\n-\n-static char (__pyx_k103[]) = \"a <= 1.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_a;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"a\",\"size\",0};\n- __pyx_v_size = __pyx_k54;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n- __pyx_1 = (__pyx_v_a <= 1.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n- Py_INCREF(__pyx_k103p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n- __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k104p;\n-static PyObject *__pyx_k105p;\n-\n-static char (__pyx_k104[]) = \"p < 0.0\";\n-static char (__pyx_k105[]) = \"p > 1.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_p;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"p\",\"size\",0};\n- __pyx_v_size = __pyx_k55;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n- __pyx_1 = (__pyx_v_p < 0.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n- Py_INCREF(__pyx_k104p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p > 1.0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n- Py_INCREF(__pyx_k105p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n- __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k106p;\n-static PyObject *__pyx_k107p;\n-static PyObject *__pyx_k108p;\n-static PyObject *__pyx_k109p;\n-\n-static char (__pyx_k106[]) = \"ngood < 1\";\n-static char (__pyx_k107[]) = \"nbad < 1\";\n-static char (__pyx_k108[]) = \"ngood + nbad < nsample\";\n-static char (__pyx_k109[]) = \"nsample < 1\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- long __pyx_v_ngood;\n- long __pyx_v_nbad;\n- long __pyx_v_nsample;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n- __pyx_v_size = __pyx_k56;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n- __pyx_1 = (__pyx_v_ngood < 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n- Py_INCREF(__pyx_k106p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_nbad < 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n- Py_INCREF(__pyx_k107p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n- Py_INCREF(__pyx_k108p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_nsample < 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n- Py_INCREF(__pyx_k109p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n- __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_k110p;\n-static PyObject *__pyx_k111p;\n-\n-static char (__pyx_k110[]) = \"p < 0\";\n-static char (__pyx_k111[]) = \"p > 1\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- double __pyx_v_p;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_r;\n- int __pyx_1;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- PyObject *__pyx_4 = 0;\n- static char *__pyx_argnames[] = {\"p\",\"size\",0};\n- __pyx_v_size = __pyx_k57;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_size);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n- __pyx_1 = (__pyx_v_p < 0);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n- Py_INCREF(__pyx_k110p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_1 = (__pyx_v_p > 1);\n- if (__pyx_1) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n- Py_INCREF(__pyx_k111p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_4, 0, 0);\n- Py_DECREF(__pyx_4); __pyx_4 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n- __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n- __pyx_r = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_4);\n- __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_array;\n-static PyObject *__pyx_n_shape;\n-static PyObject *__pyx_n_ArgumentError;\n-static PyObject *__pyx_n_isinstance;\n-static PyObject *__pyx_n_list;\n-static PyObject *__pyx_n_append;\n-static PyObject *__pyx_n_multiply;\n-static PyObject *__pyx_n_reduce;\n-static PyObject *__pyx_n_svd;\n-static PyObject *__pyx_n_matrixmultiply;\n-static PyObject *__pyx_n_sqrt;\n-static PyObject *__pyx_n_add;\n-static PyObject *__pyx_n_tuple;\n-\n-static PyObject *__pyx_k112p;\n-static PyObject *__pyx_k113p;\n-static PyObject *__pyx_k114p;\n-static PyObject *__pyx_k115p;\n-\n-static char (__pyx_k112[]) = \"mean must be 1 dimensional\";\n-static char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\n-static char (__pyx_k114[]) = \"mean and cov must have same length\";\n-static char (__pyx_k115[]) = \"numpy.corelinalg\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_mean = 0;\n- PyObject *__pyx_v_cov = 0;\n- PyObject *__pyx_v_size = 0;\n- PyObject *__pyx_v_shape;\n- PyObject *__pyx_v_final_shape;\n- PyObject *__pyx_v_x;\n- PyObject *__pyx_v_svd;\n- PyObject *__pyx_v_u;\n- PyObject *__pyx_v_s;\n- PyObject *__pyx_v_v;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- int __pyx_4;\n- PyObject *__pyx_5 = 0;\n- static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n- __pyx_v_size = __pyx_k58;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_mean);\n- Py_INCREF(__pyx_v_cov);\n- Py_INCREF(__pyx_v_size);\n- __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n- __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n- __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n- __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n- __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n- __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n- __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_mean);\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_v_mean);\n- __pyx_v_mean = __pyx_3;\n- __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_cov);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_v_cov);\n- __pyx_v_cov = __pyx_2;\n- __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n- __pyx_4 = __pyx_v_size == Py_None;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n- __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n- Py_INCREF(__pyx_v_size);\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_v_size;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n- __pyx_2 = 0;\n- __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 != 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n- Py_INCREF(__pyx_k112p);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __Pyx_Raise(__pyx_3, 0, 0);\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n- goto __pyx_L3;\n- }\n- __pyx_L3:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n- __pyx_2 = 0;\n- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 != 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (!__pyx_4) {\n- __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 != 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- }\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n- Py_INCREF(__pyx_k113p);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n- __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __Pyx_Raise(__pyx_1, 0, 0);\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n- goto __pyx_L4;\n- }\n- __pyx_L4:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n- __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n- __pyx_4 = __pyx_4 != 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n- Py_INCREF(__pyx_k114p);\n- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __Pyx_Raise(__pyx_2, 0, 0);\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n- goto __pyx_L5;\n- }\n- __pyx_L5:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_shape);\n- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n- __pyx_1 = 0;\n- __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n- __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_shape);\n- PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_1;\n- __pyx_1 = 0;\n- goto __pyx_L6;\n- }\n- __pyx_L6:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n- __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n- __pyx_5 = 0;\n- __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_v_final_shape);\n- __pyx_v_final_shape = __pyx_1;\n- __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n- __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n- __pyx_1 = 0;\n- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_final_shape);\n- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n- __pyx_3 = 0;\n- __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_v_x);\n- __pyx_v_x = __pyx_5;\n- __pyx_5 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_final_shape);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n- __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n- __pyx_1 = 0;\n- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n- __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n- PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n- __pyx_3 = 0;\n- __pyx_5 = 0;\n- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n- __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n- Py_INCREF(__pyx_n_svd);\n- PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n- __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_svd);\n- __pyx_v_svd = __pyx_5;\n- __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_cov);\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n- __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_u);\n- __pyx_v_u = __pyx_3;\n- __pyx_3 = 0;\n- __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_s);\n- __pyx_v_s = __pyx_5;\n- __pyx_5 = 0;\n- __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_DECREF(__pyx_v_v);\n- __pyx_v_v = __pyx_1;\n- __pyx_1 = 0;\n- if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_s);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n- Py_INCREF(__pyx_v_v);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n- __pyx_2 = 0;\n- __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_v_x);\n- __pyx_v_x = __pyx_1;\n- __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n- __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_mean);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n- __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_final_shape);\n- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_5); __pyx_5 = 0;\n- if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n- Py_INCREF(__pyx_v_x);\n- __pyx_r = __pyx_v_x;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- Py_XDECREF(__pyx_5);\n- __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_shape);\n- Py_DECREF(__pyx_v_final_shape);\n- Py_DECREF(__pyx_v_x);\n- Py_DECREF(__pyx_v_svd);\n- Py_DECREF(__pyx_v_u);\n- Py_DECREF(__pyx_v_s);\n- Py_DECREF(__pyx_v_v);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_mean);\n- Py_DECREF(__pyx_v_cov);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_zeros;\n-\n-static PyObject *__pyx_k117p;\n-\n-static char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- long __pyx_v_n;\n- PyObject *__pyx_v_pvals = 0;\n- PyObject *__pyx_v_size = 0;\n- long __pyx_v_d;\n- PyArrayObject *arrayObject_parr;\n- PyArrayObject *arrayObject_mnarr;\n- double (*__pyx_v_pix);\n- long (*__pyx_v_mnix);\n- long __pyx_v_i;\n- long __pyx_v_j;\n- long __pyx_v_dn;\n- double __pyx_v_Sum;\n- PyObject *__pyx_v_shape;\n- PyObject *__pyx_v_multin;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- long __pyx_4;\n- int __pyx_5;\n- static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n- __pyx_v_size = __pyx_k59;\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_pvals);\n- Py_INCREF(__pyx_v_size);\n- arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n- arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n- __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n- __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_pvals);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_v_d = __pyx_4;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n- __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n- Py_INCREF(((PyObject *)__pyx_1));\n- Py_DECREF(((PyObject *)arrayObject_parr));\n- arrayObject_parr = ((PyArrayObject *)__pyx_1);\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n- __pyx_v_pix = ((double (*))arrayObject_parr->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n- __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n- if (__pyx_5) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n- Py_INCREF(__pyx_k117p);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __Pyx_Raise(__pyx_1, 0, 0);\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n- goto __pyx_L2;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n- __pyx_5 = __pyx_v_size == Py_None;\n- if (__pyx_5) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n- __pyx_2 = 0;\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_3;\n- __pyx_3 = 0;\n- goto __pyx_L3;\n- }\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n- __pyx_5 = __pyx_3 == __pyx_1;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (__pyx_5) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n- __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n- __pyx_2 = 0;\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_3;\n- __pyx_3 = 0;\n- goto __pyx_L3;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n- __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n- __pyx_1 = 0;\n- __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_v_shape);\n- __pyx_v_shape = __pyx_3;\n- __pyx_3 = 0;\n- }\n- __pyx_L3:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_shape);\n- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n- PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n- __pyx_1 = 0;\n- __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_v_multin);\n- __pyx_v_multin = __pyx_1;\n- __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n- Py_INCREF(((PyObject *)__pyx_v_multin));\n- Py_DECREF(((PyObject *)arrayObject_mnarr));\n- arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n- __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n- __pyx_v_i = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n- while (1) {\n- __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n- if (!__pyx_5) break;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n- __pyx_v_Sum = 1.0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n- __pyx_v_dn = __pyx_v_n;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n- __pyx_4 = (__pyx_v_d - 1);\n- for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n- (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n- __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n- __pyx_5 = (__pyx_v_dn <= 0);\n- if (__pyx_5) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n- goto __pyx_L7;\n- goto __pyx_L8;\n- }\n- __pyx_L8:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n- __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n- }\n- __pyx_L7:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n- __pyx_5 = (__pyx_v_dn > 0);\n- if (__pyx_5) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n- (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n- goto __pyx_L9;\n- }\n- __pyx_L9:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n- __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n- }\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n- Py_INCREF(__pyx_v_multin);\n- __pyx_r = __pyx_v_multin;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(arrayObject_parr);\n- Py_DECREF(arrayObject_mnarr);\n- Py_DECREF(__pyx_v_shape);\n- Py_DECREF(__pyx_v_multin);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_pvals);\n- Py_DECREF(__pyx_v_size);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_x = 0;\n- long __pyx_v_i;\n- long __pyx_v_j;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- long __pyx_4;\n- int __pyx_5;\n- static char *__pyx_argnames[] = {\"x\",0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_x);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_v_i = __pyx_4;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n- while (1) {\n- __pyx_5 = (__pyx_v_i > 0);\n- if (!__pyx_5) break;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n- __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n- __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n- __pyx_v_i = (__pyx_v_i - 1);\n- }\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_x);\n- return __pyx_r;\n-}\n-\n-static PyObject *__pyx_n_arange;\n-\n-static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n-static char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\n-static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n- PyObject *__pyx_v_x = 0;\n- PyObject *__pyx_v_arr;\n- PyObject *__pyx_r;\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- PyObject *__pyx_3 = 0;\n- int __pyx_4;\n- static char *__pyx_argnames[] = {\"x\",0};\n- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n- Py_INCREF(__pyx_v_self);\n- Py_INCREF(__pyx_v_x);\n- __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n- __pyx_4 = __pyx_3 == __pyx_1;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (__pyx_4) {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n- __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_v_arr);\n- __pyx_v_arr = __pyx_2;\n- __pyx_2 = 0;\n- goto __pyx_L2;\n- }\n- /*else*/ {\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n- __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n- __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_x);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_v_arr);\n- __pyx_v_arr = __pyx_3;\n- __pyx_3 = 0;\n- }\n- __pyx_L2:;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n- Py_INCREF(__pyx_v_arr);\n- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- Py_DECREF(__pyx_3); __pyx_3 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n- Py_INCREF(__pyx_v_arr);\n- __pyx_r = __pyx_v_arr;\n- goto __pyx_L0;\n-\n- __pyx_r = Py_None; Py_INCREF(__pyx_r);\n- goto __pyx_L0;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- Py_XDECREF(__pyx_3);\n- __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n- __pyx_r = 0;\n- __pyx_L0:;\n- Py_DECREF(__pyx_v_arr);\n- Py_DECREF(__pyx_v_self);\n- Py_DECREF(__pyx_v_x);\n- return __pyx_r;\n-}\n-\n-static __Pyx_InternTabEntry __pyx_intern_tab[] = {\n- {&__pyx_n_ArgumentError, \"ArgumentError\"},\n- {&__pyx_n_Float64, \"Float64\"},\n- {&__pyx_n_Int, \"Int\"},\n- {&__pyx_n_MT19937, \"MT19937\"},\n- {&__pyx_n_ValueError, \"ValueError\"},\n- {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n- {&__pyx_n__rand, \"_rand\"},\n- {&__pyx_n__sp, \"_sp\"},\n- {&__pyx_n_add, \"add\"},\n- {&__pyx_n_append, \"append\"},\n- {&__pyx_n_arange, \"arange\"},\n- {&__pyx_n_array, \"array\"},\n- {&__pyx_n_beta, \"beta\"},\n- {&__pyx_n_binomial, \"binomial\"},\n- {&__pyx_n_bytes, \"bytes\"},\n- {&__pyx_n_chisquare, \"chisquare\"},\n- {&__pyx_n_empty, \"empty\"},\n- {&__pyx_n_exponential, \"exponential\"},\n- {&__pyx_n_f, \"f\"},\n- {&__pyx_n_gamma, \"gamma\"},\n- {&__pyx_n_geometric, \"geometric\"},\n- {&__pyx_n_get_state, \"get_state\"},\n- {&__pyx_n_gumbel, \"gumbel\"},\n- {&__pyx_n_hypergeometric, \"hypergeometric\"},\n- {&__pyx_n_int, \"int\"},\n- {&__pyx_n_isinstance, \"isinstance\"},\n- {&__pyx_n_laplace, \"laplace\"},\n- {&__pyx_n_len, \"len\"},\n- {&__pyx_n_list, \"list\"},\n- {&__pyx_n_logistic, \"logistic\"},\n- {&__pyx_n_lognormal, \"lognormal\"},\n- {&__pyx_n_logseries, \"logseries\"},\n- {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n- {&__pyx_n_multinomial, \"multinomial\"},\n- {&__pyx_n_multiply, \"multiply\"},\n- {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n- {&__pyx_n_negative_binomial, \"negative_binomial\"},\n- {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n- {&__pyx_n_noncentral_f, \"noncentral_f\"},\n- {&__pyx_n_normal, \"normal\"},\n- {&__pyx_n_numpy, \"numpy\"},\n- {&__pyx_n_pareto, \"pareto\"},\n- {&__pyx_n_permutation, \"permutation\"},\n- {&__pyx_n_poisson, \"poisson\"},\n- {&__pyx_n_power, \"power\"},\n- {&__pyx_n_rand, \"rand\"},\n- {&__pyx_n_randint, \"randint\"},\n- {&__pyx_n_randn, \"randn\"},\n- {&__pyx_n_random, \"random\"},\n- {&__pyx_n_random_integers, \"random_integers\"},\n- {&__pyx_n_random_sample, \"random_sample\"},\n- {&__pyx_n_rayleigh, \"rayleigh\"},\n- {&__pyx_n_reduce, \"reduce\"},\n- {&__pyx_n_seed, \"seed\"},\n- {&__pyx_n_set_state, \"set_state\"},\n- {&__pyx_n_shape, \"shape\"},\n- {&__pyx_n_shuffle, \"shuffle\"},\n- {&__pyx_n_size, \"size\"},\n- {&__pyx_n_sqrt, \"sqrt\"},\n- {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n- {&__pyx_n_standard_exponential, \"standard_exponential\"},\n- {&__pyx_n_standard_gamma, \"standard_gamma\"},\n- {&__pyx_n_standard_normal, \"standard_normal\"},\n- {&__pyx_n_standard_t, \"standard_t\"},\n- {&__pyx_n_svd, \"svd\"},\n- {&__pyx_n_triangular, \"triangular\"},\n- {&__pyx_n_tuple, \"tuple\"},\n- {&__pyx_n_type, \"type\"},\n- {&__pyx_n_uniform, \"uniform\"},\n- {&__pyx_n_vonmises, \"vonmises\"},\n- {&__pyx_n_wald, \"wald\"},\n- {&__pyx_n_weibull, \"weibull\"},\n- {&__pyx_n_zeros, \"zeros\"},\n- {&__pyx_n_zipf, \"zipf\"},\n- {0, 0}\n-};\n-\n-static __Pyx_StringTabEntry __pyx_string_tab[] = {\n- {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n- {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n- {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n- {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n- {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n- {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n- {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n- {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n- {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n- {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n- {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n- {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n- {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n- {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n- {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n- {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n- {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n- {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n- {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n- {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n- {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n- {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n- {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n- {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n- {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n- {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n- {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n- {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n- {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n- {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n- {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n- {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n- {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n- {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n- {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n- {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n- {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n- {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n- {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n- {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n- {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n- {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n- {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n- {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n- {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n- {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n- {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n- {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n- {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n- {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n- {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n- {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n- {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n- {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n- {0, 0, 0}\n-};\n-\n-static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n- PyObject *o = (*t->tp_alloc)(t, 0);\n- struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n- return o;\n-}\n-\n-static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n- {\n- PyObject *etype, *eval, *etb;\n- PyErr_Fetch(&etype, &eval, &etb);\n- ++o->ob_refcnt;\n- __pyx_f_6mtrand_11RandomState___dealloc__(o);\n- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n- --o->ob_refcnt;\n- PyErr_Restore(etype, eval, etb);\n- }\n- (*o->ob_type->tp_free)(o);\n-}\n-\n-static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n- return 0;\n-}\n-\n-static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n- return 0;\n-}\n-\n-static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n- {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n- {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n- {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n- {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n- {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n- {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n- {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n- {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n- {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n- {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n- {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n- {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n- {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n- {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n- {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n- {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n- {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n- {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n- {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n- {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n- {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n- {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n- {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n- {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n- {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n- {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n- {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n- {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n- {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n- {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n- {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n- {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n- {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n- {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n- {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n- {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n- {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n- {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n- {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n- {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n- {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n- {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n- {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n- {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n- {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n- {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n- {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n- {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n- {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n- {0, 0, 0, 0}\n-};\n-\n-static PyNumberMethods __pyx_tp_as_number_RandomState = {\n- 0, /*nb_add*/\n- 0, /*nb_subtract*/\n- 0, /*nb_multiply*/\n- 0, /*nb_divide*/\n- 0, /*nb_remainder*/\n- 0, /*nb_divmod*/\n- 0, /*nb_power*/\n- 0, /*nb_negative*/\n- 0, /*nb_positive*/\n- 0, /*nb_absolute*/\n- 0, /*nb_nonzero*/\n- 0, /*nb_invert*/\n- 0, /*nb_lshift*/\n- 0, /*nb_rshift*/\n- 0, /*nb_and*/\n- 0, /*nb_xor*/\n- 0, /*nb_or*/\n- 0, /*nb_coerce*/\n- 0, /*nb_int*/\n- 0, /*nb_long*/\n- 0, /*nb_float*/\n- 0, /*nb_oct*/\n- 0, /*nb_hex*/\n- 0, /*nb_inplace_add*/\n- 0, /*nb_inplace_subtract*/\n- 0, /*nb_inplace_multiply*/\n- 0, /*nb_inplace_divide*/\n- 0, /*nb_inplace_remainder*/\n- 0, /*nb_inplace_power*/\n- 0, /*nb_inplace_lshift*/\n- 0, /*nb_inplace_rshift*/\n- 0, /*nb_inplace_and*/\n- 0, /*nb_inplace_xor*/\n- 0, /*nb_inplace_or*/\n- 0, /*nb_floor_divide*/\n- 0, /*nb_true_divide*/\n- 0, /*nb_inplace_floor_divide*/\n- 0, /*nb_inplace_true_divide*/\n-};\n-\n-static PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n- 0, /*sq_length*/\n- 0, /*sq_concat*/\n- 0, /*sq_repeat*/\n- 0, /*sq_item*/\n- 0, /*sq_slice*/\n- 0, /*sq_ass_item*/\n- 0, /*sq_ass_slice*/\n- 0, /*sq_contains*/\n- 0, /*sq_inplace_concat*/\n- 0, /*sq_inplace_repeat*/\n-};\n-\n-static PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n- 0, /*mp_length*/\n- 0, /*mp_subscript*/\n- 0, /*mp_ass_subscript*/\n-};\n-\n-static PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n- 0, /*bf_getreadbuffer*/\n- 0, /*bf_getwritebuffer*/\n- 0, /*bf_getsegcount*/\n- 0, /*bf_getcharbuffer*/\n-};\n-\n-statichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n- PyObject_HEAD_INIT(0)\n- 0, /*ob_size*/\n- \"mtrand.RandomState\", /*tp_name*/\n- sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n- 0, /*tp_itemsize*/\n- __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n- 0, /*tp_print*/\n- 0, /*tp_getattr*/\n- 0, /*tp_setattr*/\n- 0, /*tp_compare*/\n- 0, /*tp_repr*/\n- &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n- &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n- &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n- 0, /*tp_hash*/\n- 0, /*tp_call*/\n- 0, /*tp_str*/\n- 0, /*tp_getattro*/\n- 0, /*tp_setattro*/\n- &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n- \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n- __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n- __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n- 0, /*tp_richcompare*/\n- 0, /*tp_weaklistoffset*/\n- 0, /*tp_iter*/\n- 0, /*tp_iternext*/\n- __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n- 0, /*tp_members*/\n- 0, /*tp_getset*/\n- 0, /*tp_base*/\n- 0, /*tp_dict*/\n- 0, /*tp_descr_get*/\n- 0, /*tp_descr_set*/\n- 0, /*tp_dictoffset*/\n- __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n- 0, /*tp_alloc*/\n- __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n- 0, /*tp_free*/\n- 0, /*tp_is_gc*/\n- 0, /*tp_bases*/\n- 0, /*tp_mro*/\n- 0, /*tp_cache*/\n- 0, /*tp_subclasses*/\n- 0, /*tp_weaklist*/\n-};\n-\n-static struct PyMethodDef __pyx_methods[] = {\n- {0, 0, 0, 0}\n-};\n-\n-DL_EXPORT(void) initmtrand(void); /*proto*/\n-DL_EXPORT(void) initmtrand(void) {\n- PyObject *__pyx_1 = 0;\n- PyObject *__pyx_2 = 0;\n- __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n- __pyx_b = PyImport_AddModule(\"__builtin__\");\n- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n- if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n- if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n- __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n- __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n- if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n- if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n- __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n- import_array();\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n- __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n- if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n- Py_INCREF(Py_None);\n- __pyx_k2 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n- Py_INCREF(Py_None);\n- __pyx_k3 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n- Py_INCREF(Py_None);\n- __pyx_k4 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n- Py_INCREF(Py_None);\n- __pyx_k5 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n- Py_INCREF(Py_None);\n- __pyx_k6 = Py_None;\n- Py_INCREF(Py_None);\n- __pyx_k7 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n- __pyx_k8 = 0.0;\n- __pyx_k9 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k10 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n- Py_INCREF(Py_None);\n- __pyx_k11 = Py_None;\n- Py_INCREF(Py_None);\n- __pyx_k12 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n- Py_INCREF(Py_None);\n- __pyx_k13 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n- __pyx_k14 = 0.0;\n- __pyx_k15 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k16 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n- Py_INCREF(Py_None);\n- __pyx_k17 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n- __pyx_k18 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k19 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n- Py_INCREF(Py_None);\n- __pyx_k20 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n- Py_INCREF(Py_None);\n- __pyx_k21 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n- __pyx_k22 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k23 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n- Py_INCREF(Py_None);\n- __pyx_k24 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n- Py_INCREF(Py_None);\n- __pyx_k25 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n- Py_INCREF(Py_None);\n- __pyx_k26 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n- Py_INCREF(Py_None);\n- __pyx_k27 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n- Py_INCREF(Py_None);\n- __pyx_k28 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n- Py_INCREF(Py_None);\n- __pyx_k29 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n- Py_INCREF(Py_None);\n- __pyx_k30 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n- Py_INCREF(Py_None);\n- __pyx_k31 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n- Py_INCREF(Py_None);\n- __pyx_k32 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n- Py_INCREF(Py_None);\n- __pyx_k33 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n- __pyx_k34 = 0.0;\n- __pyx_k35 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k36 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n- __pyx_k37 = 0.0;\n- __pyx_k38 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k39 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n- __pyx_k40 = 0.0;\n- __pyx_k41 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k42 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n- __pyx_k43 = 0.0;\n- __pyx_k44 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k45 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n- __pyx_k46 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k47 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n- Py_INCREF(Py_None);\n- __pyx_k48 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n- Py_INCREF(Py_None);\n- __pyx_k49 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n- Py_INCREF(Py_None);\n- __pyx_k50 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n- Py_INCREF(Py_None);\n- __pyx_k51 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n- __pyx_k52 = 1.0;\n- Py_INCREF(Py_None);\n- __pyx_k53 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n- Py_INCREF(Py_None);\n- __pyx_k54 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n- Py_INCREF(Py_None);\n- __pyx_k55 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n- Py_INCREF(Py_None);\n- __pyx_k56 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n- Py_INCREF(Py_None);\n- __pyx_k57 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n- Py_INCREF(Py_None);\n- __pyx_k58 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n- Py_INCREF(Py_None);\n- __pyx_k59 = Py_None;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n- __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n- __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n-\n- /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n- Py_DECREF(__pyx_1); __pyx_1 = 0;\n- if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n- Py_DECREF(__pyx_2); __pyx_2 = 0;\n- return;\n- __pyx_L1:;\n- Py_XDECREF(__pyx_1);\n- Py_XDECREF(__pyx_2);\n- __Pyx_AddTraceback(\"mtrand\");\n-}\n-\n-static char *__pyx_filenames[] = {\n- \"mtrand.pyx\",\n- \"numpy.pxi\",\n-};\n-statichere char **__pyx_f = __pyx_filenames;\n-\n-/* Runtime support code */\n-\n-static int __Pyx_GetStarArgs(\n- PyObject **args, \n- PyObject **kwds,\n- char *kwd_list[], \n- int nargs,\n- PyObject **args2, \n- PyObject **kwds2)\n-{\n- PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n- \n- if (args2)\n- *args2 = 0;\n- if (kwds2)\n- *kwds2 = 0;\n- \n- if (args2) {\n- args1 = PyTuple_GetSlice(*args, 0, nargs);\n- if (!args1)\n- goto bad;\n- *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n- if (!*args2)\n- goto bad;\n- }\n- else {\n- args1 = *args;\n- Py_INCREF(args1);\n- }\n- \n- if (kwds2) {\n- if (*kwds) {\n- char **p;\n- kwds1 = PyDict_New();\n- if (!kwds)\n- goto bad;\n- *kwds2 = PyDict_Copy(*kwds);\n- if (!*kwds2)\n- goto bad;\n- for (p = kwd_list; *p; p++) {\n- x = PyDict_GetItemString(*kwds, *p);\n- if (x) {\n- if (PyDict_SetItemString(kwds1, *p, x) < 0)\n- goto bad;\n- if (PyDict_DelItemString(*kwds2, *p) < 0)\n- goto bad;\n- }\n- }\n- }\n- else {\n- *kwds2 = PyDict_New();\n- if (!*kwds2)\n- goto bad;\n- }\n- }\n- else {\n- kwds1 = *kwds;\n- Py_XINCREF(kwds1);\n- }\n- \n- *args = args1;\n- *kwds = kwds1;\n- return 0;\n-bad:\n- Py_XDECREF(args1);\n- Py_XDECREF(kwds1);\n- Py_XDECREF(*args2);\n- Py_XDECREF(*kwds2);\n- return -1;\n-}\n-\n-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n- PyObject *__import__ = 0;\n- PyObject *empty_list = 0;\n- PyObject *module = 0;\n- PyObject *global_dict = 0;\n- PyObject *empty_dict = 0;\n- PyObject *list;\n- __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n- if (!__import__)\n- goto bad;\n- if (from_list)\n- list = from_list;\n- else {\n- empty_list = PyList_New(0);\n- if (!empty_list)\n- goto bad;\n- list = empty_list;\n- }\n- global_dict = PyModule_GetDict(__pyx_m);\n- if (!global_dict)\n- goto bad;\n- empty_dict = PyDict_New();\n- if (!empty_dict)\n- goto bad;\n- module = PyObject_CallFunction(__import__, \"OOOO\",\n- name, global_dict, empty_dict, list);\n-bad:\n- Py_XDECREF(empty_list);\n- Py_XDECREF(__import__);\n- Py_XDECREF(empty_dict);\n- return module;\n-}\n-\n-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n- PyObject *result;\n- result = PyObject_GetAttr(dict, name);\n- if (!result)\n- PyErr_SetObject(PyExc_NameError, name);\n- return result;\n-}\n-\n-static void __Pyx_WriteUnraisable(char *name) {\n- PyObject *old_exc, *old_val, *old_tb;\n- PyObject *ctx;\n- PyErr_Fetch(&old_exc, &old_val, &old_tb);\n- ctx = PyString_FromString(name);\n- PyErr_Restore(old_exc, old_val, old_tb);\n- if (!ctx)\n- ctx = Py_None;\n- PyErr_WriteUnraisable(ctx);\n-}\n-\n-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n- Py_XINCREF(type);\n- Py_XINCREF(value);\n- Py_XINCREF(tb);\n- /* First, check the traceback argument, replacing None with NULL. */\n- if (tb == Py_None) {\n- Py_DECREF(tb);\n- tb = 0;\n- }\n- else if (tb != NULL && !PyTraceBack_Check(tb)) {\n- PyErr_SetString(PyExc_TypeError,\n- \"raise: arg 3 must be a traceback or None\");\n- goto raise_error;\n- }\n- /* Next, replace a missing value with None */\n- if (value == NULL) {\n- value = Py_None;\n- Py_INCREF(value);\n- }\n- /* Next, repeatedly, replace a tuple exception with its first item */\n- while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n- PyObject *tmp = type;\n- type = PyTuple_GET_ITEM(type, 0);\n- Py_INCREF(type);\n- Py_DECREF(tmp);\n- }\n- if (PyString_Check(type))\n- ;\n- else if (PyClass_Check(type))\n- ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n- else if (PyInstance_Check(type)) {\n- /* Raising an instance. The value should be a dummy. */\n- if (value != Py_None) {\n- PyErr_SetString(PyExc_TypeError,\n- \"instance exception may not have a separate value\");\n- goto raise_error;\n- }\n- else {\n- /* Normalize to raise , */\n- Py_DECREF(value);\n- value = type;\n- type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n- Py_INCREF(type);\n- }\n- }\n- else {\n- /* Not something you can raise. You get an exception\n- anyway, just not what you specified :-) */\n- PyErr_Format(PyExc_TypeError,\n- \"exceptions must be strings, classes, or \"\n- \"instances, not %s\", type->ob_type->tp_name);\n- goto raise_error;\n- }\n- PyErr_Restore(type, value, tb);\n- return;\n-raise_error:\n- Py_XDECREF(value);\n- Py_XDECREF(type);\n- Py_XDECREF(tb);\n- return;\n-}\n-\n-static void __Pyx_UnpackError(void) {\n- PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n-}\n-\n-static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n- PyObject *item = PySequence_GetItem(seq, i);\n- if (!item) {\n- if (PyErr_ExceptionMatches(PyExc_IndexError))\n- __Pyx_UnpackError();\n- }\n- return item;\n-}\n-\n-static int __Pyx_EndUnpack(PyObject *seq, int i) {\n- PyObject *item = PySequence_GetItem(seq, i);\n- if (item) {\n- Py_DECREF(item);\n- __Pyx_UnpackError();\n- return -1;\n- }\n- PyErr_Clear();\n- return 0;\n-}\n-\n-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n- while (t->p) {\n- *t->p = PyString_InternFromString(t->s);\n- if (!*t->p)\n- return -1;\n- ++t;\n- }\n- return 0;\n-}\n-\n-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n- while (t->p) {\n- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n- if (!*t->p)\n- return -1;\n- ++t;\n- }\n- return 0;\n-}\n-\n-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n- long size) \n-{\n- PyObject *py_module_name = 0;\n- PyObject *py_class_name = 0;\n- PyObject *py_name_list = 0;\n- PyObject *py_module = 0;\n- PyObject *result = 0;\n- \n- py_module_name = PyString_FromString(module_name);\n- if (!py_module_name)\n- goto bad;\n- py_class_name = PyString_FromString(class_name);\n- if (!py_class_name)\n- goto bad;\n- py_name_list = PyList_New(1);\n- if (!py_name_list)\n- goto bad;\n- Py_INCREF(py_class_name);\n- if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n- goto bad;\n- py_module = __Pyx_Import(py_module_name, py_name_list);\n- if (!py_module)\n- goto bad;\n- result = PyObject_GetAttr(py_module, py_class_name);\n- if (!result)\n- goto bad;\n- if (!PyType_Check(result)) {\n- PyErr_Format(PyExc_TypeError, \n- \"%s.%s is not a type object\",\n- module_name, class_name);\n- goto bad;\n- }\n- if (((PyTypeObject *)result)->tp_basicsize != size) {\n- PyErr_Format(PyExc_ValueError, \n- \"%s.%s does not appear to be the correct type object\",\n- module_name, class_name);\n- goto bad;\n- }\n- goto done;\n-bad:\n- Py_XDECREF(result);\n- result = 0;\n-done:\n- Py_XDECREF(py_module_name);\n- Py_XDECREF(py_class_name);\n- Py_XDECREF(py_name_list);\n- return (PyTypeObject *)result;\n-}\n-\n-#include \"compile.h\"\n-#include \"frameobject.h\"\n-#include \"traceback.h\"\n-\n-static void __Pyx_AddTraceback(char *funcname) {\n- PyObject *py_srcfile = 0;\n- PyObject *py_funcname = 0;\n- PyObject *py_globals = 0;\n- PyObject *empty_tuple = 0;\n- PyObject *empty_string = 0;\n- PyCodeObject *py_code = 0;\n- PyFrameObject *py_frame = 0;\n- \n- py_srcfile = PyString_FromString(__pyx_filename);\n- if (!py_srcfile) goto bad;\n- py_funcname = PyString_FromString(funcname);\n- if (!py_funcname) goto bad;\n- py_globals = PyModule_GetDict(__pyx_m);\n- if (!py_globals) goto bad;\n- empty_tuple = PyTuple_New(0);\n- if (!empty_tuple) goto bad;\n- empty_string = PyString_FromString(\"\");\n- if (!empty_string) goto bad;\n- py_code = PyCode_New(\n- 0, /*int argcount,*/\n- 0, /*int nlocals,*/\n- 0, /*int stacksize,*/\n- 0, /*int flags,*/\n- empty_string, /*PyObject *code,*/\n- empty_tuple, /*PyObject *consts,*/\n- empty_tuple, /*PyObject *names,*/\n- empty_tuple, /*PyObject *varnames,*/\n- empty_tuple, /*PyObject *freevars,*/\n- empty_tuple, /*PyObject *cellvars,*/\n- py_srcfile, /*PyObject *filename,*/\n- py_funcname, /*PyObject *name,*/\n- __pyx_lineno, /*int firstlineno,*/\n- empty_string /*PyObject *lnotab*/\n- );\n- if (!py_code) goto bad;\n- py_frame = PyFrame_New(\n- PyThreadState_Get(), /*PyThreadState *tstate,*/\n- py_code, /*PyCodeObject *code,*/\n- py_globals, /*PyObject *globals,*/\n- 0 /*PyObject *locals*/\n- );\n- if (!py_frame) goto bad;\n- py_frame->f_lineno = __pyx_lineno;\n- PyTraceBack_Here(py_frame);\n-bad:\n- Py_XDECREF(py_srcfile);\n- Py_XDECREF(py_funcname);\n- Py_XDECREF(empty_tuple);\n- Py_XDECREF(empty_string);\n- Py_XDECREF(py_code);\n- Py_XDECREF(py_frame);\n-}\n", + "added_lines": 0, + "deleted_lines": 5990, + "source_code": null, + "source_code_before": "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 12:43:35 2006 */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n#ifndef PY_LONG_LONG\n #define PY_LONG_LONG LONG_LONG\n#endif\n#include \"string.h\"\n#include \"math.h\"\n#include \"numpy/arrayobject.h\"\n#include \"randomkit.h\"\n#include \"distributions.h\"\n#include \"initarray.h\"\n\n\ntypedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\ntypedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\nstatic PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\nstatic int __Pyx_EndUnpack(PyObject *, int); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\nstatic void __Pyx_WriteUnraisable(char *name); /*proto*/\nstatic void __Pyx_AddTraceback(char *funcname); /*proto*/\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n\nstatic PyObject *__pyx_m;\nstatic PyObject *__pyx_b;\nstatic int __pyx_lineno;\nstatic char *__pyx_filename;\nstaticforward char **__pyx_f;\n\n/* Declarations from mtrand */\n\nstaticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n\nstruct __pyx_obj_6mtrand_RandomState {\n PyObject_HEAD\n rk_state (*internal_state);\n};\n\nstatic PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\nstatic PyObject *__pyx_k2;\nstatic PyObject *__pyx_k3;\nstatic PyObject *__pyx_k4;\nstatic PyObject *__pyx_k5;\nstatic PyObject *__pyx_k6;\nstatic PyObject *__pyx_k7;\nstatic double __pyx_k8;\nstatic double __pyx_k9;\nstatic PyObject *__pyx_k10;\nstatic PyObject *__pyx_k11;\nstatic PyObject *__pyx_k12;\nstatic PyObject *__pyx_k13;\nstatic double __pyx_k14;\nstatic double __pyx_k15;\nstatic PyObject *__pyx_k16;\nstatic PyObject *__pyx_k17;\nstatic double __pyx_k18;\nstatic PyObject *__pyx_k19;\nstatic PyObject *__pyx_k20;\nstatic PyObject *__pyx_k21;\nstatic double __pyx_k22;\nstatic PyObject *__pyx_k23;\nstatic PyObject *__pyx_k24;\nstatic PyObject *__pyx_k25;\nstatic PyObject *__pyx_k26;\nstatic PyObject *__pyx_k27;\nstatic PyObject *__pyx_k28;\nstatic PyObject *__pyx_k29;\nstatic PyObject *__pyx_k30;\nstatic PyObject *__pyx_k31;\nstatic PyObject *__pyx_k32;\nstatic PyObject *__pyx_k33;\nstatic double __pyx_k34;\nstatic double __pyx_k35;\nstatic PyObject *__pyx_k36;\nstatic double __pyx_k37;\nstatic double __pyx_k38;\nstatic PyObject *__pyx_k39;\nstatic double __pyx_k40;\nstatic double __pyx_k41;\nstatic PyObject *__pyx_k42;\nstatic double __pyx_k43;\nstatic double __pyx_k44;\nstatic PyObject *__pyx_k45;\nstatic double __pyx_k46;\nstatic PyObject *__pyx_k47;\nstatic PyObject *__pyx_k48;\nstatic PyObject *__pyx_k49;\nstatic PyObject *__pyx_k50;\nstatic PyObject *__pyx_k51;\nstatic double __pyx_k52;\nstatic PyObject *__pyx_k53;\nstatic PyObject *__pyx_k54;\nstatic PyObject *__pyx_k55;\nstatic PyObject *__pyx_k56;\nstatic PyObject *__pyx_k57;\nstatic PyObject *__pyx_k58;\nstatic PyObject *__pyx_k59;\nstatic PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n\n/* Implementation of mtrand */\n\n\nstatic PyObject *__pyx_n__sp;\nstatic PyObject *__pyx_n__rand;\nstatic PyObject *__pyx_n_seed;\nstatic PyObject *__pyx_n_get_state;\nstatic PyObject *__pyx_n_set_state;\nstatic PyObject *__pyx_n_random_sample;\nstatic PyObject *__pyx_n_randint;\nstatic PyObject *__pyx_n_bytes;\nstatic PyObject *__pyx_n_uniform;\nstatic PyObject *__pyx_n_rand;\nstatic PyObject *__pyx_n_randn;\nstatic PyObject *__pyx_n_random_integers;\nstatic PyObject *__pyx_n_standard_normal;\nstatic PyObject *__pyx_n_normal;\nstatic PyObject *__pyx_n_beta;\nstatic PyObject *__pyx_n_exponential;\nstatic PyObject *__pyx_n_standard_exponential;\nstatic PyObject *__pyx_n_standard_gamma;\nstatic PyObject *__pyx_n_gamma;\nstatic PyObject *__pyx_n_f;\nstatic PyObject *__pyx_n_noncentral_f;\nstatic PyObject *__pyx_n_chisquare;\nstatic PyObject *__pyx_n_noncentral_chisquare;\nstatic PyObject *__pyx_n_standard_cauchy;\nstatic PyObject *__pyx_n_standard_t;\nstatic PyObject *__pyx_n_vonmises;\nstatic PyObject *__pyx_n_pareto;\nstatic PyObject *__pyx_n_weibull;\nstatic PyObject *__pyx_n_power;\nstatic PyObject *__pyx_n_laplace;\nstatic PyObject *__pyx_n_gumbel;\nstatic PyObject *__pyx_n_logistic;\nstatic PyObject *__pyx_n_lognormal;\nstatic PyObject *__pyx_n_rayleigh;\nstatic PyObject *__pyx_n_wald;\nstatic PyObject *__pyx_n_triangular;\nstatic PyObject *__pyx_n_binomial;\nstatic PyObject *__pyx_n_negative_binomial;\nstatic PyObject *__pyx_n_poisson;\nstatic PyObject *__pyx_n_zipf;\nstatic PyObject *__pyx_n_geometric;\nstatic PyObject *__pyx_n_hypergeometric;\nstatic PyObject *__pyx_n_logseries;\nstatic PyObject *__pyx_n_multivariate_normal;\nstatic PyObject *__pyx_n_multinomial;\nstatic PyObject *__pyx_n_shuffle;\nstatic PyObject *__pyx_n_permutation;\nstatic PyObject *__pyx_n_numpy;\n\nstatic PyObject *__pyx_n_empty;\nstatic PyObject *__pyx_n_Float64;\n\nstatic PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont1_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont2_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont3_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_Int;\n\nstatic PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.disc0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnp_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discd_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n double __pyx_v_c;\n double __pyx_v_y;\n double __pyx_v_t;\n double __pyx_v_sum;\n long __pyx_v_i;\n double __pyx_r;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n __pyx_v_sum = (__pyx_v_darr[0]);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n __pyx_v_c = 0.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n __pyx_v_sum = __pyx_v_t;\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n __pyx_r = __pyx_v_sum;\n goto __pyx_L0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n __pyx_L0:;\n return __pyx_r;\n}\n\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n int __pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k2;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n __pyx_r = -1;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n int __pyx_1;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n goto __pyx_L0;\n __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n}\n\nstatic PyObject *__pyx_n_type;\nstatic PyObject *__pyx_n_int;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n rk_error __pyx_v_errcode;\n PyArrayObject *arrayObject_obj;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n unsigned long __pyx_5;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k3;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n __pyx_1 = __pyx_v_seed == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_1 = __pyx_4 == __pyx_2;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_3));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_3);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_MT19937;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyArrayObject *arrayObject_state;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_1 = 0;\n __pyx_4 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_state));\n arrayObject_state = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n Py_INCREF(__pyx_n_MT19937);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n Py_INCREF(((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n __pyx_4 = 0;\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_state);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_ValueError;\n\nstatic PyObject *__pyx_k62p;\nstatic PyObject *__pyx_k63p;\n\nstatic char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\nstatic char (__pyx_k63[]) = \"state must be 624 longs\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyArrayObject *arrayObject_obj;\n int __pyx_v_pos;\n PyObject *__pyx_v_algorithm_name;\n PyObject *__pyx_v_key;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n int __pyx_3;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_algorithm_name);\n __pyx_v_algorithm_name = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n __pyx_3 = __pyx_3 != 0;\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_INCREF(__pyx_k62p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_v_key);\n __pyx_v_key = __pyx_2;\n __pyx_2 = 0;\n __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_v_pos = __pyx_3;\n if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_INCREF(__pyx_k63p);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_algorithm_name);\n Py_DECREF(__pyx_v_key);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_INCREF(__pyx_v_state);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_random;\nstatic PyObject *__pyx_n___RandomState_ctor;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n __pyx_1 = 0;\n __pyx_2 = 0;\n __pyx_5 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k4;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k5;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k64p;\n\nstatic char (__pyx_k64[]) = \"low >= high\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_lo;\n long __pyx_v_hi;\n long __pyx_v_diff;\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n long __pyx_2;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k6;\n __pyx_v_size = __pyx_k7;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n __pyx_v_lo = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n __pyx_v_lo = __pyx_2;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n __pyx_1 = (__pyx_v_diff < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_INCREF(__pyx_k64p);\n PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __Pyx_Raise(__pyx_5, 0, 0);\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n goto __pyx_L4;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L4:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n unsigned int __pyx_v_length;\n void (*__pyx_v_bytes);\n PyObject *__pyx_v_bytestring;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"length\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n Py_INCREF(__pyx_v_self);\n __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n Py_DECREF(__pyx_v_bytestring);\n __pyx_v_bytestring = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n PyMem_Free(__pyx_v_bytes);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n Py_INCREF(__pyx_v_bytestring);\n __pyx_r = __pyx_v_bytestring;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_bytestring);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_low;\n double __pyx_v_high;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_low = __pyx_k8;\n __pyx_v_high = __pyx_k9;\n __pyx_v_size = __pyx_k10;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_len;\nstatic PyObject *__pyx_n_size;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_r = __pyx_5;\n __pyx_5 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k11;\n __pyx_v_size = __pyx_k12;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n Py_INCREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n __pyx_v_high = __pyx_v_low;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n Py_DECREF(__pyx_v_low);\n __pyx_v_low = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_INCREF(__pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_4;\n __pyx_4 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k13;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k66p;\n\nstatic char (__pyx_k66[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k14;\n __pyx_v_scale = __pyx_k15;\n __pyx_v_size = __pyx_k16;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_INCREF(__pyx_k66p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k67p;\nstatic PyObject *__pyx_k68p;\n\nstatic char (__pyx_k67[]) = \"a <= 0\";\nstatic char (__pyx_k68[]) = \"b <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n double __pyx_v_b;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n __pyx_v_size = __pyx_k17;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_INCREF(__pyx_k67p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_b <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_INCREF(__pyx_k68p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k69p;\n\nstatic char (__pyx_k69[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k18;\n __pyx_v_size = __pyx_k19;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_INCREF(__pyx_k69p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k20;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k70p;\n\nstatic char (__pyx_k70[]) = \"shape <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n __pyx_v_size = __pyx_k21;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_INCREF(__pyx_k70p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k71p;\nstatic PyObject *__pyx_k72p;\n\nstatic char (__pyx_k71[]) = \"shape <= 0\";\nstatic char (__pyx_k72[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k22;\n __pyx_v_size = __pyx_k23;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_INCREF(__pyx_k71p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_INCREF(__pyx_k72p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k73p;\nstatic PyObject *__pyx_k74p;\n\nstatic char (__pyx_k73[]) = \"dfnum <= 0\";\nstatic char (__pyx_k74[]) = \"dfden <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n __pyx_v_size = __pyx_k24;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n __pyx_1 = (__pyx_v_dfnum <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_INCREF(__pyx_k73p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_INCREF(__pyx_k74p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k75p;\nstatic PyObject *__pyx_k76p;\nstatic PyObject *__pyx_k77p;\n\nstatic char (__pyx_k75[]) = \"dfnum <= 1\";\nstatic char (__pyx_k76[]) = \"dfden <= 0\";\nstatic char (__pyx_k77[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k25;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n __pyx_1 = (__pyx_v_dfnum <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_INCREF(__pyx_k75p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_INCREF(__pyx_k76p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_INCREF(__pyx_k77p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k78p;\n\nstatic char (__pyx_k78[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k26;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_INCREF(__pyx_k78p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k79p;\nstatic PyObject *__pyx_k80p;\n\nstatic char (__pyx_k79[]) = \"df <= 1\";\nstatic char (__pyx_k80[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k27;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n __pyx_1 = (__pyx_v_df <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_INCREF(__pyx_k79p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_INCREF(__pyx_k80p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k28;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k81p;\n\nstatic char (__pyx_k81[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k29;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_INCREF(__pyx_k81p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k82p;\n\nstatic char (__pyx_k82[]) = \"kappa < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mu;\n double __pyx_v_kappa;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n __pyx_v_size = __pyx_k30;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n __pyx_1 = (__pyx_v_kappa < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_INCREF(__pyx_k82p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k83p;\n\nstatic char (__pyx_k83[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k31;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_INCREF(__pyx_k83p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k84p;\n\nstatic char (__pyx_k84[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k32;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_INCREF(__pyx_k84p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k85p;\n\nstatic char (__pyx_k85[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k33;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_INCREF(__pyx_k85p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k86p;\n\nstatic char (__pyx_k86[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k34;\n __pyx_v_scale = __pyx_k35;\n __pyx_v_size = __pyx_k36;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_INCREF(__pyx_k86p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k87p;\n\nstatic char (__pyx_k87[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k37;\n __pyx_v_scale = __pyx_k38;\n __pyx_v_size = __pyx_k39;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_INCREF(__pyx_k87p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k88p;\n\nstatic char (__pyx_k88[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k40;\n __pyx_v_scale = __pyx_k41;\n __pyx_v_size = __pyx_k42;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_INCREF(__pyx_k88p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k89p;\n\nstatic char (__pyx_k89[]) = \"sigma <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_sigma;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n __pyx_v_mean = __pyx_k43;\n __pyx_v_sigma = __pyx_k44;\n __pyx_v_size = __pyx_k45;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n __pyx_1 = (__pyx_v_sigma <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_INCREF(__pyx_k89p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k90p;\n\nstatic char (__pyx_k90[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k46;\n __pyx_v_size = __pyx_k47;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_INCREF(__pyx_k90p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k91p;\nstatic PyObject *__pyx_k92p;\n\nstatic char (__pyx_k91[]) = \"mean <= 0.0\";\nstatic char (__pyx_k92[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n __pyx_v_size = __pyx_k48;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n __pyx_1 = (__pyx_v_mean <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_INCREF(__pyx_k91p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_INCREF(__pyx_k92p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k93p;\nstatic PyObject *__pyx_k94p;\nstatic PyObject *__pyx_k95p;\n\nstatic char (__pyx_k93[]) = \"left > mode\";\nstatic char (__pyx_k94[]) = \"mode > right\";\nstatic char (__pyx_k95[]) = \"left == right\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_left;\n double __pyx_v_mode;\n double __pyx_v_right;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n __pyx_v_size = __pyx_k49;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_INCREF(__pyx_k93p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_INCREF(__pyx_k94p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_left == __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_INCREF(__pyx_k95p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k96p;\nstatic PyObject *__pyx_k97p;\nstatic PyObject *__pyx_k98p;\n\nstatic char (__pyx_k96[]) = \"n <= 0\";\nstatic char (__pyx_k97[]) = \"p < 0\";\nstatic char (__pyx_k98[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k50;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_INCREF(__pyx_k96p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_INCREF(__pyx_k97p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_INCREF(__pyx_k98p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k99p;\nstatic PyObject *__pyx_k100p;\nstatic PyObject *__pyx_k101p;\n\nstatic char (__pyx_k99[]) = \"n <= 0\";\nstatic char (__pyx_k100[]) = \"p < 0\";\nstatic char (__pyx_k101[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k51;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_INCREF(__pyx_k99p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_INCREF(__pyx_k100p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_INCREF(__pyx_k101p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k102p;\n\nstatic char (__pyx_k102[]) = \"lam <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_lam;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n __pyx_v_lam = __pyx_k52;\n __pyx_v_size = __pyx_k53;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n __pyx_1 = (__pyx_v_lam <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_INCREF(__pyx_k102p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k103p;\n\nstatic char (__pyx_k103[]) = \"a <= 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k54;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n __pyx_1 = (__pyx_v_a <= 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_INCREF(__pyx_k103p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k104p;\nstatic PyObject *__pyx_k105p;\n\nstatic char (__pyx_k104[]) = \"p < 0.0\";\nstatic char (__pyx_k105[]) = \"p > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k55;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n __pyx_1 = (__pyx_v_p < 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_INCREF(__pyx_k104p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_INCREF(__pyx_k105p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k106p;\nstatic PyObject *__pyx_k107p;\nstatic PyObject *__pyx_k108p;\nstatic PyObject *__pyx_k109p;\n\nstatic char (__pyx_k106[]) = \"ngood < 1\";\nstatic char (__pyx_k107[]) = \"nbad < 1\";\nstatic char (__pyx_k108[]) = \"ngood + nbad < nsample\";\nstatic char (__pyx_k109[]) = \"nsample < 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_ngood;\n long __pyx_v_nbad;\n long __pyx_v_nsample;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n __pyx_v_size = __pyx_k56;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n __pyx_1 = (__pyx_v_ngood < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_INCREF(__pyx_k106p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nbad < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_INCREF(__pyx_k107p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_INCREF(__pyx_k108p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nsample < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_INCREF(__pyx_k109p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k110p;\nstatic PyObject *__pyx_k111p;\n\nstatic char (__pyx_k110[]) = \"p < 0\";\nstatic char (__pyx_k111[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k57;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_INCREF(__pyx_k110p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_INCREF(__pyx_k111p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_array;\nstatic PyObject *__pyx_n_shape;\nstatic PyObject *__pyx_n_ArgumentError;\nstatic PyObject *__pyx_n_isinstance;\nstatic PyObject *__pyx_n_list;\nstatic PyObject *__pyx_n_append;\nstatic PyObject *__pyx_n_multiply;\nstatic PyObject *__pyx_n_reduce;\nstatic PyObject *__pyx_n_svd;\nstatic PyObject *__pyx_n_matrixmultiply;\nstatic PyObject *__pyx_n_sqrt;\nstatic PyObject *__pyx_n_add;\nstatic PyObject *__pyx_n_tuple;\n\nstatic PyObject *__pyx_k112p;\nstatic PyObject *__pyx_k113p;\nstatic PyObject *__pyx_k114p;\nstatic PyObject *__pyx_k115p;\n\nstatic char (__pyx_k112[]) = \"mean must be 1 dimensional\";\nstatic char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\nstatic char (__pyx_k114[]) = \"mean and cov must have same length\";\nstatic char (__pyx_k115[]) = \"numpy.corelinalg\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_mean = 0;\n PyObject *__pyx_v_cov = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_final_shape;\n PyObject *__pyx_v_x;\n PyObject *__pyx_v_svd;\n PyObject *__pyx_v_u;\n PyObject *__pyx_v_s;\n PyObject *__pyx_v_v;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n __pyx_v_size = __pyx_k58;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_mean);\n Py_INCREF(__pyx_v_cov);\n Py_INCREF(__pyx_v_size);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_mean);\n __pyx_v_mean = __pyx_3;\n __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_cov);\n __pyx_v_cov = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n __pyx_4 = __pyx_v_size == Py_None;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n Py_INCREF(__pyx_v_size);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_v_size;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_INCREF(__pyx_k112p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_3, 0, 0);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (!__pyx_4) {\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n }\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_INCREF(__pyx_k113p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n goto __pyx_L4;\n }\n __pyx_L4:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_INCREF(__pyx_k114p);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __Pyx_Raise(__pyx_2, 0, 0);\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n goto __pyx_L5;\n }\n __pyx_L5:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L6;\n }\n __pyx_L6:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n __pyx_5 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_final_shape);\n __pyx_v_final_shape = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n __pyx_3 = 0;\n __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_5;\n __pyx_5 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n __pyx_3 = 0;\n __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_INCREF(__pyx_n_svd);\n PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_v_svd);\n __pyx_v_svd = __pyx_5;\n __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_u);\n __pyx_v_u = __pyx_3;\n __pyx_3 = 0;\n __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_s);\n __pyx_v_s = __pyx_5;\n __pyx_5 = 0;\n __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_v);\n __pyx_v_v = __pyx_1;\n __pyx_1 = 0;\n if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_INCREF(__pyx_v_s);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n Py_INCREF(__pyx_v_v);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n __pyx_2 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n Py_INCREF(__pyx_v_x);\n __pyx_r = __pyx_v_x;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_final_shape);\n Py_DECREF(__pyx_v_x);\n Py_DECREF(__pyx_v_svd);\n Py_DECREF(__pyx_v_u);\n Py_DECREF(__pyx_v_s);\n Py_DECREF(__pyx_v_v);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_mean);\n Py_DECREF(__pyx_v_cov);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_zeros;\n\nstatic PyObject *__pyx_k117p;\n\nstatic char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n PyObject *__pyx_v_pvals = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_d;\n PyArrayObject *arrayObject_parr;\n PyArrayObject *arrayObject_mnarr;\n double (*__pyx_v_pix);\n long (*__pyx_v_mnix);\n long __pyx_v_i;\n long __pyx_v_j;\n long __pyx_v_dn;\n double __pyx_v_Sum;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_multin;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n __pyx_v_size = __pyx_k59;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_pvals);\n Py_INCREF(__pyx_v_size);\n arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_INCREF(__pyx_v_pvals);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_v_d = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_parr));\n arrayObject_parr = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_INCREF(__pyx_k117p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n __pyx_5 = __pyx_v_size == Py_None;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_5 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_multin);\n __pyx_v_multin = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n Py_INCREF(((PyObject *)__pyx_v_multin));\n Py_DECREF(((PyObject *)arrayObject_mnarr));\n arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n __pyx_v_i = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n while (1) {\n __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n __pyx_v_Sum = 1.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n __pyx_v_dn = __pyx_v_n;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n __pyx_4 = (__pyx_v_d - 1);\n for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n __pyx_5 = (__pyx_v_dn <= 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n goto __pyx_L7;\n goto __pyx_L8;\n }\n __pyx_L8:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n }\n __pyx_L7:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n __pyx_5 = (__pyx_v_dn > 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n goto __pyx_L9;\n }\n __pyx_L9:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n Py_INCREF(__pyx_v_multin);\n __pyx_r = __pyx_v_multin;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_parr);\n Py_DECREF(arrayObject_mnarr);\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_multin);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_pvals);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n long __pyx_v_i;\n long __pyx_v_j;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_v_i = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n while (1) {\n __pyx_5 = (__pyx_v_i > 0);\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n __pyx_v_i = (__pyx_v_i - 1);\n }\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_arange;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n PyObject *__pyx_v_arr;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_4 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_INCREF(__pyx_v_arr);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n Py_INCREF(__pyx_v_arr);\n __pyx_r = __pyx_v_arr;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_arr);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic __Pyx_InternTabEntry __pyx_intern_tab[] = {\n {&__pyx_n_ArgumentError, \"ArgumentError\"},\n {&__pyx_n_Float64, \"Float64\"},\n {&__pyx_n_Int, \"Int\"},\n {&__pyx_n_MT19937, \"MT19937\"},\n {&__pyx_n_ValueError, \"ValueError\"},\n {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n {&__pyx_n__rand, \"_rand\"},\n {&__pyx_n__sp, \"_sp\"},\n {&__pyx_n_add, \"add\"},\n {&__pyx_n_append, \"append\"},\n {&__pyx_n_arange, \"arange\"},\n {&__pyx_n_array, \"array\"},\n {&__pyx_n_beta, \"beta\"},\n {&__pyx_n_binomial, \"binomial\"},\n {&__pyx_n_bytes, \"bytes\"},\n {&__pyx_n_chisquare, \"chisquare\"},\n {&__pyx_n_empty, \"empty\"},\n {&__pyx_n_exponential, \"exponential\"},\n {&__pyx_n_f, \"f\"},\n {&__pyx_n_gamma, \"gamma\"},\n {&__pyx_n_geometric, \"geometric\"},\n {&__pyx_n_get_state, \"get_state\"},\n {&__pyx_n_gumbel, \"gumbel\"},\n {&__pyx_n_hypergeometric, \"hypergeometric\"},\n {&__pyx_n_int, \"int\"},\n {&__pyx_n_isinstance, \"isinstance\"},\n {&__pyx_n_laplace, \"laplace\"},\n {&__pyx_n_len, \"len\"},\n {&__pyx_n_list, \"list\"},\n {&__pyx_n_logistic, \"logistic\"},\n {&__pyx_n_lognormal, \"lognormal\"},\n {&__pyx_n_logseries, \"logseries\"},\n {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n {&__pyx_n_multinomial, \"multinomial\"},\n {&__pyx_n_multiply, \"multiply\"},\n {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n {&__pyx_n_negative_binomial, \"negative_binomial\"},\n {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n {&__pyx_n_noncentral_f, \"noncentral_f\"},\n {&__pyx_n_normal, \"normal\"},\n {&__pyx_n_numpy, \"numpy\"},\n {&__pyx_n_pareto, \"pareto\"},\n {&__pyx_n_permutation, \"permutation\"},\n {&__pyx_n_poisson, \"poisson\"},\n {&__pyx_n_power, \"power\"},\n {&__pyx_n_rand, \"rand\"},\n {&__pyx_n_randint, \"randint\"},\n {&__pyx_n_randn, \"randn\"},\n {&__pyx_n_random, \"random\"},\n {&__pyx_n_random_integers, \"random_integers\"},\n {&__pyx_n_random_sample, \"random_sample\"},\n {&__pyx_n_rayleigh, \"rayleigh\"},\n {&__pyx_n_reduce, \"reduce\"},\n {&__pyx_n_seed, \"seed\"},\n {&__pyx_n_set_state, \"set_state\"},\n {&__pyx_n_shape, \"shape\"},\n {&__pyx_n_shuffle, \"shuffle\"},\n {&__pyx_n_size, \"size\"},\n {&__pyx_n_sqrt, \"sqrt\"},\n {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n {&__pyx_n_standard_exponential, \"standard_exponential\"},\n {&__pyx_n_standard_gamma, \"standard_gamma\"},\n {&__pyx_n_standard_normal, \"standard_normal\"},\n {&__pyx_n_standard_t, \"standard_t\"},\n {&__pyx_n_svd, \"svd\"},\n {&__pyx_n_triangular, \"triangular\"},\n {&__pyx_n_tuple, \"tuple\"},\n {&__pyx_n_type, \"type\"},\n {&__pyx_n_uniform, \"uniform\"},\n {&__pyx_n_vonmises, \"vonmises\"},\n {&__pyx_n_wald, \"wald\"},\n {&__pyx_n_weibull, \"weibull\"},\n {&__pyx_n_zeros, \"zeros\"},\n {&__pyx_n_zipf, \"zipf\"},\n {0, 0}\n};\n\nstatic __Pyx_StringTabEntry __pyx_string_tab[] = {\n {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n {0, 0, 0}\n};\n\nstatic PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n PyObject *o = (*t->tp_alloc)(t, 0);\n struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n return o;\n}\n\nstatic void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n {\n PyObject *etype, *eval, *etb;\n PyErr_Fetch(&etype, &eval, &etb);\n ++o->ob_refcnt;\n __pyx_f_6mtrand_11RandomState___dealloc__(o);\n if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n --o->ob_refcnt;\n PyErr_Restore(etype, eval, etb);\n }\n (*o->ob_type->tp_free)(o);\n}\n\nstatic int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n return 0;\n}\n\nstatic int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n return 0;\n}\n\nstatic struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n {0, 0, 0, 0}\n};\n\nstatic PyNumberMethods __pyx_tp_as_number_RandomState = {\n 0, /*nb_add*/\n 0, /*nb_subtract*/\n 0, /*nb_multiply*/\n 0, /*nb_divide*/\n 0, /*nb_remainder*/\n 0, /*nb_divmod*/\n 0, /*nb_power*/\n 0, /*nb_negative*/\n 0, /*nb_positive*/\n 0, /*nb_absolute*/\n 0, /*nb_nonzero*/\n 0, /*nb_invert*/\n 0, /*nb_lshift*/\n 0, /*nb_rshift*/\n 0, /*nb_and*/\n 0, /*nb_xor*/\n 0, /*nb_or*/\n 0, /*nb_coerce*/\n 0, /*nb_int*/\n 0, /*nb_long*/\n 0, /*nb_float*/\n 0, /*nb_oct*/\n 0, /*nb_hex*/\n 0, /*nb_inplace_add*/\n 0, /*nb_inplace_subtract*/\n 0, /*nb_inplace_multiply*/\n 0, /*nb_inplace_divide*/\n 0, /*nb_inplace_remainder*/\n 0, /*nb_inplace_power*/\n 0, /*nb_inplace_lshift*/\n 0, /*nb_inplace_rshift*/\n 0, /*nb_inplace_and*/\n 0, /*nb_inplace_xor*/\n 0, /*nb_inplace_or*/\n 0, /*nb_floor_divide*/\n 0, /*nb_true_divide*/\n 0, /*nb_inplace_floor_divide*/\n 0, /*nb_inplace_true_divide*/\n};\n\nstatic PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n 0, /*sq_length*/\n 0, /*sq_concat*/\n 0, /*sq_repeat*/\n 0, /*sq_item*/\n 0, /*sq_slice*/\n 0, /*sq_ass_item*/\n 0, /*sq_ass_slice*/\n 0, /*sq_contains*/\n 0, /*sq_inplace_concat*/\n 0, /*sq_inplace_repeat*/\n};\n\nstatic PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n 0, /*mp_length*/\n 0, /*mp_subscript*/\n 0, /*mp_ass_subscript*/\n};\n\nstatic PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n 0, /*bf_getreadbuffer*/\n 0, /*bf_getwritebuffer*/\n 0, /*bf_getsegcount*/\n 0, /*bf_getcharbuffer*/\n};\n\nstatichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n PyObject_HEAD_INIT(0)\n 0, /*ob_size*/\n \"mtrand.RandomState\", /*tp_name*/\n sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n 0, /*tp_itemsize*/\n __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n 0, /*tp_print*/\n 0, /*tp_getattr*/\n 0, /*tp_setattr*/\n 0, /*tp_compare*/\n 0, /*tp_repr*/\n &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n 0, /*tp_hash*/\n 0, /*tp_call*/\n 0, /*tp_str*/\n 0, /*tp_getattro*/\n 0, /*tp_setattro*/\n &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n 0, /*tp_richcompare*/\n 0, /*tp_weaklistoffset*/\n 0, /*tp_iter*/\n 0, /*tp_iternext*/\n __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n 0, /*tp_members*/\n 0, /*tp_getset*/\n 0, /*tp_base*/\n 0, /*tp_dict*/\n 0, /*tp_descr_get*/\n 0, /*tp_descr_set*/\n 0, /*tp_dictoffset*/\n __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n 0, /*tp_alloc*/\n __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n 0, /*tp_free*/\n 0, /*tp_is_gc*/\n 0, /*tp_bases*/\n 0, /*tp_mro*/\n 0, /*tp_cache*/\n 0, /*tp_subclasses*/\n 0, /*tp_weaklist*/\n};\n\nstatic struct PyMethodDef __pyx_methods[] = {\n {0, 0, 0, 0}\n};\n\nDL_EXPORT(void) initmtrand(void); /*proto*/\nDL_EXPORT(void) initmtrand(void) {\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_b = PyImport_AddModule(\"__builtin__\");\n if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n import_array();\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n Py_INCREF(Py_None);\n __pyx_k2 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n Py_INCREF(Py_None);\n __pyx_k3 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n Py_INCREF(Py_None);\n __pyx_k4 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n Py_INCREF(Py_None);\n __pyx_k5 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n Py_INCREF(Py_None);\n __pyx_k6 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k7 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n __pyx_k8 = 0.0;\n __pyx_k9 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k10 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n Py_INCREF(Py_None);\n __pyx_k11 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k12 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n Py_INCREF(Py_None);\n __pyx_k13 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n __pyx_k14 = 0.0;\n __pyx_k15 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k16 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n Py_INCREF(Py_None);\n __pyx_k17 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n __pyx_k18 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k19 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n Py_INCREF(Py_None);\n __pyx_k20 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n Py_INCREF(Py_None);\n __pyx_k21 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n __pyx_k22 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k23 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n Py_INCREF(Py_None);\n __pyx_k24 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n Py_INCREF(Py_None);\n __pyx_k25 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n Py_INCREF(Py_None);\n __pyx_k26 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n Py_INCREF(Py_None);\n __pyx_k27 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n Py_INCREF(Py_None);\n __pyx_k28 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n Py_INCREF(Py_None);\n __pyx_k29 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n Py_INCREF(Py_None);\n __pyx_k30 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n Py_INCREF(Py_None);\n __pyx_k31 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n Py_INCREF(Py_None);\n __pyx_k32 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n Py_INCREF(Py_None);\n __pyx_k33 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n __pyx_k34 = 0.0;\n __pyx_k35 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k36 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n __pyx_k37 = 0.0;\n __pyx_k38 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k39 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n __pyx_k40 = 0.0;\n __pyx_k41 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k42 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n __pyx_k43 = 0.0;\n __pyx_k44 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k45 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n __pyx_k46 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k47 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n Py_INCREF(Py_None);\n __pyx_k48 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n Py_INCREF(Py_None);\n __pyx_k49 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n Py_INCREF(Py_None);\n __pyx_k50 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n Py_INCREF(Py_None);\n __pyx_k51 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n __pyx_k52 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k53 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n Py_INCREF(Py_None);\n __pyx_k54 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n Py_INCREF(Py_None);\n __pyx_k55 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n Py_INCREF(Py_None);\n __pyx_k56 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n Py_INCREF(Py_None);\n __pyx_k57 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n Py_INCREF(Py_None);\n __pyx_k58 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n Py_INCREF(Py_None);\n __pyx_k59 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n return;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n __Pyx_AddTraceback(\"mtrand\");\n}\n\nstatic char *__pyx_filenames[] = {\n \"mtrand.pyx\",\n \"numpy.pxi\",\n};\nstatichere char **__pyx_f = __pyx_filenames;\n\n/* Runtime support code */\n\nstatic int __Pyx_GetStarArgs(\n PyObject **args, \n PyObject **kwds,\n char *kwd_list[], \n int nargs,\n PyObject **args2, \n PyObject **kwds2)\n{\n PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n \n if (args2)\n *args2 = 0;\n if (kwds2)\n *kwds2 = 0;\n \n if (args2) {\n args1 = PyTuple_GetSlice(*args, 0, nargs);\n if (!args1)\n goto bad;\n *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n if (!*args2)\n goto bad;\n }\n else {\n args1 = *args;\n Py_INCREF(args1);\n }\n \n if (kwds2) {\n if (*kwds) {\n char **p;\n kwds1 = PyDict_New();\n if (!kwds)\n goto bad;\n *kwds2 = PyDict_Copy(*kwds);\n if (!*kwds2)\n goto bad;\n for (p = kwd_list; *p; p++) {\n x = PyDict_GetItemString(*kwds, *p);\n if (x) {\n if (PyDict_SetItemString(kwds1, *p, x) < 0)\n goto bad;\n if (PyDict_DelItemString(*kwds2, *p) < 0)\n goto bad;\n }\n }\n }\n else {\n *kwds2 = PyDict_New();\n if (!*kwds2)\n goto bad;\n }\n }\n else {\n kwds1 = *kwds;\n Py_XINCREF(kwds1);\n }\n \n *args = args1;\n *kwds = kwds1;\n return 0;\nbad:\n Py_XDECREF(args1);\n Py_XDECREF(kwds1);\n Py_XDECREF(*args2);\n Py_XDECREF(*kwds2);\n return -1;\n}\n\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n PyObject *__import__ = 0;\n PyObject *empty_list = 0;\n PyObject *module = 0;\n PyObject *global_dict = 0;\n PyObject *empty_dict = 0;\n PyObject *list;\n __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n if (!__import__)\n goto bad;\n if (from_list)\n list = from_list;\n else {\n empty_list = PyList_New(0);\n if (!empty_list)\n goto bad;\n list = empty_list;\n }\n global_dict = PyModule_GetDict(__pyx_m);\n if (!global_dict)\n goto bad;\n empty_dict = PyDict_New();\n if (!empty_dict)\n goto bad;\n module = PyObject_CallFunction(__import__, \"OOOO\",\n name, global_dict, empty_dict, list);\nbad:\n Py_XDECREF(empty_list);\n Py_XDECREF(__import__);\n Py_XDECREF(empty_dict);\n return module;\n}\n\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n PyObject *result;\n result = PyObject_GetAttr(dict, name);\n if (!result)\n PyErr_SetObject(PyExc_NameError, name);\n return result;\n}\n\nstatic void __Pyx_WriteUnraisable(char *name) {\n PyObject *old_exc, *old_val, *old_tb;\n PyObject *ctx;\n PyErr_Fetch(&old_exc, &old_val, &old_tb);\n ctx = PyString_FromString(name);\n PyErr_Restore(old_exc, old_val, old_tb);\n if (!ctx)\n ctx = Py_None;\n PyErr_WriteUnraisable(ctx);\n}\n\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n Py_XINCREF(type);\n Py_XINCREF(value);\n Py_XINCREF(tb);\n /* First, check the traceback argument, replacing None with NULL. */\n if (tb == Py_None) {\n Py_DECREF(tb);\n tb = 0;\n }\n else if (tb != NULL && !PyTraceBack_Check(tb)) {\n PyErr_SetString(PyExc_TypeError,\n \"raise: arg 3 must be a traceback or None\");\n goto raise_error;\n }\n /* Next, replace a missing value with None */\n if (value == NULL) {\n value = Py_None;\n Py_INCREF(value);\n }\n /* Next, repeatedly, replace a tuple exception with its first item */\n while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n PyObject *tmp = type;\n type = PyTuple_GET_ITEM(type, 0);\n Py_INCREF(type);\n Py_DECREF(tmp);\n }\n if (PyString_Check(type))\n ;\n else if (PyClass_Check(type))\n ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n else if (PyInstance_Check(type)) {\n /* Raising an instance. The value should be a dummy. */\n if (value != Py_None) {\n PyErr_SetString(PyExc_TypeError,\n \"instance exception may not have a separate value\");\n goto raise_error;\n }\n else {\n /* Normalize to raise , */\n Py_DECREF(value);\n value = type;\n type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n Py_INCREF(type);\n }\n }\n else {\n /* Not something you can raise. You get an exception\n anyway, just not what you specified :-) */\n PyErr_Format(PyExc_TypeError,\n \"exceptions must be strings, classes, or \"\n \"instances, not %s\", type->ob_type->tp_name);\n goto raise_error;\n }\n PyErr_Restore(type, value, tb);\n return;\nraise_error:\n Py_XDECREF(value);\n Py_XDECREF(type);\n Py_XDECREF(tb);\n return;\n}\n\nstatic void __Pyx_UnpackError(void) {\n PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n}\n\nstatic PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (!item) {\n if (PyErr_ExceptionMatches(PyExc_IndexError))\n __Pyx_UnpackError();\n }\n return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (item) {\n Py_DECREF(item);\n __Pyx_UnpackError();\n return -1;\n }\n PyErr_Clear();\n return 0;\n}\n\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n while (t->p) {\n *t->p = PyString_InternFromString(t->s);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n while (t->p) {\n *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n long size) \n{\n PyObject *py_module_name = 0;\n PyObject *py_class_name = 0;\n PyObject *py_name_list = 0;\n PyObject *py_module = 0;\n PyObject *result = 0;\n \n py_module_name = PyString_FromString(module_name);\n if (!py_module_name)\n goto bad;\n py_class_name = PyString_FromString(class_name);\n if (!py_class_name)\n goto bad;\n py_name_list = PyList_New(1);\n if (!py_name_list)\n goto bad;\n Py_INCREF(py_class_name);\n if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n goto bad;\n py_module = __Pyx_Import(py_module_name, py_name_list);\n if (!py_module)\n goto bad;\n result = PyObject_GetAttr(py_module, py_class_name);\n if (!result)\n goto bad;\n if (!PyType_Check(result)) {\n PyErr_Format(PyExc_TypeError, \n \"%s.%s is not a type object\",\n module_name, class_name);\n goto bad;\n }\n if (((PyTypeObject *)result)->tp_basicsize != size) {\n PyErr_Format(PyExc_ValueError, \n \"%s.%s does not appear to be the correct type object\",\n module_name, class_name);\n goto bad;\n }\n goto done;\nbad:\n Py_XDECREF(result);\n result = 0;\ndone:\n Py_XDECREF(py_module_name);\n Py_XDECREF(py_class_name);\n Py_XDECREF(py_name_list);\n return (PyTypeObject *)result;\n}\n\n#include \"compile.h\"\n#include \"frameobject.h\"\n#include \"traceback.h\"\n\nstatic void __Pyx_AddTraceback(char *funcname) {\n PyObject *py_srcfile = 0;\n PyObject *py_funcname = 0;\n PyObject *py_globals = 0;\n PyObject *empty_tuple = 0;\n PyObject *empty_string = 0;\n PyCodeObject *py_code = 0;\n PyFrameObject *py_frame = 0;\n \n py_srcfile = PyString_FromString(__pyx_filename);\n if (!py_srcfile) goto bad;\n py_funcname = PyString_FromString(funcname);\n if (!py_funcname) goto bad;\n py_globals = PyModule_GetDict(__pyx_m);\n if (!py_globals) goto bad;\n empty_tuple = PyTuple_New(0);\n if (!empty_tuple) goto bad;\n empty_string = PyString_FromString(\"\");\n if (!empty_string) goto bad;\n py_code = PyCode_New(\n 0, /*int argcount,*/\n 0, /*int nlocals,*/\n 0, /*int stacksize,*/\n 0, /*int flags,*/\n empty_string, /*PyObject *code,*/\n empty_tuple, /*PyObject *consts,*/\n empty_tuple, /*PyObject *names,*/\n empty_tuple, /*PyObject *varnames,*/\n empty_tuple, /*PyObject *freevars,*/\n empty_tuple, /*PyObject *cellvars,*/\n py_srcfile, /*PyObject *filename,*/\n py_funcname, /*PyObject *name,*/\n __pyx_lineno, /*int firstlineno,*/\n empty_string /*PyObject *lnotab*/\n );\n if (!py_code) goto bad;\n py_frame = PyFrame_New(\n PyThreadState_Get(), /*PyThreadState *tstate,*/\n py_code, /*PyCodeObject *code,*/\n py_globals, /*PyObject *globals,*/\n 0 /*PyObject *locals*/\n );\n if (!py_frame) goto bad;\n py_frame->f_lineno = __pyx_lineno;\n PyTraceBack_Here(py_frame);\nbad:\n Py_XDECREF(py_srcfile);\n Py_XDECREF(py_funcname);\n Py_XDECREF(empty_tuple);\n Py_XDECREF(empty_string);\n Py_XDECREF(py_code);\n Py_XDECREF(py_frame);\n}\n", + "methods": [], + "methods_before": [ + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 12:43:35 2006 */", + "", + "#include \"Python.h\"", + "#include \"structmember.h\"", + "#ifndef PY_LONG_LONG", + " #define PY_LONG_LONG LONG_LONG", + "#endif", + "#include \"string.h\"", + "#include \"math.h\"", + "#include \"numpy/arrayobject.h\"", + "#include \"randomkit.h\"", + "#include \"distributions.h\"", + "#include \"initarray.h\"", + "", + "", + "typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/", + "typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/", + "static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/", + "static int __Pyx_EndUnpack(PyObject *, int); /*proto*/", + "static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/", + "static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/", + "static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/", + "static void __Pyx_WriteUnraisable(char *name); /*proto*/", + "static void __Pyx_AddTraceback(char *funcname); /*proto*/", + "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/", + "static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/", + "static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/", + "static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/", + "", + "static PyObject *__pyx_m;", + "static PyObject *__pyx_b;", + "static int __pyx_lineno;", + "static char *__pyx_filename;", + "staticforward char **__pyx_f;", + "", + "/* Declarations from mtrand */", + "", + "staticforward PyTypeObject __pyx_type_6mtrand_RandomState;", + "", + "struct __pyx_obj_6mtrand_RandomState {", + " PyObject_HEAD", + " rk_state (*internal_state);", + "};", + "", + "static PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;", + "static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;", + "static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;", + "static PyObject *__pyx_k2;", + "static PyObject *__pyx_k3;", + "static PyObject *__pyx_k4;", + "static PyObject *__pyx_k5;", + "static PyObject *__pyx_k6;", + "static PyObject *__pyx_k7;", + "static double __pyx_k8;", + "static double __pyx_k9;", + "static PyObject *__pyx_k10;", + "static PyObject *__pyx_k11;", + "static PyObject *__pyx_k12;", + "static PyObject *__pyx_k13;", + "static double __pyx_k14;", + "static double __pyx_k15;", + "static PyObject *__pyx_k16;", + "static PyObject *__pyx_k17;", + "static double __pyx_k18;", + "static PyObject *__pyx_k19;", + "static PyObject *__pyx_k20;", + "static PyObject *__pyx_k21;", + "static double __pyx_k22;", + "static PyObject *__pyx_k23;", + "static PyObject *__pyx_k24;", + "static PyObject *__pyx_k25;", + "static PyObject *__pyx_k26;", + "static PyObject *__pyx_k27;", + "static PyObject *__pyx_k28;", + "static PyObject *__pyx_k29;", + "static PyObject *__pyx_k30;", + "static PyObject *__pyx_k31;", + "static PyObject *__pyx_k32;", + "static PyObject *__pyx_k33;", + "static double __pyx_k34;", + "static double __pyx_k35;", + "static PyObject *__pyx_k36;", + "static double __pyx_k37;", + "static double __pyx_k38;", + "static PyObject *__pyx_k39;", + "static double __pyx_k40;", + "static double __pyx_k41;", + "static PyObject *__pyx_k42;", + "static double __pyx_k43;", + "static double __pyx_k44;", + "static PyObject *__pyx_k45;", + "static double __pyx_k46;", + "static PyObject *__pyx_k47;", + "static PyObject *__pyx_k48;", + "static PyObject *__pyx_k49;", + "static PyObject *__pyx_k50;", + "static PyObject *__pyx_k51;", + "static double __pyx_k52;", + "static PyObject *__pyx_k53;", + "static PyObject *__pyx_k54;", + "static PyObject *__pyx_k55;", + "static PyObject *__pyx_k56;", + "static PyObject *__pyx_k57;", + "static PyObject *__pyx_k58;", + "static PyObject *__pyx_k59;", + "static PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/", + "static double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/", + "", + "/* Implementation of mtrand */", + "", + "", + "static PyObject *__pyx_n__sp;", + "static PyObject *__pyx_n__rand;", + "static PyObject *__pyx_n_seed;", + "static PyObject *__pyx_n_get_state;", + "static PyObject *__pyx_n_set_state;", + "static PyObject *__pyx_n_random_sample;", + "static PyObject *__pyx_n_randint;", + "static PyObject *__pyx_n_bytes;", + "static PyObject *__pyx_n_uniform;", + "static PyObject *__pyx_n_rand;", + "static PyObject *__pyx_n_randn;", + "static PyObject *__pyx_n_random_integers;", + "static PyObject *__pyx_n_standard_normal;", + "static PyObject *__pyx_n_normal;", + "static PyObject *__pyx_n_beta;", + "static PyObject *__pyx_n_exponential;", + "static PyObject *__pyx_n_standard_exponential;", + "static PyObject *__pyx_n_standard_gamma;", + "static PyObject *__pyx_n_gamma;", + "static PyObject *__pyx_n_f;", + "static PyObject *__pyx_n_noncentral_f;", + "static PyObject *__pyx_n_chisquare;", + "static PyObject *__pyx_n_noncentral_chisquare;", + "static PyObject *__pyx_n_standard_cauchy;", + "static PyObject *__pyx_n_standard_t;", + "static PyObject *__pyx_n_vonmises;", + "static PyObject *__pyx_n_pareto;", + "static PyObject *__pyx_n_weibull;", + "static PyObject *__pyx_n_power;", + "static PyObject *__pyx_n_laplace;", + "static PyObject *__pyx_n_gumbel;", + "static PyObject *__pyx_n_logistic;", + "static PyObject *__pyx_n_lognormal;", + "static PyObject *__pyx_n_rayleigh;", + "static PyObject *__pyx_n_wald;", + "static PyObject *__pyx_n_triangular;", + "static PyObject *__pyx_n_binomial;", + "static PyObject *__pyx_n_negative_binomial;", + "static PyObject *__pyx_n_poisson;", + "static PyObject *__pyx_n_zipf;", + "static PyObject *__pyx_n_geometric;", + "static PyObject *__pyx_n_hypergeometric;", + "static PyObject *__pyx_n_logseries;", + "static PyObject *__pyx_n_multivariate_normal;", + "static PyObject *__pyx_n_multinomial;", + "static PyObject *__pyx_n_shuffle;", + "static PyObject *__pyx_n_permutation;", + "static PyObject *__pyx_n_numpy;", + "", + "static PyObject *__pyx_n_empty;", + "static PyObject *__pyx_n_Float64;", + "", + "static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont0_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont1_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont2_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont3_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_Int;", + "", + "static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.disc0_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discnp_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discnmN_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discd_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {", + " double __pyx_v_c;", + " double __pyx_v_y;", + " double __pyx_v_t;", + " double __pyx_v_sum;", + " long __pyx_v_i;", + " double __pyx_r;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */", + " __pyx_v_sum = (__pyx_v_darr[0]);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */", + " __pyx_v_c = 0.0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */", + " for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */", + " __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */", + " __pyx_v_t = (__pyx_v_sum + __pyx_v_y);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */", + " __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */", + " __pyx_v_sum = __pyx_v_t;", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */", + " __pyx_r = __pyx_v_sum;", + " goto __pyx_L0;", + "", + " __pyx_r = 0;", + " goto __pyx_L0;", + " __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");", + " __pyx_L0:;", + " return __pyx_r;", + "}", + "", + "static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_seed = 0;", + " int __pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {\"seed\",0};", + " __pyx_v_seed = __pyx_k2;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_seed);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */", + " ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_seed);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " __pyx_r = 0;", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");", + " __pyx_r = -1;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_seed);", + " return __pyx_r;", + "}", + "", + "static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/", + "static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {", + " int __pyx_1;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */", + " __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */", + " PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " goto __pyx_L0;", + " __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + "}", + "", + "static PyObject *__pyx_n_type;", + "static PyObject *__pyx_n_int;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_seed = 0;", + " rk_error __pyx_v_errcode;", + " PyArrayObject *arrayObject_obj;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " unsigned long __pyx_5;", + " static char *__pyx_argnames[] = {\"seed\",0};", + " __pyx_v_seed = __pyx_k3;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_seed);", + " arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */", + " __pyx_1 = __pyx_v_seed == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */", + " __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_seed);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " __pyx_1 = __pyx_4 == __pyx_2;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */", + " __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}", + " rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */", + " __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_3));", + " Py_DECREF(((PyObject *)arrayObject_obj));", + " arrayObject_obj = ((PyArrayObject *)__pyx_3);", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */", + " init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.seed\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_obj);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_seed);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_MT19937;", + "", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyArrayObject *arrayObject_state;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + " arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " __pyx_1 = 0;", + " __pyx_4 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_INCREF(((PyObject *)__pyx_1));", + " Py_DECREF(((PyObject *)arrayObject_state));", + " arrayObject_state = ((PyArrayObject *)__pyx_1);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */", + " memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */", + " __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}", + " Py_INCREF(__pyx_n_MT19937);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);", + " Py_INCREF(((PyObject *)arrayObject_state));", + " PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));", + " PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_state);", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_ValueError;", + "", + "static PyObject *__pyx_k62p;", + "static PyObject *__pyx_k63p;", + "", + "static char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";", + "static char (__pyx_k63[]) = \"state must be 624 longs\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_state = 0;", + " PyArrayObject *arrayObject_obj;", + " int __pyx_v_pos;", + " PyObject *__pyx_v_algorithm_name;", + " PyObject *__pyx_v_key;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " int __pyx_3;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"state\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_state);", + " arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);", + " __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);", + " __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_algorithm_name);", + " __pyx_v_algorithm_name = __pyx_2;", + " __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */", + " if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}", + " __pyx_3 = __pyx_3 != 0;", + " if (__pyx_3) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " Py_INCREF(__pyx_k62p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);", + " __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */", + " __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_key);", + " __pyx_v_key = __pyx_2;", + " __pyx_2 = 0;", + " __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_v_pos = __pyx_3;", + " if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */", + " __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject_obj));", + " arrayObject_obj = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */", + " __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);", + " if (__pyx_3) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " Py_INCREF(__pyx_k63p);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */", + " memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */", + " ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_obj);", + " Py_DECREF(__pyx_v_algorithm_name);", + " Py_DECREF(__pyx_v_key);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_state);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_state = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {\"state\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_state);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_state);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_random;", + "static PyObject *__pyx_n___RandomState_ctor;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);", + " __pyx_1 = 0;", + " __pyx_2 = 0;", + " __pyx_5 = 0;", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k4;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k5;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */", + " __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k64p;", + "", + "static char (__pyx_k64[]) = \"low >= high\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_low = 0;", + " PyObject *__pyx_v_high = 0;", + " PyObject *__pyx_v_size = 0;", + " long __pyx_v_lo;", + " long __pyx_v_hi;", + " long __pyx_v_diff;", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " long __pyx_2;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_high = __pyx_k6;", + " __pyx_v_size = __pyx_k7;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_low);", + " Py_INCREF(__pyx_v_high);", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */", + " __pyx_1 = __pyx_v_high == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */", + " __pyx_v_lo = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}", + " __pyx_v_hi = __pyx_2;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}", + " __pyx_v_lo = __pyx_2;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}", + " __pyx_v_hi = __pyx_2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */", + " __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */", + " __pyx_1 = (__pyx_v_diff < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " Py_INCREF(__pyx_k64p);", + " PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);", + " __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __Pyx_Raise(__pyx_5, 0, 0);", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */", + " __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + " goto __pyx_L4;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */", + " __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */", + " (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L4:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.randint\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " unsigned int __pyx_v_length;", + " void (*__pyx_v_bytes);", + " PyObject *__pyx_v_bytestring;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"length\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;", + " Py_INCREF(__pyx_v_self);", + " __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */", + " __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */", + " rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */", + " __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_bytestring);", + " __pyx_v_bytestring = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */", + " PyMem_Free(__pyx_v_bytes);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */", + " Py_INCREF(__pyx_v_bytestring);", + " __pyx_r = __pyx_v_bytestring;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_bytestring);", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_low;", + " double __pyx_v_high;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_low = __pyx_k8;", + " __pyx_v_high = __pyx_k9;", + " __pyx_v_size = __pyx_k10;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */", + " __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_len;", + "static PyObject *__pyx_n_size;", + "", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_args = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " Py_XDECREF(__pyx_v_args);", + " return 0;", + " }", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 == 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_r = __pyx_5;", + " __pyx_5 = 0;", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.rand\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_XDECREF(__pyx_v_args);", + " Py_DECREF(__pyx_v_self);", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_args = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " static char *__pyx_argnames[] = {0};", + " if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " Py_XDECREF(__pyx_v_args);", + " return 0;", + " }", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 == 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.randn\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_XDECREF(__pyx_v_args);", + " Py_DECREF(__pyx_v_self);", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_low = 0;", + " PyObject *__pyx_v_high = 0;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_high = __pyx_k11;", + " __pyx_v_size = __pyx_k12;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_low);", + " Py_INCREF(__pyx_v_high);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */", + " __pyx_1 = __pyx_v_high == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */", + " Py_INCREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " __pyx_v_high = __pyx_v_low;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */", + " __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_low);", + " __pyx_v_low = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_low);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_4;", + " __pyx_4 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k13;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k66p;", + "", + "static char (__pyx_k66[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k14;", + " __pyx_v_scale = __pyx_k15;", + " __pyx_v_size = __pyx_k16;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " Py_INCREF(__pyx_k66p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k67p;", + "static PyObject *__pyx_k68p;", + "", + "static char (__pyx_k67[]) = \"a <= 0\";", + "static char (__pyx_k68[]) = \"b <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " double __pyx_v_b;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};", + " __pyx_v_size = __pyx_k17;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " Py_INCREF(__pyx_k67p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_b <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " Py_INCREF(__pyx_k68p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.beta\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k69p;", + "", + "static char (__pyx_k69[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k18;", + " __pyx_v_size = __pyx_k19;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " Py_INCREF(__pyx_k69p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k20;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k70p;", + "", + "static char (__pyx_k70[]) = \"shape <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_shape;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"shape\",\"size\",0};", + " __pyx_v_size = __pyx_k21;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */", + " __pyx_1 = (__pyx_v_shape <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " Py_INCREF(__pyx_k70p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k71p;", + "static PyObject *__pyx_k72p;", + "", + "static char (__pyx_k71[]) = \"shape <= 0\";", + "static char (__pyx_k72[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_shape;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k22;", + " __pyx_v_size = __pyx_k23;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */", + " __pyx_1 = (__pyx_v_shape <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " Py_INCREF(__pyx_k71p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " Py_INCREF(__pyx_k72p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k73p;", + "static PyObject *__pyx_k74p;", + "", + "static char (__pyx_k73[]) = \"dfnum <= 0\";", + "static char (__pyx_k74[]) = \"dfden <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_dfnum;", + " double __pyx_v_dfden;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};", + " __pyx_v_size = __pyx_k24;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */", + " __pyx_1 = (__pyx_v_dfnum <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " Py_INCREF(__pyx_k73p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_dfden <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " Py_INCREF(__pyx_k74p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.f\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k75p;", + "static PyObject *__pyx_k76p;", + "static PyObject *__pyx_k77p;", + "", + "static char (__pyx_k75[]) = \"dfnum <= 1\";", + "static char (__pyx_k76[]) = \"dfden <= 0\";", + "static char (__pyx_k77[]) = \"nonc < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_dfnum;", + " double __pyx_v_dfden;", + " double __pyx_v_nonc;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};", + " __pyx_v_size = __pyx_k25;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */", + " __pyx_1 = (__pyx_v_dfnum <= 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " Py_INCREF(__pyx_k75p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_dfden <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " Py_INCREF(__pyx_k76p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nonc < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " Py_INCREF(__pyx_k77p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */", + " __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k78p;", + "", + "static char (__pyx_k78[]) = \"df <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"size\",0};", + " __pyx_v_size = __pyx_k26;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */", + " __pyx_1 = (__pyx_v_df <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " Py_INCREF(__pyx_k78p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k79p;", + "static PyObject *__pyx_k80p;", + "", + "static char (__pyx_k79[]) = \"df <= 1\";", + "static char (__pyx_k80[]) = \"nonc < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " double __pyx_v_nonc;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};", + " __pyx_v_size = __pyx_k27;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */", + " __pyx_1 = (__pyx_v_df <= 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " Py_INCREF(__pyx_k79p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nonc < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " Py_INCREF(__pyx_k80p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k28;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k81p;", + "", + "static char (__pyx_k81[]) = \"df <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"size\",0};", + " __pyx_v_size = __pyx_k29;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */", + " __pyx_1 = (__pyx_v_df <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " Py_INCREF(__pyx_k81p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k82p;", + "", + "static char (__pyx_k82[]) = \"kappa < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mu;", + " double __pyx_v_kappa;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};", + " __pyx_v_size = __pyx_k30;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */", + " __pyx_1 = (__pyx_v_kappa < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " Py_INCREF(__pyx_k82p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k83p;", + "", + "static char (__pyx_k83[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k31;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " Py_INCREF(__pyx_k83p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k84p;", + "", + "static char (__pyx_k84[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k32;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " Py_INCREF(__pyx_k84p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k85p;", + "", + "static char (__pyx_k85[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k33;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " Py_INCREF(__pyx_k85p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.power\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k86p;", + "", + "static char (__pyx_k86[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k34;", + " __pyx_v_scale = __pyx_k35;", + " __pyx_v_size = __pyx_k36;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " Py_INCREF(__pyx_k86p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k87p;", + "", + "static char (__pyx_k87[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k37;", + " __pyx_v_scale = __pyx_k38;", + " __pyx_v_size = __pyx_k39;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " Py_INCREF(__pyx_k87p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k88p;", + "", + "static char (__pyx_k88[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k40;", + " __pyx_v_scale = __pyx_k41;", + " __pyx_v_size = __pyx_k42;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " Py_INCREF(__pyx_k88p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k89p;", + "", + "static char (__pyx_k89[]) = \"sigma <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mean;", + " double __pyx_v_sigma;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};", + " __pyx_v_mean = __pyx_k43;", + " __pyx_v_sigma = __pyx_k44;", + " __pyx_v_size = __pyx_k45;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */", + " __pyx_1 = (__pyx_v_sigma <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " Py_INCREF(__pyx_k89p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k90p;", + "", + "static char (__pyx_k90[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k46;", + " __pyx_v_size = __pyx_k47;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " Py_INCREF(__pyx_k90p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k91p;", + "static PyObject *__pyx_k92p;", + "", + "static char (__pyx_k91[]) = \"mean <= 0.0\";", + "static char (__pyx_k92[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mean;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};", + " __pyx_v_size = __pyx_k48;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */", + " __pyx_1 = (__pyx_v_mean <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " Py_INCREF(__pyx_k91p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " Py_INCREF(__pyx_k92p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.wald\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k93p;", + "static PyObject *__pyx_k94p;", + "static PyObject *__pyx_k95p;", + "", + "static char (__pyx_k93[]) = \"left > mode\";", + "static char (__pyx_k94[]) = \"mode > right\";", + "static char (__pyx_k95[]) = \"left == right\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_left;", + " double __pyx_v_mode;", + " double __pyx_v_right;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};", + " __pyx_v_size = __pyx_k49;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */", + " __pyx_1 = (__pyx_v_left > __pyx_v_mode);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " Py_INCREF(__pyx_k93p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_mode > __pyx_v_right);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " Py_INCREF(__pyx_k94p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_left == __pyx_v_right);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " Py_INCREF(__pyx_k95p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */", + " __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k96p;", + "static PyObject *__pyx_k97p;", + "static PyObject *__pyx_k98p;", + "", + "static char (__pyx_k96[]) = \"n <= 0\";", + "static char (__pyx_k97[]) = \"p < 0\";", + "static char (__pyx_k98[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k50;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */", + " __pyx_1 = (__pyx_v_n <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " Py_INCREF(__pyx_k96p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " Py_INCREF(__pyx_k97p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " Py_INCREF(__pyx_k98p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */", + " __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k99p;", + "static PyObject *__pyx_k100p;", + "static PyObject *__pyx_k101p;", + "", + "static char (__pyx_k99[]) = \"n <= 0\";", + "static char (__pyx_k100[]) = \"p < 0\";", + "static char (__pyx_k101[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k51;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */", + " __pyx_1 = (__pyx_v_n <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " Py_INCREF(__pyx_k99p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " Py_INCREF(__pyx_k100p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " Py_INCREF(__pyx_k101p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */", + " __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k102p;", + "", + "static char (__pyx_k102[]) = \"lam <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_lam;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"lam\",\"size\",0};", + " __pyx_v_lam = __pyx_k52;", + " __pyx_v_size = __pyx_k53;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */", + " __pyx_1 = (__pyx_v_lam <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " Py_INCREF(__pyx_k102p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k103p;", + "", + "static char (__pyx_k103[]) = \"a <= 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k54;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */", + " __pyx_1 = (__pyx_v_a <= 1.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " Py_INCREF(__pyx_k103p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k104p;", + "static PyObject *__pyx_k105p;", + "", + "static char (__pyx_k104[]) = \"p < 0.0\";", + "static char (__pyx_k105[]) = \"p > 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k55;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */", + " __pyx_1 = (__pyx_v_p < 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " Py_INCREF(__pyx_k104p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " Py_INCREF(__pyx_k105p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k106p;", + "static PyObject *__pyx_k107p;", + "static PyObject *__pyx_k108p;", + "static PyObject *__pyx_k109p;", + "", + "static char (__pyx_k106[]) = \"ngood < 1\";", + "static char (__pyx_k107[]) = \"nbad < 1\";", + "static char (__pyx_k108[]) = \"ngood + nbad < nsample\";", + "static char (__pyx_k109[]) = \"nsample < 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_ngood;", + " long __pyx_v_nbad;", + " long __pyx_v_nsample;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};", + " __pyx_v_size = __pyx_k56;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */", + " __pyx_1 = (__pyx_v_ngood < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " Py_INCREF(__pyx_k106p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nbad < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " Py_INCREF(__pyx_k107p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " Py_INCREF(__pyx_k108p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nsample < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " Py_INCREF(__pyx_k109p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */", + " __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k110p;", + "static PyObject *__pyx_k111p;", + "", + "static char (__pyx_k110[]) = \"p < 0\";", + "static char (__pyx_k111[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k57;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " Py_INCREF(__pyx_k110p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " Py_INCREF(__pyx_k111p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_array;", + "static PyObject *__pyx_n_shape;", + "static PyObject *__pyx_n_ArgumentError;", + "static PyObject *__pyx_n_isinstance;", + "static PyObject *__pyx_n_list;", + "static PyObject *__pyx_n_append;", + "static PyObject *__pyx_n_multiply;", + "static PyObject *__pyx_n_reduce;", + "static PyObject *__pyx_n_svd;", + "static PyObject *__pyx_n_matrixmultiply;", + "static PyObject *__pyx_n_sqrt;", + "static PyObject *__pyx_n_add;", + "static PyObject *__pyx_n_tuple;", + "", + "static PyObject *__pyx_k112p;", + "static PyObject *__pyx_k113p;", + "static PyObject *__pyx_k114p;", + "static PyObject *__pyx_k115p;", + "", + "static char (__pyx_k112[]) = \"mean must be 1 dimensional\";", + "static char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";", + "static char (__pyx_k114[]) = \"mean and cov must have same length\";", + "static char (__pyx_k115[]) = \"numpy.corelinalg\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_mean = 0;", + " PyObject *__pyx_v_cov = 0;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_v_shape;", + " PyObject *__pyx_v_final_shape;", + " PyObject *__pyx_v_x;", + " PyObject *__pyx_v_svd;", + " PyObject *__pyx_v_u;", + " PyObject *__pyx_v_s;", + " PyObject *__pyx_v_v;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};", + " __pyx_v_size = __pyx_k58;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_mean);", + " Py_INCREF(__pyx_v_cov);", + " Py_INCREF(__pyx_v_size);", + " __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);", + " __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);", + " __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);", + " __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);", + " __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);", + " __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);", + " __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_mean);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_mean);", + " __pyx_v_mean = __pyx_3;", + " __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_cov);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_cov);", + " __pyx_v_cov = __pyx_2;", + " __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */", + " __pyx_4 = __pyx_v_size == Py_None;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */", + " __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */", + " Py_INCREF(__pyx_v_size);", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_v_size;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);", + " __pyx_2 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " Py_INCREF(__pyx_k112p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_3, 0, 0);", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " __pyx_2 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (!__pyx_4) {", + " __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " }", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " Py_INCREF(__pyx_k113p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);", + " __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_1, 0, 0);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " goto __pyx_L4;", + " }", + " __pyx_L4:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */", + " __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " Py_INCREF(__pyx_k114p);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __Pyx_Raise(__pyx_2, 0, 0);", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " goto __pyx_L5;", + " }", + " __pyx_L5:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */", + " __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L6;", + " }", + " __pyx_L6:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);", + " __pyx_5 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_final_shape);", + " __pyx_v_final_shape = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */", + " __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);", + " __pyx_3 = 0;", + " __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_x);", + " __pyx_v_x = __pyx_5;", + " __pyx_5 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);", + " PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);", + " __pyx_3 = 0;", + " __pyx_5 = 0;", + " if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */", + " __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_INCREF(__pyx_n_svd);", + " PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);", + " __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_svd);", + " __pyx_v_svd = __pyx_5;", + " __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_cov);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);", + " __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_u);", + " __pyx_v_u = __pyx_3;", + " __pyx_3 = 0;", + " __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_s);", + " __pyx_v_s = __pyx_5;", + " __pyx_5 = 0;", + " __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_v);", + " __pyx_v_v = __pyx_1;", + " __pyx_1 = 0;", + " if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_s);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " Py_INCREF(__pyx_v_v);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);", + " __pyx_2 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_x);", + " __pyx_v_x = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_mean);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */", + " Py_INCREF(__pyx_v_x);", + " __pyx_r = __pyx_v_x;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_shape);", + " Py_DECREF(__pyx_v_final_shape);", + " Py_DECREF(__pyx_v_x);", + " Py_DECREF(__pyx_v_svd);", + " Py_DECREF(__pyx_v_u);", + " Py_DECREF(__pyx_v_s);", + " Py_DECREF(__pyx_v_v);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_mean);", + " Py_DECREF(__pyx_v_cov);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_zeros;", + "", + "static PyObject *__pyx_k117p;", + "", + "static char (__pyx_k117[]) = \"sum(pvals) > 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " PyObject *__pyx_v_pvals = 0;", + " PyObject *__pyx_v_size = 0;", + " long __pyx_v_d;", + " PyArrayObject *arrayObject_parr;", + " PyArrayObject *arrayObject_mnarr;", + " double (*__pyx_v_pix);", + " long (*__pyx_v_mnix);", + " long __pyx_v_i;", + " long __pyx_v_j;", + " long __pyx_v_dn;", + " double __pyx_v_Sum;", + " PyObject *__pyx_v_shape;", + " PyObject *__pyx_v_multin;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " long __pyx_4;", + " int __pyx_5;", + " static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};", + " __pyx_v_size = __pyx_k59;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_pvals);", + " Py_INCREF(__pyx_v_size);", + " arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);", + " arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);", + " __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);", + " __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_pvals);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_v_d = __pyx_4;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */", + " __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_1));", + " Py_DECREF(((PyObject *)arrayObject_parr));", + " arrayObject_parr = ((PyArrayObject *)__pyx_1);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */", + " __pyx_v_pix = ((double (*))arrayObject_parr->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */", + " __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " Py_INCREF(__pyx_k117p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_1, 0, 0);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */", + " __pyx_5 = __pyx_v_size == Py_None;", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L3;", + " }", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " __pyx_5 = __pyx_3 == __pyx_1;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);", + " __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L3;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */", + " __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_multin);", + " __pyx_v_multin = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */", + " Py_INCREF(((PyObject *)__pyx_v_multin));", + " Py_DECREF(((PyObject *)arrayObject_mnarr));", + " arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */", + " __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */", + " __pyx_v_i = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */", + " while (1) {", + " __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));", + " if (!__pyx_5) break;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */", + " __pyx_v_Sum = 1.0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */", + " __pyx_v_dn = __pyx_v_n;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */", + " __pyx_4 = (__pyx_v_d - 1);", + " for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */", + " (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */", + " __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */", + " __pyx_5 = (__pyx_v_dn <= 0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */", + " goto __pyx_L7;", + " goto __pyx_L8;", + " }", + " __pyx_L8:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */", + " __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));", + " }", + " __pyx_L7:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */", + " __pyx_5 = (__pyx_v_dn > 0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */", + " (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;", + " goto __pyx_L9;", + " }", + " __pyx_L9:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */", + " __pyx_v_i = (__pyx_v_i + __pyx_v_d);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */", + " Py_INCREF(__pyx_v_multin);", + " __pyx_r = __pyx_v_multin;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_parr);", + " Py_DECREF(arrayObject_mnarr);", + " Py_DECREF(__pyx_v_shape);", + " Py_DECREF(__pyx_v_multin);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_pvals);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_x = 0;", + " long __pyx_v_i;", + " long __pyx_v_j;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " long __pyx_4;", + " int __pyx_5;", + " static char *__pyx_argnames[] = {\"x\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_x);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_v_i = __pyx_4;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */", + " while (1) {", + " __pyx_5 = (__pyx_v_i > 0);", + " if (!__pyx_5) break;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */", + " __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */", + " __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */", + " __pyx_v_i = (__pyx_v_i - 1);", + " }", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_x);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_arange;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_x = 0;", + " PyObject *__pyx_v_arr;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " static char *__pyx_argnames[] = {\"x\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_x);", + " __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " __pyx_4 = __pyx_3 == __pyx_1;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_arr);", + " __pyx_v_arr = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_arr);", + " __pyx_v_arr = __pyx_3;", + " __pyx_3 = 0;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_arr);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */", + " Py_INCREF(__pyx_v_arr);", + " __pyx_r = __pyx_v_arr;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_arr);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_x);", + " return __pyx_r;", + "}", + "", + "static __Pyx_InternTabEntry __pyx_intern_tab[] = {", + " {&__pyx_n_ArgumentError, \"ArgumentError\"},", + " {&__pyx_n_Float64, \"Float64\"},", + " {&__pyx_n_Int, \"Int\"},", + " {&__pyx_n_MT19937, \"MT19937\"},", + " {&__pyx_n_ValueError, \"ValueError\"},", + " {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},", + " {&__pyx_n__rand, \"_rand\"},", + " {&__pyx_n__sp, \"_sp\"},", + " {&__pyx_n_add, \"add\"},", + " {&__pyx_n_append, \"append\"},", + " {&__pyx_n_arange, \"arange\"},", + " {&__pyx_n_array, \"array\"},", + " {&__pyx_n_beta, \"beta\"},", + " {&__pyx_n_binomial, \"binomial\"},", + " {&__pyx_n_bytes, \"bytes\"},", + " {&__pyx_n_chisquare, \"chisquare\"},", + " {&__pyx_n_empty, \"empty\"},", + " {&__pyx_n_exponential, \"exponential\"},", + " {&__pyx_n_f, \"f\"},", + " {&__pyx_n_gamma, \"gamma\"},", + " {&__pyx_n_geometric, \"geometric\"},", + " {&__pyx_n_get_state, \"get_state\"},", + " {&__pyx_n_gumbel, \"gumbel\"},", + " {&__pyx_n_hypergeometric, \"hypergeometric\"},", + " {&__pyx_n_int, \"int\"},", + " {&__pyx_n_isinstance, \"isinstance\"},", + " {&__pyx_n_laplace, \"laplace\"},", + " {&__pyx_n_len, \"len\"},", + " {&__pyx_n_list, \"list\"},", + " {&__pyx_n_logistic, \"logistic\"},", + " {&__pyx_n_lognormal, \"lognormal\"},", + " {&__pyx_n_logseries, \"logseries\"},", + " {&__pyx_n_matrixmultiply, \"matrixmultiply\"},", + " {&__pyx_n_multinomial, \"multinomial\"},", + " {&__pyx_n_multiply, \"multiply\"},", + " {&__pyx_n_multivariate_normal, \"multivariate_normal\"},", + " {&__pyx_n_negative_binomial, \"negative_binomial\"},", + " {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},", + " {&__pyx_n_noncentral_f, \"noncentral_f\"},", + " {&__pyx_n_normal, \"normal\"},", + " {&__pyx_n_numpy, \"numpy\"},", + " {&__pyx_n_pareto, \"pareto\"},", + " {&__pyx_n_permutation, \"permutation\"},", + " {&__pyx_n_poisson, \"poisson\"},", + " {&__pyx_n_power, \"power\"},", + " {&__pyx_n_rand, \"rand\"},", + " {&__pyx_n_randint, \"randint\"},", + " {&__pyx_n_randn, \"randn\"},", + " {&__pyx_n_random, \"random\"},", + " {&__pyx_n_random_integers, \"random_integers\"},", + " {&__pyx_n_random_sample, \"random_sample\"},", + " {&__pyx_n_rayleigh, \"rayleigh\"},", + " {&__pyx_n_reduce, \"reduce\"},", + " {&__pyx_n_seed, \"seed\"},", + " {&__pyx_n_set_state, \"set_state\"},", + " {&__pyx_n_shape, \"shape\"},", + " {&__pyx_n_shuffle, \"shuffle\"},", + " {&__pyx_n_size, \"size\"},", + " {&__pyx_n_sqrt, \"sqrt\"},", + " {&__pyx_n_standard_cauchy, \"standard_cauchy\"},", + " {&__pyx_n_standard_exponential, \"standard_exponential\"},", + " {&__pyx_n_standard_gamma, \"standard_gamma\"},", + " {&__pyx_n_standard_normal, \"standard_normal\"},", + " {&__pyx_n_standard_t, \"standard_t\"},", + " {&__pyx_n_svd, \"svd\"},", + " {&__pyx_n_triangular, \"triangular\"},", + " {&__pyx_n_tuple, \"tuple\"},", + " {&__pyx_n_type, \"type\"},", + " {&__pyx_n_uniform, \"uniform\"},", + " {&__pyx_n_vonmises, \"vonmises\"},", + " {&__pyx_n_wald, \"wald\"},", + " {&__pyx_n_weibull, \"weibull\"},", + " {&__pyx_n_zeros, \"zeros\"},", + " {&__pyx_n_zipf, \"zipf\"},", + " {0, 0}", + "};", + "", + "static __Pyx_StringTabEntry __pyx_string_tab[] = {", + " {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},", + " {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},", + " {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},", + " {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},", + " {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},", + " {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},", + " {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},", + " {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},", + " {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},", + " {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},", + " {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},", + " {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},", + " {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},", + " {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},", + " {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},", + " {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},", + " {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},", + " {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},", + " {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},", + " {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},", + " {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},", + " {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},", + " {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},", + " {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},", + " {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},", + " {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},", + " {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},", + " {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},", + " {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},", + " {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},", + " {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},", + " {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},", + " {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},", + " {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},", + " {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},", + " {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},", + " {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},", + " {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},", + " {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},", + " {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},", + " {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},", + " {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},", + " {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},", + " {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},", + " {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},", + " {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},", + " {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},", + " {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},", + " {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},", + " {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},", + " {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},", + " {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},", + " {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},", + " {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},", + " {0, 0, 0}", + "};", + "", + "static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {", + " PyObject *o = (*t->tp_alloc)(t, 0);", + " struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;", + " return o;", + "}", + "", + "static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {", + " {", + " PyObject *etype, *eval, *etb;", + " PyErr_Fetch(&etype, &eval, &etb);", + " ++o->ob_refcnt;", + " __pyx_f_6mtrand_11RandomState___dealloc__(o);", + " if (PyErr_Occurred()) PyErr_WriteUnraisable(o);", + " --o->ob_refcnt;", + " PyErr_Restore(etype, eval, etb);", + " }", + " (*o->ob_type->tp_free)(o);", + "}", + "", + "static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {", + " return 0;", + "}", + "", + "static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {", + " return 0;", + "}", + "", + "static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {", + " {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},", + " {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},", + " {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},", + " {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},", + " {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},", + " {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},", + " {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},", + " {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},", + " {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},", + " {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},", + " {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},", + " {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},", + " {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},", + " {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},", + " {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},", + " {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},", + " {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},", + " {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},", + " {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},", + " {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},", + " {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},", + " {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},", + " {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},", + " {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},", + " {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},", + " {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},", + " {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},", + " {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},", + " {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},", + " {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},", + " {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},", + " {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},", + " {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},", + " {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},", + " {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},", + " {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},", + " {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},", + " {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},", + " {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},", + " {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},", + " {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},", + " {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},", + " {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},", + " {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},", + " {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},", + " {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},", + " {0, 0, 0, 0}", + "};", + "", + "static PyNumberMethods __pyx_tp_as_number_RandomState = {", + " 0, /*nb_add*/", + " 0, /*nb_subtract*/", + " 0, /*nb_multiply*/", + " 0, /*nb_divide*/", + " 0, /*nb_remainder*/", + " 0, /*nb_divmod*/", + " 0, /*nb_power*/", + " 0, /*nb_negative*/", + " 0, /*nb_positive*/", + " 0, /*nb_absolute*/", + " 0, /*nb_nonzero*/", + " 0, /*nb_invert*/", + " 0, /*nb_lshift*/", + " 0, /*nb_rshift*/", + " 0, /*nb_and*/", + " 0, /*nb_xor*/", + " 0, /*nb_or*/", + " 0, /*nb_coerce*/", + " 0, /*nb_int*/", + " 0, /*nb_long*/", + " 0, /*nb_float*/", + " 0, /*nb_oct*/", + " 0, /*nb_hex*/", + " 0, /*nb_inplace_add*/", + " 0, /*nb_inplace_subtract*/", + " 0, /*nb_inplace_multiply*/", + " 0, /*nb_inplace_divide*/", + " 0, /*nb_inplace_remainder*/", + " 0, /*nb_inplace_power*/", + " 0, /*nb_inplace_lshift*/", + " 0, /*nb_inplace_rshift*/", + " 0, /*nb_inplace_and*/", + " 0, /*nb_inplace_xor*/", + " 0, /*nb_inplace_or*/", + " 0, /*nb_floor_divide*/", + " 0, /*nb_true_divide*/", + " 0, /*nb_inplace_floor_divide*/", + " 0, /*nb_inplace_true_divide*/", + "};", + "", + "static PySequenceMethods __pyx_tp_as_sequence_RandomState = {", + " 0, /*sq_length*/", + " 0, /*sq_concat*/", + " 0, /*sq_repeat*/", + " 0, /*sq_item*/", + " 0, /*sq_slice*/", + " 0, /*sq_ass_item*/", + " 0, /*sq_ass_slice*/", + " 0, /*sq_contains*/", + " 0, /*sq_inplace_concat*/", + " 0, /*sq_inplace_repeat*/", + "};", + "", + "static PyMappingMethods __pyx_tp_as_mapping_RandomState = {", + " 0, /*mp_length*/", + " 0, /*mp_subscript*/", + " 0, /*mp_ass_subscript*/", + "};", + "", + "static PyBufferProcs __pyx_tp_as_buffer_RandomState = {", + " 0, /*bf_getreadbuffer*/", + " 0, /*bf_getwritebuffer*/", + " 0, /*bf_getsegcount*/", + " 0, /*bf_getcharbuffer*/", + "};", + "", + "statichere PyTypeObject __pyx_type_6mtrand_RandomState = {", + " PyObject_HEAD_INIT(0)", + " 0, /*ob_size*/", + " \"mtrand.RandomState\", /*tp_name*/", + " sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/", + " 0, /*tp_itemsize*/", + " __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/", + " 0, /*tp_print*/", + " 0, /*tp_getattr*/", + " 0, /*tp_setattr*/", + " 0, /*tp_compare*/", + " 0, /*tp_repr*/", + " &__pyx_tp_as_number_RandomState, /*tp_as_number*/", + " &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/", + " &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/", + " 0, /*tp_hash*/", + " 0, /*tp_call*/", + " 0, /*tp_str*/", + " 0, /*tp_getattro*/", + " 0, /*tp_setattro*/", + " &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/", + " Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/", + " \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/", + " __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/", + " __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/", + " 0, /*tp_richcompare*/", + " 0, /*tp_weaklistoffset*/", + " 0, /*tp_iter*/", + " 0, /*tp_iternext*/", + " __pyx_methods_6mtrand_RandomState, /*tp_methods*/", + " 0, /*tp_members*/", + " 0, /*tp_getset*/", + " 0, /*tp_base*/", + " 0, /*tp_dict*/", + " 0, /*tp_descr_get*/", + " 0, /*tp_descr_set*/", + " 0, /*tp_dictoffset*/", + " __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/", + " 0, /*tp_alloc*/", + " __pyx_tp_new_6mtrand_RandomState, /*tp_new*/", + " 0, /*tp_free*/", + " 0, /*tp_is_gc*/", + " 0, /*tp_bases*/", + " 0, /*tp_mro*/", + " 0, /*tp_cache*/", + " 0, /*tp_subclasses*/", + " 0, /*tp_weaklist*/", + "};", + "", + "static struct PyMethodDef __pyx_methods[] = {", + " {0, 0, 0, 0}", + "};", + "", + "DL_EXPORT(void) initmtrand(void); /*proto*/", + "DL_EXPORT(void) initmtrand(void) {", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);", + " if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " __pyx_b = PyImport_AddModule(\"__builtin__\");", + " if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}", + " __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}", + " if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}", + " if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}", + " __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */", + " import_array();", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */", + " __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}", + " if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */", + " Py_INCREF(Py_None);", + " __pyx_k2 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */", + " Py_INCREF(Py_None);", + " __pyx_k3 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */", + " Py_INCREF(Py_None);", + " __pyx_k4 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */", + " Py_INCREF(Py_None);", + " __pyx_k5 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */", + " Py_INCREF(Py_None);", + " __pyx_k6 = Py_None;", + " Py_INCREF(Py_None);", + " __pyx_k7 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */", + " __pyx_k8 = 0.0;", + " __pyx_k9 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k10 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */", + " Py_INCREF(Py_None);", + " __pyx_k11 = Py_None;", + " Py_INCREF(Py_None);", + " __pyx_k12 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */", + " Py_INCREF(Py_None);", + " __pyx_k13 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */", + " __pyx_k14 = 0.0;", + " __pyx_k15 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k16 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */", + " Py_INCREF(Py_None);", + " __pyx_k17 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */", + " __pyx_k18 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k19 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */", + " Py_INCREF(Py_None);", + " __pyx_k20 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */", + " Py_INCREF(Py_None);", + " __pyx_k21 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */", + " __pyx_k22 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k23 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */", + " Py_INCREF(Py_None);", + " __pyx_k24 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */", + " Py_INCREF(Py_None);", + " __pyx_k25 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */", + " Py_INCREF(Py_None);", + " __pyx_k26 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */", + " Py_INCREF(Py_None);", + " __pyx_k27 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */", + " Py_INCREF(Py_None);", + " __pyx_k28 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */", + " Py_INCREF(Py_None);", + " __pyx_k29 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */", + " Py_INCREF(Py_None);", + " __pyx_k30 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */", + " Py_INCREF(Py_None);", + " __pyx_k31 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */", + " Py_INCREF(Py_None);", + " __pyx_k32 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */", + " Py_INCREF(Py_None);", + " __pyx_k33 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */", + " __pyx_k34 = 0.0;", + " __pyx_k35 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k36 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */", + " __pyx_k37 = 0.0;", + " __pyx_k38 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k39 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */", + " __pyx_k40 = 0.0;", + " __pyx_k41 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k42 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */", + " __pyx_k43 = 0.0;", + " __pyx_k44 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k45 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */", + " __pyx_k46 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k47 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */", + " Py_INCREF(Py_None);", + " __pyx_k48 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */", + " Py_INCREF(Py_None);", + " __pyx_k49 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */", + " Py_INCREF(Py_None);", + " __pyx_k50 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */", + " Py_INCREF(Py_None);", + " __pyx_k51 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */", + " __pyx_k52 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k53 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */", + " Py_INCREF(Py_None);", + " __pyx_k54 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */", + " Py_INCREF(Py_None);", + " __pyx_k55 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */", + " Py_INCREF(Py_None);", + " __pyx_k56 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */", + " Py_INCREF(Py_None);", + " __pyx_k57 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */", + " Py_INCREF(Py_None);", + " __pyx_k58 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */", + " Py_INCREF(Py_None);", + " __pyx_k59 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */", + " __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " return;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " __Pyx_AddTraceback(\"mtrand\");", + "}", + "", + "static char *__pyx_filenames[] = {", + " \"mtrand.pyx\",", + " \"numpy.pxi\",", + "};", + "statichere char **__pyx_f = __pyx_filenames;", + "", + "/* Runtime support code */", + "", + "static int __Pyx_GetStarArgs(", + " PyObject **args,", + " PyObject **kwds,", + " char *kwd_list[],", + " int nargs,", + " PyObject **args2,", + " PyObject **kwds2)", + "{", + " PyObject *x = 0, *args1 = 0, *kwds1 = 0;", + "", + " if (args2)", + " *args2 = 0;", + " if (kwds2)", + " *kwds2 = 0;", + "", + " if (args2) {", + " args1 = PyTuple_GetSlice(*args, 0, nargs);", + " if (!args1)", + " goto bad;", + " *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));", + " if (!*args2)", + " goto bad;", + " }", + " else {", + " args1 = *args;", + " Py_INCREF(args1);", + " }", + "", + " if (kwds2) {", + " if (*kwds) {", + " char **p;", + " kwds1 = PyDict_New();", + " if (!kwds)", + " goto bad;", + " *kwds2 = PyDict_Copy(*kwds);", + " if (!*kwds2)", + " goto bad;", + " for (p = kwd_list; *p; p++) {", + " x = PyDict_GetItemString(*kwds, *p);", + " if (x) {", + " if (PyDict_SetItemString(kwds1, *p, x) < 0)", + " goto bad;", + " if (PyDict_DelItemString(*kwds2, *p) < 0)", + " goto bad;", + " }", + " }", + " }", + " else {", + " *kwds2 = PyDict_New();", + " if (!*kwds2)", + " goto bad;", + " }", + " }", + " else {", + " kwds1 = *kwds;", + " Py_XINCREF(kwds1);", + " }", + "", + " *args = args1;", + " *kwds = kwds1;", + " return 0;", + "bad:", + " Py_XDECREF(args1);", + " Py_XDECREF(kwds1);", + " Py_XDECREF(*args2);", + " Py_XDECREF(*kwds2);", + " return -1;", + "}", + "", + "static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {", + " PyObject *__import__ = 0;", + " PyObject *empty_list = 0;", + " PyObject *module = 0;", + " PyObject *global_dict = 0;", + " PyObject *empty_dict = 0;", + " PyObject *list;", + " __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");", + " if (!__import__)", + " goto bad;", + " if (from_list)", + " list = from_list;", + " else {", + " empty_list = PyList_New(0);", + " if (!empty_list)", + " goto bad;", + " list = empty_list;", + " }", + " global_dict = PyModule_GetDict(__pyx_m);", + " if (!global_dict)", + " goto bad;", + " empty_dict = PyDict_New();", + " if (!empty_dict)", + " goto bad;", + " module = PyObject_CallFunction(__import__, \"OOOO\",", + " name, global_dict, empty_dict, list);", + "bad:", + " Py_XDECREF(empty_list);", + " Py_XDECREF(__import__);", + " Py_XDECREF(empty_dict);", + " return module;", + "}", + "", + "static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {", + " PyObject *result;", + " result = PyObject_GetAttr(dict, name);", + " if (!result)", + " PyErr_SetObject(PyExc_NameError, name);", + " return result;", + "}", + "", + "static void __Pyx_WriteUnraisable(char *name) {", + " PyObject *old_exc, *old_val, *old_tb;", + " PyObject *ctx;", + " PyErr_Fetch(&old_exc, &old_val, &old_tb);", + " ctx = PyString_FromString(name);", + " PyErr_Restore(old_exc, old_val, old_tb);", + " if (!ctx)", + " ctx = Py_None;", + " PyErr_WriteUnraisable(ctx);", + "}", + "", + "static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {", + " Py_XINCREF(type);", + " Py_XINCREF(value);", + " Py_XINCREF(tb);", + " /* First, check the traceback argument, replacing None with NULL. */", + " if (tb == Py_None) {", + " Py_DECREF(tb);", + " tb = 0;", + " }", + " else if (tb != NULL && !PyTraceBack_Check(tb)) {", + " PyErr_SetString(PyExc_TypeError,", + " \"raise: arg 3 must be a traceback or None\");", + " goto raise_error;", + " }", + " /* Next, replace a missing value with None */", + " if (value == NULL) {", + " value = Py_None;", + " Py_INCREF(value);", + " }", + " /* Next, repeatedly, replace a tuple exception with its first item */", + " while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {", + " PyObject *tmp = type;", + " type = PyTuple_GET_ITEM(type, 0);", + " Py_INCREF(type);", + " Py_DECREF(tmp);", + " }", + " if (PyString_Check(type))", + " ;", + " else if (PyClass_Check(type))", + " ; /*PyErr_NormalizeException(&type, &value, &tb);*/", + " else if (PyInstance_Check(type)) {", + " /* Raising an instance. The value should be a dummy. */", + " if (value != Py_None) {", + " PyErr_SetString(PyExc_TypeError,", + " \"instance exception may not have a separate value\");", + " goto raise_error;", + " }", + " else {", + " /* Normalize to raise , */", + " Py_DECREF(value);", + " value = type;", + " type = (PyObject*) ((PyInstanceObject*)type)->in_class;", + " Py_INCREF(type);", + " }", + " }", + " else {", + " /* Not something you can raise. You get an exception", + " anyway, just not what you specified :-) */", + " PyErr_Format(PyExc_TypeError,", + " \"exceptions must be strings, classes, or \"", + " \"instances, not %s\", type->ob_type->tp_name);", + " goto raise_error;", + " }", + " PyErr_Restore(type, value, tb);", + " return;", + "raise_error:", + " Py_XDECREF(value);", + " Py_XDECREF(type);", + " Py_XDECREF(tb);", + " return;", + "}", + "", + "static void __Pyx_UnpackError(void) {", + " PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");", + "}", + "", + "static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {", + " PyObject *item = PySequence_GetItem(seq, i);", + " if (!item) {", + " if (PyErr_ExceptionMatches(PyExc_IndexError))", + " __Pyx_UnpackError();", + " }", + " return item;", + "}", + "", + "static int __Pyx_EndUnpack(PyObject *seq, int i) {", + " PyObject *item = PySequence_GetItem(seq, i);", + " if (item) {", + " Py_DECREF(item);", + " __Pyx_UnpackError();", + " return -1;", + " }", + " PyErr_Clear();", + " return 0;", + "}", + "", + "static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {", + " while (t->p) {", + " *t->p = PyString_InternFromString(t->s);", + " if (!*t->p)", + " return -1;", + " ++t;", + " }", + " return 0;", + "}", + "", + "static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {", + " while (t->p) {", + " *t->p = PyString_FromStringAndSize(t->s, t->n - 1);", + " if (!*t->p)", + " return -1;", + " ++t;", + " }", + " return 0;", + "}", + "", + "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,", + " long size)", + "{", + " PyObject *py_module_name = 0;", + " PyObject *py_class_name = 0;", + " PyObject *py_name_list = 0;", + " PyObject *py_module = 0;", + " PyObject *result = 0;", + "", + " py_module_name = PyString_FromString(module_name);", + " if (!py_module_name)", + " goto bad;", + " py_class_name = PyString_FromString(class_name);", + " if (!py_class_name)", + " goto bad;", + " py_name_list = PyList_New(1);", + " if (!py_name_list)", + " goto bad;", + " Py_INCREF(py_class_name);", + " if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)", + " goto bad;", + " py_module = __Pyx_Import(py_module_name, py_name_list);", + " if (!py_module)", + " goto bad;", + " result = PyObject_GetAttr(py_module, py_class_name);", + " if (!result)", + " goto bad;", + " if (!PyType_Check(result)) {", + " PyErr_Format(PyExc_TypeError,", + " \"%s.%s is not a type object\",", + " module_name, class_name);", + " goto bad;", + " }", + " if (((PyTypeObject *)result)->tp_basicsize != size) {", + " PyErr_Format(PyExc_ValueError,", + " \"%s.%s does not appear to be the correct type object\",", + " module_name, class_name);", + " goto bad;", + " }", + " goto done;", + "bad:", + " Py_XDECREF(result);", + " result = 0;", + "done:", + " Py_XDECREF(py_module_name);", + " Py_XDECREF(py_class_name);", + " Py_XDECREF(py_name_list);", + " return (PyTypeObject *)result;", + "}", + "", + "#include \"compile.h\"", + "#include \"frameobject.h\"", + "#include \"traceback.h\"", + "", + "static void __Pyx_AddTraceback(char *funcname) {", + " PyObject *py_srcfile = 0;", + " PyObject *py_funcname = 0;", + " PyObject *py_globals = 0;", + " PyObject *empty_tuple = 0;", + " PyObject *empty_string = 0;", + " PyCodeObject *py_code = 0;", + " PyFrameObject *py_frame = 0;", + "", + " py_srcfile = PyString_FromString(__pyx_filename);", + " if (!py_srcfile) goto bad;", + " py_funcname = PyString_FromString(funcname);", + " if (!py_funcname) goto bad;", + " py_globals = PyModule_GetDict(__pyx_m);", + " if (!py_globals) goto bad;", + " empty_tuple = PyTuple_New(0);", + " if (!empty_tuple) goto bad;", + " empty_string = PyString_FromString(\"\");", + " if (!empty_string) goto bad;", + " py_code = PyCode_New(", + " 0, /*int argcount,*/", + " 0, /*int nlocals,*/", + " 0, /*int stacksize,*/", + " 0, /*int flags,*/", + " empty_string, /*PyObject *code,*/", + " empty_tuple, /*PyObject *consts,*/", + " empty_tuple, /*PyObject *names,*/", + " empty_tuple, /*PyObject *varnames,*/", + " empty_tuple, /*PyObject *freevars,*/", + " empty_tuple, /*PyObject *cellvars,*/", + " py_srcfile, /*PyObject *filename,*/", + " py_funcname, /*PyObject *name,*/", + " __pyx_lineno, /*int firstlineno,*/", + " empty_string /*PyObject *lnotab*/", + " );", + " if (!py_code) goto bad;", + " py_frame = PyFrame_New(", + " PyThreadState_Get(), /*PyThreadState *tstate,*/", + " py_code, /*PyCodeObject *code,*/", + " py_globals, /*PyObject *globals,*/", + " 0 /*PyObject *locals*/", + " );", + " if (!py_frame) goto bad;", + " py_frame->f_lineno = __pyx_lineno;", + " PyTraceBack_Here(py_frame);", + "bad:", + " Py_XDECREF(py_srcfile);", + " Py_XDECREF(py_funcname);", + " Py_XDECREF(empty_tuple);", + " Py_XDECREF(empty_string);", + " Py_XDECREF(py_code);", + " Py_XDECREF(py_frame);", + "}" + ] + } + } + ] + }, + { + "hash": "fb605c6e86e09a4366af88ddf6e843d7adba5876", + "msg": "I don't understand why this wasn't included before.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T03:21:43+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T03:21:43+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "416bf3771b9d78ca0a4371b7b92d426d32922e48" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 0, + "insertions": 5990, + "lines": 5990, + "files": 1, + "dmm_unit_size": 0.021723896285914507, + "dmm_unit_complexity": 0.09039943938332165, + "dmm_unit_interfacing": 0.12777388460640038, + "modified_files": [ + { + "old_path": null, + "new_path": "numpy/random/mtrand/mtrand.c", + "filename": "mtrand.c", + "extension": "c", + "change_type": "ADD", + "diff": "@@ -0,0 +1,5990 @@\n+/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */\n+\n+#include \"Python.h\"\n+#include \"structmember.h\"\n+#ifndef PY_LONG_LONG\n+ #define PY_LONG_LONG LONG_LONG\n+#endif\n+#include \"string.h\"\n+#include \"math.h\"\n+#include \"numpy/arrayobject.h\"\n+#include \"randomkit.h\"\n+#include \"distributions.h\"\n+#include \"initarray.h\"\n+\n+\n+typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\n+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\n+static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\n+static int __Pyx_EndUnpack(PyObject *, int); /*proto*/\n+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\n+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\n+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\n+static void __Pyx_WriteUnraisable(char *name); /*proto*/\n+static void __Pyx_AddTraceback(char *funcname); /*proto*/\n+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\n+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\n+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\n+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n+\n+static PyObject *__pyx_m;\n+static PyObject *__pyx_b;\n+static int __pyx_lineno;\n+static char *__pyx_filename;\n+staticforward char **__pyx_f;\n+\n+/* Declarations from mtrand */\n+\n+staticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n+\n+struct __pyx_obj_6mtrand_RandomState {\n+ PyObject_HEAD\n+ rk_state (*internal_state);\n+};\n+\n+static PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\n+static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\n+static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\n+static PyObject *__pyx_k2;\n+static PyObject *__pyx_k3;\n+static PyObject *__pyx_k4;\n+static PyObject *__pyx_k5;\n+static PyObject *__pyx_k6;\n+static PyObject *__pyx_k7;\n+static double __pyx_k8;\n+static double __pyx_k9;\n+static PyObject *__pyx_k10;\n+static PyObject *__pyx_k11;\n+static PyObject *__pyx_k12;\n+static PyObject *__pyx_k13;\n+static double __pyx_k14;\n+static double __pyx_k15;\n+static PyObject *__pyx_k16;\n+static PyObject *__pyx_k17;\n+static double __pyx_k18;\n+static PyObject *__pyx_k19;\n+static PyObject *__pyx_k20;\n+static PyObject *__pyx_k21;\n+static double __pyx_k22;\n+static PyObject *__pyx_k23;\n+static PyObject *__pyx_k24;\n+static PyObject *__pyx_k25;\n+static PyObject *__pyx_k26;\n+static PyObject *__pyx_k27;\n+static PyObject *__pyx_k28;\n+static PyObject *__pyx_k29;\n+static PyObject *__pyx_k30;\n+static PyObject *__pyx_k31;\n+static PyObject *__pyx_k32;\n+static PyObject *__pyx_k33;\n+static double __pyx_k34;\n+static double __pyx_k35;\n+static PyObject *__pyx_k36;\n+static double __pyx_k37;\n+static double __pyx_k38;\n+static PyObject *__pyx_k39;\n+static double __pyx_k40;\n+static double __pyx_k41;\n+static PyObject *__pyx_k42;\n+static double __pyx_k43;\n+static double __pyx_k44;\n+static PyObject *__pyx_k45;\n+static double __pyx_k46;\n+static PyObject *__pyx_k47;\n+static PyObject *__pyx_k48;\n+static PyObject *__pyx_k49;\n+static PyObject *__pyx_k50;\n+static PyObject *__pyx_k51;\n+static double __pyx_k52;\n+static PyObject *__pyx_k53;\n+static PyObject *__pyx_k54;\n+static PyObject *__pyx_k55;\n+static PyObject *__pyx_k56;\n+static PyObject *__pyx_k57;\n+static PyObject *__pyx_k58;\n+static PyObject *__pyx_k59;\n+static PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\n+static PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\n+static double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n+\n+/* Implementation of mtrand */\n+\n+\n+static PyObject *__pyx_n__sp;\n+static PyObject *__pyx_n__rand;\n+static PyObject *__pyx_n_seed;\n+static PyObject *__pyx_n_get_state;\n+static PyObject *__pyx_n_set_state;\n+static PyObject *__pyx_n_random_sample;\n+static PyObject *__pyx_n_randint;\n+static PyObject *__pyx_n_bytes;\n+static PyObject *__pyx_n_uniform;\n+static PyObject *__pyx_n_rand;\n+static PyObject *__pyx_n_randn;\n+static PyObject *__pyx_n_random_integers;\n+static PyObject *__pyx_n_standard_normal;\n+static PyObject *__pyx_n_normal;\n+static PyObject *__pyx_n_beta;\n+static PyObject *__pyx_n_exponential;\n+static PyObject *__pyx_n_standard_exponential;\n+static PyObject *__pyx_n_standard_gamma;\n+static PyObject *__pyx_n_gamma;\n+static PyObject *__pyx_n_f;\n+static PyObject *__pyx_n_noncentral_f;\n+static PyObject *__pyx_n_chisquare;\n+static PyObject *__pyx_n_noncentral_chisquare;\n+static PyObject *__pyx_n_standard_cauchy;\n+static PyObject *__pyx_n_standard_t;\n+static PyObject *__pyx_n_vonmises;\n+static PyObject *__pyx_n_pareto;\n+static PyObject *__pyx_n_weibull;\n+static PyObject *__pyx_n_power;\n+static PyObject *__pyx_n_laplace;\n+static PyObject *__pyx_n_gumbel;\n+static PyObject *__pyx_n_logistic;\n+static PyObject *__pyx_n_lognormal;\n+static PyObject *__pyx_n_rayleigh;\n+static PyObject *__pyx_n_wald;\n+static PyObject *__pyx_n_triangular;\n+static PyObject *__pyx_n_binomial;\n+static PyObject *__pyx_n_negative_binomial;\n+static PyObject *__pyx_n_poisson;\n+static PyObject *__pyx_n_zipf;\n+static PyObject *__pyx_n_geometric;\n+static PyObject *__pyx_n_hypergeometric;\n+static PyObject *__pyx_n_logseries;\n+static PyObject *__pyx_n_multivariate_normal;\n+static PyObject *__pyx_n_multinomial;\n+static PyObject *__pyx_n_shuffle;\n+static PyObject *__pyx_n_permutation;\n+static PyObject *__pyx_n_numpy;\n+\n+static PyObject *__pyx_n_empty;\n+static PyObject *__pyx_n_Float64;\n+\n+static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n+ double (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n+ __pyx_v_array_data = ((double (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.cont0_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n+ double (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n+ __pyx_v_array_data = ((double (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.cont1_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n+ double (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n+ __pyx_v_array_data = ((double (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.cont2_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n+ double (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n+ __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n+ __pyx_v_array_data = ((double (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.cont3_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_Int;\n+\n+static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n+ long (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n+ __pyx_v_array_data = ((long (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.disc0_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n+ long (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n+ __pyx_v_array_data = ((long (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.discnp_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n+ long (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n+ __pyx_v_array_data = ((long (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n+ long (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n+ __pyx_v_array_data = ((long (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n+ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.discd_array\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n+ double __pyx_v_c;\n+ double __pyx_v_y;\n+ double __pyx_v_t;\n+ double __pyx_v_sum;\n+ long __pyx_v_i;\n+ double __pyx_r;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n+ __pyx_v_sum = (__pyx_v_darr[0]);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n+ __pyx_v_c = 0.0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n+ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n+ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n+ __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n+ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n+ __pyx_v_sum = __pyx_v_t;\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n+ __pyx_r = __pyx_v_sum;\n+ goto __pyx_L0;\n+\n+ __pyx_r = 0;\n+ goto __pyx_L0;\n+ __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n+ __pyx_L0:;\n+ return __pyx_r;\n+}\n+\n+static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_seed = 0;\n+ int __pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ static char *__pyx_argnames[] = {\"seed\",0};\n+ __pyx_v_seed = __pyx_k2;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_seed);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n+ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_seed);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ __pyx_r = 0;\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n+ __pyx_r = -1;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_seed);\n+ return __pyx_r;\n+}\n+\n+static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\n+static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n+ int __pyx_1;\n+ Py_INCREF(__pyx_v_self);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n+ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n+ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ goto __pyx_L0;\n+ __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+}\n+\n+static PyObject *__pyx_n_type;\n+static PyObject *__pyx_n_int;\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_seed = 0;\n+ rk_error __pyx_v_errcode;\n+ PyArrayObject *arrayObject_obj;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ unsigned long __pyx_5;\n+ static char *__pyx_argnames[] = {\"seed\",0};\n+ __pyx_v_seed = __pyx_k3;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_seed);\n+ arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n+ __pyx_1 = __pyx_v_seed == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n+ __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n+ goto __pyx_L2;\n+ }\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_seed);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n+ __pyx_1 = __pyx_4 == __pyx_2;\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n+ __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n+ rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n+ __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n+ Py_INCREF(((PyObject *)__pyx_3));\n+ Py_DECREF(((PyObject *)arrayObject_obj));\n+ arrayObject_obj = ((PyArrayObject *)__pyx_3);\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n+ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject_obj);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_seed);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_MT19937;\n+\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyArrayObject *arrayObject_state;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n+ __pyx_1 = 0;\n+ __pyx_4 = 0;\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_INCREF(((PyObject *)__pyx_1));\n+ Py_DECREF(((PyObject *)arrayObject_state));\n+ arrayObject_state = ((PyArrayObject *)__pyx_1);\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n+ memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n+ __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n+ Py_INCREF(__pyx_n_MT19937);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n+ Py_INCREF(((PyObject *)arrayObject_state));\n+ PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n+ PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject_state);\n+ Py_DECREF(__pyx_v_self);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_ValueError;\n+\n+static PyObject *__pyx_k62p;\n+static PyObject *__pyx_k63p;\n+\n+static char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\n+static char (__pyx_k63[]) = \"state must be 624 longs\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_state = 0;\n+ PyArrayObject *arrayObject_obj;\n+ int __pyx_v_pos;\n+ PyObject *__pyx_v_algorithm_name;\n+ PyObject *__pyx_v_key;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ int __pyx_3;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"state\",0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_state);\n+ arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n+ __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n+ __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_v_algorithm_name);\n+ __pyx_v_algorithm_name = __pyx_2;\n+ __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n+ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n+ __pyx_3 = __pyx_3 != 0;\n+ if (__pyx_3) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k62p);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n+ __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n+ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n+ __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_key);\n+ __pyx_v_key = __pyx_2;\n+ __pyx_2 = 0;\n+ __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n+ __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ __pyx_v_pos = __pyx_3;\n+ if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n+ __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject_obj));\n+ arrayObject_obj = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n+ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n+ if (__pyx_3) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k63p);\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n+ goto __pyx_L3;\n+ }\n+ __pyx_L3:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n+ memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n+ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject_obj);\n+ Py_DECREF(__pyx_v_algorithm_name);\n+ Py_DECREF(__pyx_v_key);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_state);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ static char *__pyx_argnames[] = {0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_r = __pyx_3;\n+ __pyx_3 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_state = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ static char *__pyx_argnames[] = {\"state\",0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_state);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_state);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_state);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_random;\n+static PyObject *__pyx_n___RandomState_ctor;\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ PyObject *__pyx_5 = 0;\n+ static char *__pyx_argnames[] = {0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n+ __pyx_1 = 0;\n+ __pyx_2 = 0;\n+ __pyx_5 = 0;\n+ __pyx_r = __pyx_3;\n+ __pyx_3 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ Py_XDECREF(__pyx_5);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"size\",0};\n+ __pyx_v_size = __pyx_k4;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"size\",0};\n+ __pyx_v_size = __pyx_k5;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n+ __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k64p;\n+\n+static char (__pyx_k64[]) = \"low >= high\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_low = 0;\n+ PyObject *__pyx_v_high = 0;\n+ PyObject *__pyx_v_size = 0;\n+ long __pyx_v_lo;\n+ long __pyx_v_hi;\n+ long __pyx_v_diff;\n+ long (*__pyx_v_array_data);\n+ PyArrayObject *arrayObject;\n+ long __pyx_v_length;\n+ long __pyx_v_i;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ long __pyx_2;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ PyObject *__pyx_5 = 0;\n+ static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n+ __pyx_v_high = __pyx_k6;\n+ __pyx_v_size = __pyx_k7;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_low);\n+ Py_INCREF(__pyx_v_high);\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n+ __pyx_1 = __pyx_v_high == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n+ __pyx_v_lo = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n+ __pyx_v_hi = __pyx_2;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n+ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n+ __pyx_v_lo = __pyx_2;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n+ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n+ __pyx_v_hi = __pyx_2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n+ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n+ __pyx_1 = (__pyx_v_diff < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n+ __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k64p);\n+ PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n+ __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ __Pyx_Raise(__pyx_5, 0, 0);\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n+ goto __pyx_L3;\n+ }\n+ __pyx_L3:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n+ __pyx_1 = __pyx_v_size == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n+ __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n+ __pyx_r = __pyx_3;\n+ __pyx_3 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L4;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n+ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_INCREF(((PyObject *)__pyx_4));\n+ Py_DECREF(((PyObject *)arrayObject));\n+ arrayObject = ((PyArrayObject *)__pyx_4);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n+ __pyx_v_length = PyArray_SIZE(arrayObject);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n+ __pyx_v_array_data = ((long (*))arrayObject->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n+ (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n+ Py_INCREF(((PyObject *)arrayObject));\n+ __pyx_r = ((PyObject *)arrayObject);\n+ goto __pyx_L0;\n+ }\n+ __pyx_L4:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ Py_XDECREF(__pyx_5);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_low);\n+ Py_DECREF(__pyx_v_high);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ unsigned int __pyx_v_length;\n+ void (*__pyx_v_bytes);\n+ PyObject *__pyx_v_bytestring;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"length\",0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n+ __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n+ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n+ __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_bytestring);\n+ __pyx_v_bytestring = __pyx_1;\n+ __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n+ PyMem_Free(__pyx_v_bytes);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n+ Py_INCREF(__pyx_v_bytestring);\n+ __pyx_r = __pyx_v_bytestring;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_bytestring);\n+ Py_DECREF(__pyx_v_self);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_low;\n+ double __pyx_v_high;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n+ __pyx_v_low = __pyx_k8;\n+ __pyx_v_high = __pyx_k9;\n+ __pyx_v_size = __pyx_k10;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n+ __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_len;\n+static PyObject *__pyx_n_size;\n+\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_args = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ int __pyx_4;\n+ PyObject *__pyx_5 = 0;\n+ static char *__pyx_argnames[] = {0};\n+ if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n+ Py_XDECREF(__pyx_args);\n+ Py_XDECREF(__pyx_kwds);\n+ Py_XDECREF(__pyx_v_args);\n+ return 0;\n+ }\n+ Py_INCREF(__pyx_v_self);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_args);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n+ if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 == 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n+ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n+ if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n+ __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_r = __pyx_5;\n+ __pyx_5 = 0;\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_5);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_XDECREF(__pyx_v_args);\n+ Py_DECREF(__pyx_v_self);\n+ Py_XDECREF(__pyx_args);\n+ Py_XDECREF(__pyx_kwds);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_args = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ int __pyx_4;\n+ static char *__pyx_argnames[] = {0};\n+ if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n+ Py_XDECREF(__pyx_args);\n+ Py_XDECREF(__pyx_kwds);\n+ Py_XDECREF(__pyx_v_args);\n+ return 0;\n+ }\n+ Py_INCREF(__pyx_v_self);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_args);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n+ if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 == 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_args);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+ }\n+ __pyx_L2:;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_XDECREF(__pyx_v_args);\n+ Py_DECREF(__pyx_v_self);\n+ Py_XDECREF(__pyx_args);\n+ Py_XDECREF(__pyx_kwds);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_low = 0;\n+ PyObject *__pyx_v_high = 0;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n+ __pyx_v_high = __pyx_k11;\n+ __pyx_v_size = __pyx_k12;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_low);\n+ Py_INCREF(__pyx_v_high);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n+ __pyx_1 = __pyx_v_high == Py_None;\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n+ Py_INCREF(__pyx_v_low);\n+ Py_DECREF(__pyx_v_high);\n+ __pyx_v_high = __pyx_v_low;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_low);\n+ __pyx_v_low = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n+ __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_low);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n+ __pyx_4 = 0;\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_r = __pyx_4;\n+ __pyx_4 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_low);\n+ Py_DECREF(__pyx_v_high);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"size\",0};\n+ __pyx_v_size = __pyx_k13;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k66p;\n+\n+static char (__pyx_k66[]) = \"scale <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_loc;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n+ __pyx_v_loc = __pyx_k14;\n+ __pyx_v_scale = __pyx_k15;\n+ __pyx_v_size = __pyx_k16;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n+ __pyx_1 = (__pyx_v_scale <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k66p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k67p;\n+static PyObject *__pyx_k68p;\n+\n+static char (__pyx_k67[]) = \"a <= 0\";\n+static char (__pyx_k68[]) = \"b <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_a;\n+ double __pyx_v_b;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n+ __pyx_v_size = __pyx_k17;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n+ __pyx_1 = (__pyx_v_a <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k67p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_b <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k68p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k69p;\n+\n+static char (__pyx_k69[]) = \"scale <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n+ __pyx_v_scale = __pyx_k18;\n+ __pyx_v_size = __pyx_k19;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n+ __pyx_1 = (__pyx_v_scale <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k69p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"size\",0};\n+ __pyx_v_size = __pyx_k20;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k70p;\n+\n+static char (__pyx_k70[]) = \"shape <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_shape;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n+ __pyx_v_size = __pyx_k21;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n+ __pyx_1 = (__pyx_v_shape <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k70p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k71p;\n+static PyObject *__pyx_k72p;\n+\n+static char (__pyx_k71[]) = \"shape <= 0\";\n+static char (__pyx_k72[]) = \"scale <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_shape;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n+ __pyx_v_scale = __pyx_k22;\n+ __pyx_v_size = __pyx_k23;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n+ __pyx_1 = (__pyx_v_shape <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k71p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_scale <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k72p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k73p;\n+static PyObject *__pyx_k74p;\n+\n+static char (__pyx_k73[]) = \"dfnum <= 0\";\n+static char (__pyx_k74[]) = \"dfden <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_dfnum;\n+ double __pyx_v_dfden;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n+ __pyx_v_size = __pyx_k24;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n+ __pyx_1 = (__pyx_v_dfnum <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k73p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_dfden <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k74p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k75p;\n+static PyObject *__pyx_k76p;\n+static PyObject *__pyx_k77p;\n+\n+static char (__pyx_k75[]) = \"dfnum <= 1\";\n+static char (__pyx_k76[]) = \"dfden <= 0\";\n+static char (__pyx_k77[]) = \"nonc < 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_dfnum;\n+ double __pyx_v_dfden;\n+ double __pyx_v_nonc;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n+ __pyx_v_size = __pyx_k25;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n+ __pyx_1 = (__pyx_v_dfnum <= 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k75p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_dfden <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k76p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_nonc < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k77p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n+ __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k78p;\n+\n+static char (__pyx_k78[]) = \"df <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_df;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"df\",\"size\",0};\n+ __pyx_v_size = __pyx_k26;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n+ __pyx_1 = (__pyx_v_df <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k78p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k79p;\n+static PyObject *__pyx_k80p;\n+\n+static char (__pyx_k79[]) = \"df <= 1\";\n+static char (__pyx_k80[]) = \"nonc < 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_df;\n+ double __pyx_v_nonc;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n+ __pyx_v_size = __pyx_k27;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n+ __pyx_1 = (__pyx_v_df <= 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k79p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_nonc < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k80p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ static char *__pyx_argnames[] = {\"size\",0};\n+ __pyx_v_size = __pyx_k28;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n+ __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n+ __pyx_r = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k81p;\n+\n+static char (__pyx_k81[]) = \"df <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_df;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"df\",\"size\",0};\n+ __pyx_v_size = __pyx_k29;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n+ __pyx_1 = (__pyx_v_df <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k81p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k82p;\n+\n+static char (__pyx_k82[]) = \"kappa < 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_mu;\n+ double __pyx_v_kappa;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n+ __pyx_v_size = __pyx_k30;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n+ __pyx_1 = (__pyx_v_kappa < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k82p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k83p;\n+\n+static char (__pyx_k83[]) = \"a <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_a;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"a\",\"size\",0};\n+ __pyx_v_size = __pyx_k31;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n+ __pyx_1 = (__pyx_v_a <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k83p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k84p;\n+\n+static char (__pyx_k84[]) = \"a <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_a;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"a\",\"size\",0};\n+ __pyx_v_size = __pyx_k32;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n+ __pyx_1 = (__pyx_v_a <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k84p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k85p;\n+\n+static char (__pyx_k85[]) = \"a <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_a;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"a\",\"size\",0};\n+ __pyx_v_size = __pyx_k33;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n+ __pyx_1 = (__pyx_v_a <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k85p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k86p;\n+\n+static char (__pyx_k86[]) = \"scale <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_loc;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n+ __pyx_v_loc = __pyx_k34;\n+ __pyx_v_scale = __pyx_k35;\n+ __pyx_v_size = __pyx_k36;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n+ __pyx_1 = (__pyx_v_scale <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k86p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k87p;\n+\n+static char (__pyx_k87[]) = \"scale <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_loc;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n+ __pyx_v_loc = __pyx_k37;\n+ __pyx_v_scale = __pyx_k38;\n+ __pyx_v_size = __pyx_k39;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n+ __pyx_1 = (__pyx_v_scale <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k87p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k88p;\n+\n+static char (__pyx_k88[]) = \"scale <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_loc;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n+ __pyx_v_loc = __pyx_k40;\n+ __pyx_v_scale = __pyx_k41;\n+ __pyx_v_size = __pyx_k42;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n+ __pyx_1 = (__pyx_v_scale <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k88p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k89p;\n+\n+static char (__pyx_k89[]) = \"sigma <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_mean;\n+ double __pyx_v_sigma;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n+ __pyx_v_mean = __pyx_k43;\n+ __pyx_v_sigma = __pyx_k44;\n+ __pyx_v_size = __pyx_k45;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n+ __pyx_1 = (__pyx_v_sigma <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k89p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k90p;\n+\n+static char (__pyx_k90[]) = \"scale <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n+ __pyx_v_scale = __pyx_k46;\n+ __pyx_v_size = __pyx_k47;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n+ __pyx_1 = (__pyx_v_scale <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k90p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n+ __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k91p;\n+static PyObject *__pyx_k92p;\n+\n+static char (__pyx_k91[]) = \"mean <= 0.0\";\n+static char (__pyx_k92[]) = \"scale <= 0.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_mean;\n+ double __pyx_v_scale;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n+ __pyx_v_size = __pyx_k48;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n+ __pyx_1 = (__pyx_v_mean <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k91p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_scale <= 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k92p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n+ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k93p;\n+static PyObject *__pyx_k94p;\n+static PyObject *__pyx_k95p;\n+\n+static char (__pyx_k93[]) = \"left > mode\";\n+static char (__pyx_k94[]) = \"mode > right\";\n+static char (__pyx_k95[]) = \"left == right\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_left;\n+ double __pyx_v_mode;\n+ double __pyx_v_right;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n+ __pyx_v_size = __pyx_k49;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n+ __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k93p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k94p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_left == __pyx_v_right);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k95p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n+ __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k96p;\n+static PyObject *__pyx_k97p;\n+static PyObject *__pyx_k98p;\n+\n+static char (__pyx_k96[]) = \"n <= 0\";\n+static char (__pyx_k97[]) = \"p < 0\";\n+static char (__pyx_k98[]) = \"p > 1\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ long __pyx_v_n;\n+ double __pyx_v_p;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n+ __pyx_v_size = __pyx_k50;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n+ __pyx_1 = (__pyx_v_n <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k96p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k97p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p > 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k98p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n+ __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k99p;\n+static PyObject *__pyx_k100p;\n+static PyObject *__pyx_k101p;\n+\n+static char (__pyx_k99[]) = \"n <= 0\";\n+static char (__pyx_k100[]) = \"p < 0\";\n+static char (__pyx_k101[]) = \"p > 1\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ long __pyx_v_n;\n+ double __pyx_v_p;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n+ __pyx_v_size = __pyx_k51;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n+ __pyx_1 = (__pyx_v_n <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k99p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k100p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p > 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k101p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n+ __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k102p;\n+\n+static char (__pyx_k102[]) = \"lam <= 0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_lam;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n+ __pyx_v_lam = __pyx_k52;\n+ __pyx_v_size = __pyx_k53;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n+ __pyx_1 = (__pyx_v_lam <= 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k102p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k103p;\n+\n+static char (__pyx_k103[]) = \"a <= 1.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_a;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"a\",\"size\",0};\n+ __pyx_v_size = __pyx_k54;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n+ __pyx_1 = (__pyx_v_a <= 1.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k103p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k104p;\n+static PyObject *__pyx_k105p;\n+\n+static char (__pyx_k104[]) = \"p < 0.0\";\n+static char (__pyx_k105[]) = \"p > 1.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_p;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"p\",\"size\",0};\n+ __pyx_v_size = __pyx_k55;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n+ __pyx_1 = (__pyx_v_p < 0.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k104p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p > 1.0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k105p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k106p;\n+static PyObject *__pyx_k107p;\n+static PyObject *__pyx_k108p;\n+static PyObject *__pyx_k109p;\n+\n+static char (__pyx_k106[]) = \"ngood < 1\";\n+static char (__pyx_k107[]) = \"nbad < 1\";\n+static char (__pyx_k108[]) = \"ngood + nbad < nsample\";\n+static char (__pyx_k109[]) = \"nsample < 1\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ long __pyx_v_ngood;\n+ long __pyx_v_nbad;\n+ long __pyx_v_nsample;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n+ __pyx_v_size = __pyx_k56;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n+ __pyx_1 = (__pyx_v_ngood < 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k106p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_nbad < 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k107p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k108p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_nsample < 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k109p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n+ __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_k110p;\n+static PyObject *__pyx_k111p;\n+\n+static char (__pyx_k110[]) = \"p < 0\";\n+static char (__pyx_k111[]) = \"p > 1\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ double __pyx_v_p;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_r;\n+ int __pyx_1;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ PyObject *__pyx_4 = 0;\n+ static char *__pyx_argnames[] = {\"p\",\"size\",0};\n+ __pyx_v_size = __pyx_k57;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_size);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n+ __pyx_1 = (__pyx_v_p < 0);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k110p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_1 = (__pyx_v_p > 1);\n+ if (__pyx_1) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k111p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n+ __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_4, 0, 0);\n+ Py_DECREF(__pyx_4); __pyx_4 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n+ __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n+ __pyx_r = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_4);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_array;\n+static PyObject *__pyx_n_shape;\n+static PyObject *__pyx_n_ArgumentError;\n+static PyObject *__pyx_n_isinstance;\n+static PyObject *__pyx_n_list;\n+static PyObject *__pyx_n_append;\n+static PyObject *__pyx_n_multiply;\n+static PyObject *__pyx_n_reduce;\n+static PyObject *__pyx_n_svd;\n+static PyObject *__pyx_n_matrixmultiply;\n+static PyObject *__pyx_n_sqrt;\n+static PyObject *__pyx_n_add;\n+static PyObject *__pyx_n_tuple;\n+\n+static PyObject *__pyx_k112p;\n+static PyObject *__pyx_k113p;\n+static PyObject *__pyx_k114p;\n+static PyObject *__pyx_k115p;\n+\n+static char (__pyx_k112[]) = \"mean must be 1 dimensional\";\n+static char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\n+static char (__pyx_k114[]) = \"mean and cov must have same length\";\n+static char (__pyx_k115[]) = \"numpy.linalg\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_mean = 0;\n+ PyObject *__pyx_v_cov = 0;\n+ PyObject *__pyx_v_size = 0;\n+ PyObject *__pyx_v_shape;\n+ PyObject *__pyx_v_final_shape;\n+ PyObject *__pyx_v_x;\n+ PyObject *__pyx_v_svd;\n+ PyObject *__pyx_v_u;\n+ PyObject *__pyx_v_s;\n+ PyObject *__pyx_v_v;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ int __pyx_4;\n+ PyObject *__pyx_5 = 0;\n+ static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n+ __pyx_v_size = __pyx_k58;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_mean);\n+ Py_INCREF(__pyx_v_cov);\n+ Py_INCREF(__pyx_v_size);\n+ __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n+ __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n+ __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n+ __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n+ __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n+ __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n+ __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_mean);\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_v_mean);\n+ __pyx_v_mean = __pyx_3;\n+ __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_cov);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_v_cov);\n+ __pyx_v_cov = __pyx_2;\n+ __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n+ __pyx_4 = __pyx_v_size == Py_None;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n+ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n+ Py_INCREF(__pyx_v_size);\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_v_size;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n+ __pyx_2 = 0;\n+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 != 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k112p);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __Pyx_Raise(__pyx_3, 0, 0);\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n+ goto __pyx_L3;\n+ }\n+ __pyx_L3:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n+ __pyx_2 = 0;\n+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 != 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (!__pyx_4) {\n+ __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 != 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ }\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k113p);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __Pyx_Raise(__pyx_1, 0, 0);\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n+ goto __pyx_L4;\n+ }\n+ __pyx_L4:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n+ __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n+ __pyx_4 = __pyx_4 != 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k114p);\n+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __Pyx_Raise(__pyx_2, 0, 0);\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n+ goto __pyx_L5;\n+ }\n+ __pyx_L5:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n+ __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_shape);\n+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n+ PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n+ __pyx_1 = 0;\n+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n+ __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_shape);\n+ PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_1;\n+ __pyx_1 = 0;\n+ goto __pyx_L6;\n+ }\n+ __pyx_L6:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n+ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n+ __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n+ __pyx_5 = 0;\n+ __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_final_shape);\n+ __pyx_v_final_shape = __pyx_1;\n+ __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n+ __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n+ __pyx_1 = 0;\n+ __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_final_shape);\n+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n+ __pyx_3 = 0;\n+ __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_x);\n+ __pyx_v_x = __pyx_5;\n+ __pyx_5 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_final_shape);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n+ __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n+ __pyx_1 = 0;\n+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n+ __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n+ PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n+ __pyx_3 = 0;\n+ __pyx_5 = 0;\n+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n+ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n+ Py_INCREF(__pyx_n_svd);\n+ PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n+ __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_svd);\n+ __pyx_v_svd = __pyx_5;\n+ __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_cov);\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n+ __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_u);\n+ __pyx_v_u = __pyx_3;\n+ __pyx_3 = 0;\n+ __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_s);\n+ __pyx_v_s = __pyx_5;\n+ __pyx_5 = 0;\n+ __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_DECREF(__pyx_v_v);\n+ __pyx_v_v = __pyx_1;\n+ __pyx_1 = 0;\n+ if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_s);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n+ Py_INCREF(__pyx_v_v);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n+ __pyx_2 = 0;\n+ __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_v_x);\n+ __pyx_v_x = __pyx_1;\n+ __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n+ __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_mean);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n+ __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n+ __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_final_shape);\n+ PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n+ __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_5); __pyx_5 = 0;\n+ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n+ Py_INCREF(__pyx_v_x);\n+ __pyx_r = __pyx_v_x;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ Py_XDECREF(__pyx_5);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_shape);\n+ Py_DECREF(__pyx_v_final_shape);\n+ Py_DECREF(__pyx_v_x);\n+ Py_DECREF(__pyx_v_svd);\n+ Py_DECREF(__pyx_v_u);\n+ Py_DECREF(__pyx_v_s);\n+ Py_DECREF(__pyx_v_v);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_mean);\n+ Py_DECREF(__pyx_v_cov);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_zeros;\n+\n+static PyObject *__pyx_k117p;\n+\n+static char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ long __pyx_v_n;\n+ PyObject *__pyx_v_pvals = 0;\n+ PyObject *__pyx_v_size = 0;\n+ long __pyx_v_d;\n+ PyArrayObject *arrayObject_parr;\n+ PyArrayObject *arrayObject_mnarr;\n+ double (*__pyx_v_pix);\n+ long (*__pyx_v_mnix);\n+ long __pyx_v_i;\n+ long __pyx_v_j;\n+ long __pyx_v_dn;\n+ double __pyx_v_Sum;\n+ PyObject *__pyx_v_shape;\n+ PyObject *__pyx_v_multin;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ long __pyx_4;\n+ int __pyx_5;\n+ static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n+ __pyx_v_size = __pyx_k59;\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_pvals);\n+ Py_INCREF(__pyx_v_size);\n+ arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n+ arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n+ __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n+ __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_pvals);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_v_d = __pyx_4;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n+ __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n+ Py_INCREF(((PyObject *)__pyx_1));\n+ Py_DECREF(((PyObject *)arrayObject_parr));\n+ arrayObject_parr = ((PyArrayObject *)__pyx_1);\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n+ __pyx_v_pix = ((double (*))arrayObject_parr->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n+ __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n+ if (__pyx_5) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n+ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n+ Py_INCREF(__pyx_k117p);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __Pyx_Raise(__pyx_1, 0, 0);\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n+ goto __pyx_L2;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n+ __pyx_5 = __pyx_v_size == Py_None;\n+ if (__pyx_5) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n+ __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_3;\n+ __pyx_3 = 0;\n+ goto __pyx_L3;\n+ }\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n+ __pyx_5 = __pyx_3 == __pyx_1;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (__pyx_5) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n+ __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n+ __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_3;\n+ __pyx_3 = 0;\n+ goto __pyx_L3;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n+ __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n+ __pyx_1 = 0;\n+ __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_shape);\n+ __pyx_v_shape = __pyx_3;\n+ __pyx_3 = 0;\n+ }\n+ __pyx_L3:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_shape);\n+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n+ PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n+ __pyx_1 = 0;\n+ __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_v_multin);\n+ __pyx_v_multin = __pyx_1;\n+ __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n+ Py_INCREF(((PyObject *)__pyx_v_multin));\n+ Py_DECREF(((PyObject *)arrayObject_mnarr));\n+ arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n+ __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n+ __pyx_v_i = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n+ while (1) {\n+ __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n+ if (!__pyx_5) break;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n+ __pyx_v_Sum = 1.0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n+ __pyx_v_dn = __pyx_v_n;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n+ __pyx_4 = (__pyx_v_d - 1);\n+ for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n+ (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n+ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n+ __pyx_5 = (__pyx_v_dn <= 0);\n+ if (__pyx_5) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n+ goto __pyx_L7;\n+ goto __pyx_L8;\n+ }\n+ __pyx_L8:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n+ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n+ }\n+ __pyx_L7:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n+ __pyx_5 = (__pyx_v_dn > 0);\n+ if (__pyx_5) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n+ (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n+ goto __pyx_L9;\n+ }\n+ __pyx_L9:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n+ __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n+ }\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n+ Py_INCREF(__pyx_v_multin);\n+ __pyx_r = __pyx_v_multin;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(arrayObject_parr);\n+ Py_DECREF(arrayObject_mnarr);\n+ Py_DECREF(__pyx_v_shape);\n+ Py_DECREF(__pyx_v_multin);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_pvals);\n+ Py_DECREF(__pyx_v_size);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_x = 0;\n+ long __pyx_v_i;\n+ long __pyx_v_j;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ long __pyx_4;\n+ int __pyx_5;\n+ static char *__pyx_argnames[] = {\"x\",0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_x);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_v_i = __pyx_4;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n+ while (1) {\n+ __pyx_5 = (__pyx_v_i > 0);\n+ if (!__pyx_5) break;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n+ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n+ __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n+ __pyx_v_i = (__pyx_v_i - 1);\n+ }\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_x);\n+ return __pyx_r;\n+}\n+\n+static PyObject *__pyx_n_arange;\n+\n+static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n+static char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\n+static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n+ PyObject *__pyx_v_x = 0;\n+ PyObject *__pyx_v_arr;\n+ PyObject *__pyx_r;\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ PyObject *__pyx_3 = 0;\n+ int __pyx_4;\n+ static char *__pyx_argnames[] = {\"x\",0};\n+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n+ Py_INCREF(__pyx_v_self);\n+ Py_INCREF(__pyx_v_x);\n+ __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n+ __pyx_4 = __pyx_3 == __pyx_1;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (__pyx_4) {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n+ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n+ __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_v_arr);\n+ __pyx_v_arr = __pyx_2;\n+ __pyx_2 = 0;\n+ goto __pyx_L2;\n+ }\n+ /*else*/ {\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n+ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n+ __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_x);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_v_arr);\n+ __pyx_v_arr = __pyx_3;\n+ __pyx_3 = 0;\n+ }\n+ __pyx_L2:;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n+ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n+ Py_INCREF(__pyx_v_arr);\n+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ Py_DECREF(__pyx_3); __pyx_3 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n+ Py_INCREF(__pyx_v_arr);\n+ __pyx_r = __pyx_v_arr;\n+ goto __pyx_L0;\n+\n+ __pyx_r = Py_None; Py_INCREF(__pyx_r);\n+ goto __pyx_L0;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ Py_XDECREF(__pyx_3);\n+ __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n+ __pyx_r = 0;\n+ __pyx_L0:;\n+ Py_DECREF(__pyx_v_arr);\n+ Py_DECREF(__pyx_v_self);\n+ Py_DECREF(__pyx_v_x);\n+ return __pyx_r;\n+}\n+\n+static __Pyx_InternTabEntry __pyx_intern_tab[] = {\n+ {&__pyx_n_ArgumentError, \"ArgumentError\"},\n+ {&__pyx_n_Float64, \"Float64\"},\n+ {&__pyx_n_Int, \"Int\"},\n+ {&__pyx_n_MT19937, \"MT19937\"},\n+ {&__pyx_n_ValueError, \"ValueError\"},\n+ {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n+ {&__pyx_n__rand, \"_rand\"},\n+ {&__pyx_n__sp, \"_sp\"},\n+ {&__pyx_n_add, \"add\"},\n+ {&__pyx_n_append, \"append\"},\n+ {&__pyx_n_arange, \"arange\"},\n+ {&__pyx_n_array, \"array\"},\n+ {&__pyx_n_beta, \"beta\"},\n+ {&__pyx_n_binomial, \"binomial\"},\n+ {&__pyx_n_bytes, \"bytes\"},\n+ {&__pyx_n_chisquare, \"chisquare\"},\n+ {&__pyx_n_empty, \"empty\"},\n+ {&__pyx_n_exponential, \"exponential\"},\n+ {&__pyx_n_f, \"f\"},\n+ {&__pyx_n_gamma, \"gamma\"},\n+ {&__pyx_n_geometric, \"geometric\"},\n+ {&__pyx_n_get_state, \"get_state\"},\n+ {&__pyx_n_gumbel, \"gumbel\"},\n+ {&__pyx_n_hypergeometric, \"hypergeometric\"},\n+ {&__pyx_n_int, \"int\"},\n+ {&__pyx_n_isinstance, \"isinstance\"},\n+ {&__pyx_n_laplace, \"laplace\"},\n+ {&__pyx_n_len, \"len\"},\n+ {&__pyx_n_list, \"list\"},\n+ {&__pyx_n_logistic, \"logistic\"},\n+ {&__pyx_n_lognormal, \"lognormal\"},\n+ {&__pyx_n_logseries, \"logseries\"},\n+ {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n+ {&__pyx_n_multinomial, \"multinomial\"},\n+ {&__pyx_n_multiply, \"multiply\"},\n+ {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n+ {&__pyx_n_negative_binomial, \"negative_binomial\"},\n+ {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n+ {&__pyx_n_noncentral_f, \"noncentral_f\"},\n+ {&__pyx_n_normal, \"normal\"},\n+ {&__pyx_n_numpy, \"numpy\"},\n+ {&__pyx_n_pareto, \"pareto\"},\n+ {&__pyx_n_permutation, \"permutation\"},\n+ {&__pyx_n_poisson, \"poisson\"},\n+ {&__pyx_n_power, \"power\"},\n+ {&__pyx_n_rand, \"rand\"},\n+ {&__pyx_n_randint, \"randint\"},\n+ {&__pyx_n_randn, \"randn\"},\n+ {&__pyx_n_random, \"random\"},\n+ {&__pyx_n_random_integers, \"random_integers\"},\n+ {&__pyx_n_random_sample, \"random_sample\"},\n+ {&__pyx_n_rayleigh, \"rayleigh\"},\n+ {&__pyx_n_reduce, \"reduce\"},\n+ {&__pyx_n_seed, \"seed\"},\n+ {&__pyx_n_set_state, \"set_state\"},\n+ {&__pyx_n_shape, \"shape\"},\n+ {&__pyx_n_shuffle, \"shuffle\"},\n+ {&__pyx_n_size, \"size\"},\n+ {&__pyx_n_sqrt, \"sqrt\"},\n+ {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n+ {&__pyx_n_standard_exponential, \"standard_exponential\"},\n+ {&__pyx_n_standard_gamma, \"standard_gamma\"},\n+ {&__pyx_n_standard_normal, \"standard_normal\"},\n+ {&__pyx_n_standard_t, \"standard_t\"},\n+ {&__pyx_n_svd, \"svd\"},\n+ {&__pyx_n_triangular, \"triangular\"},\n+ {&__pyx_n_tuple, \"tuple\"},\n+ {&__pyx_n_type, \"type\"},\n+ {&__pyx_n_uniform, \"uniform\"},\n+ {&__pyx_n_vonmises, \"vonmises\"},\n+ {&__pyx_n_wald, \"wald\"},\n+ {&__pyx_n_weibull, \"weibull\"},\n+ {&__pyx_n_zeros, \"zeros\"},\n+ {&__pyx_n_zipf, \"zipf\"},\n+ {0, 0}\n+};\n+\n+static __Pyx_StringTabEntry __pyx_string_tab[] = {\n+ {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n+ {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n+ {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n+ {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n+ {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n+ {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n+ {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n+ {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n+ {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n+ {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n+ {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n+ {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n+ {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n+ {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n+ {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n+ {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n+ {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n+ {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n+ {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n+ {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n+ {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n+ {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n+ {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n+ {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n+ {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n+ {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n+ {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n+ {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n+ {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n+ {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n+ {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n+ {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n+ {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n+ {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n+ {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n+ {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n+ {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n+ {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n+ {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n+ {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n+ {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n+ {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n+ {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n+ {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n+ {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n+ {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n+ {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n+ {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n+ {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n+ {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n+ {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n+ {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n+ {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n+ {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n+ {0, 0, 0}\n+};\n+\n+static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n+ PyObject *o = (*t->tp_alloc)(t, 0);\n+ struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n+ return o;\n+}\n+\n+static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n+ {\n+ PyObject *etype, *eval, *etb;\n+ PyErr_Fetch(&etype, &eval, &etb);\n+ ++o->ob_refcnt;\n+ __pyx_f_6mtrand_11RandomState___dealloc__(o);\n+ if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n+ --o->ob_refcnt;\n+ PyErr_Restore(etype, eval, etb);\n+ }\n+ (*o->ob_type->tp_free)(o);\n+}\n+\n+static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n+ return 0;\n+}\n+\n+static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n+ return 0;\n+}\n+\n+static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n+ {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n+ {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n+ {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n+ {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n+ {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n+ {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n+ {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n+ {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n+ {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n+ {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n+ {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n+ {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n+ {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n+ {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n+ {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n+ {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n+ {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n+ {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n+ {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n+ {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n+ {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n+ {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n+ {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n+ {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n+ {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n+ {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n+ {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n+ {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n+ {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n+ {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n+ {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n+ {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n+ {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n+ {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n+ {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n+ {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n+ {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n+ {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n+ {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n+ {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n+ {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n+ {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n+ {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n+ {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n+ {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n+ {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n+ {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n+ {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n+ {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n+ {0, 0, 0, 0}\n+};\n+\n+static PyNumberMethods __pyx_tp_as_number_RandomState = {\n+ 0, /*nb_add*/\n+ 0, /*nb_subtract*/\n+ 0, /*nb_multiply*/\n+ 0, /*nb_divide*/\n+ 0, /*nb_remainder*/\n+ 0, /*nb_divmod*/\n+ 0, /*nb_power*/\n+ 0, /*nb_negative*/\n+ 0, /*nb_positive*/\n+ 0, /*nb_absolute*/\n+ 0, /*nb_nonzero*/\n+ 0, /*nb_invert*/\n+ 0, /*nb_lshift*/\n+ 0, /*nb_rshift*/\n+ 0, /*nb_and*/\n+ 0, /*nb_xor*/\n+ 0, /*nb_or*/\n+ 0, /*nb_coerce*/\n+ 0, /*nb_int*/\n+ 0, /*nb_long*/\n+ 0, /*nb_float*/\n+ 0, /*nb_oct*/\n+ 0, /*nb_hex*/\n+ 0, /*nb_inplace_add*/\n+ 0, /*nb_inplace_subtract*/\n+ 0, /*nb_inplace_multiply*/\n+ 0, /*nb_inplace_divide*/\n+ 0, /*nb_inplace_remainder*/\n+ 0, /*nb_inplace_power*/\n+ 0, /*nb_inplace_lshift*/\n+ 0, /*nb_inplace_rshift*/\n+ 0, /*nb_inplace_and*/\n+ 0, /*nb_inplace_xor*/\n+ 0, /*nb_inplace_or*/\n+ 0, /*nb_floor_divide*/\n+ 0, /*nb_true_divide*/\n+ 0, /*nb_inplace_floor_divide*/\n+ 0, /*nb_inplace_true_divide*/\n+};\n+\n+static PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n+ 0, /*sq_length*/\n+ 0, /*sq_concat*/\n+ 0, /*sq_repeat*/\n+ 0, /*sq_item*/\n+ 0, /*sq_slice*/\n+ 0, /*sq_ass_item*/\n+ 0, /*sq_ass_slice*/\n+ 0, /*sq_contains*/\n+ 0, /*sq_inplace_concat*/\n+ 0, /*sq_inplace_repeat*/\n+};\n+\n+static PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n+ 0, /*mp_length*/\n+ 0, /*mp_subscript*/\n+ 0, /*mp_ass_subscript*/\n+};\n+\n+static PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n+ 0, /*bf_getreadbuffer*/\n+ 0, /*bf_getwritebuffer*/\n+ 0, /*bf_getsegcount*/\n+ 0, /*bf_getcharbuffer*/\n+};\n+\n+statichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n+ PyObject_HEAD_INIT(0)\n+ 0, /*ob_size*/\n+ \"mtrand.RandomState\", /*tp_name*/\n+ sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n+ 0, /*tp_itemsize*/\n+ __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n+ 0, /*tp_print*/\n+ 0, /*tp_getattr*/\n+ 0, /*tp_setattr*/\n+ 0, /*tp_compare*/\n+ 0, /*tp_repr*/\n+ &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n+ &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n+ &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n+ 0, /*tp_hash*/\n+ 0, /*tp_call*/\n+ 0, /*tp_str*/\n+ 0, /*tp_getattro*/\n+ 0, /*tp_setattro*/\n+ &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n+ \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n+ __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n+ __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n+ 0, /*tp_richcompare*/\n+ 0, /*tp_weaklistoffset*/\n+ 0, /*tp_iter*/\n+ 0, /*tp_iternext*/\n+ __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n+ 0, /*tp_members*/\n+ 0, /*tp_getset*/\n+ 0, /*tp_base*/\n+ 0, /*tp_dict*/\n+ 0, /*tp_descr_get*/\n+ 0, /*tp_descr_set*/\n+ 0, /*tp_dictoffset*/\n+ __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n+ 0, /*tp_alloc*/\n+ __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n+ 0, /*tp_free*/\n+ 0, /*tp_is_gc*/\n+ 0, /*tp_bases*/\n+ 0, /*tp_mro*/\n+ 0, /*tp_cache*/\n+ 0, /*tp_subclasses*/\n+ 0, /*tp_weaklist*/\n+};\n+\n+static struct PyMethodDef __pyx_methods[] = {\n+ {0, 0, 0, 0}\n+};\n+\n+DL_EXPORT(void) initmtrand(void); /*proto*/\n+DL_EXPORT(void) initmtrand(void) {\n+ PyObject *__pyx_1 = 0;\n+ PyObject *__pyx_2 = 0;\n+ __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n+ if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n+ __pyx_b = PyImport_AddModule(\"__builtin__\");\n+ if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n+ if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n+ if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n+ __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n+ __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n+ if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n+ if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n+ __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n+ import_array();\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n+ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n+ Py_INCREF(Py_None);\n+ __pyx_k2 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n+ Py_INCREF(Py_None);\n+ __pyx_k3 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n+ Py_INCREF(Py_None);\n+ __pyx_k4 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n+ Py_INCREF(Py_None);\n+ __pyx_k5 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n+ Py_INCREF(Py_None);\n+ __pyx_k6 = Py_None;\n+ Py_INCREF(Py_None);\n+ __pyx_k7 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n+ __pyx_k8 = 0.0;\n+ __pyx_k9 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k10 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n+ Py_INCREF(Py_None);\n+ __pyx_k11 = Py_None;\n+ Py_INCREF(Py_None);\n+ __pyx_k12 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n+ Py_INCREF(Py_None);\n+ __pyx_k13 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n+ __pyx_k14 = 0.0;\n+ __pyx_k15 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k16 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n+ Py_INCREF(Py_None);\n+ __pyx_k17 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n+ __pyx_k18 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k19 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n+ Py_INCREF(Py_None);\n+ __pyx_k20 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n+ Py_INCREF(Py_None);\n+ __pyx_k21 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n+ __pyx_k22 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k23 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n+ Py_INCREF(Py_None);\n+ __pyx_k24 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n+ Py_INCREF(Py_None);\n+ __pyx_k25 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n+ Py_INCREF(Py_None);\n+ __pyx_k26 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n+ Py_INCREF(Py_None);\n+ __pyx_k27 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n+ Py_INCREF(Py_None);\n+ __pyx_k28 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n+ Py_INCREF(Py_None);\n+ __pyx_k29 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n+ Py_INCREF(Py_None);\n+ __pyx_k30 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n+ Py_INCREF(Py_None);\n+ __pyx_k31 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n+ Py_INCREF(Py_None);\n+ __pyx_k32 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n+ Py_INCREF(Py_None);\n+ __pyx_k33 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n+ __pyx_k34 = 0.0;\n+ __pyx_k35 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k36 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n+ __pyx_k37 = 0.0;\n+ __pyx_k38 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k39 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n+ __pyx_k40 = 0.0;\n+ __pyx_k41 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k42 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n+ __pyx_k43 = 0.0;\n+ __pyx_k44 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k45 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n+ __pyx_k46 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k47 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n+ Py_INCREF(Py_None);\n+ __pyx_k48 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n+ Py_INCREF(Py_None);\n+ __pyx_k49 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n+ Py_INCREF(Py_None);\n+ __pyx_k50 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n+ Py_INCREF(Py_None);\n+ __pyx_k51 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n+ __pyx_k52 = 1.0;\n+ Py_INCREF(Py_None);\n+ __pyx_k53 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n+ Py_INCREF(Py_None);\n+ __pyx_k54 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n+ Py_INCREF(Py_None);\n+ __pyx_k55 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n+ Py_INCREF(Py_None);\n+ __pyx_k56 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n+ Py_INCREF(Py_None);\n+ __pyx_k57 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n+ Py_INCREF(Py_None);\n+ __pyx_k58 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n+ Py_INCREF(Py_None);\n+ __pyx_k59 = Py_None;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n+ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n+ __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+\n+ /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n+ Py_DECREF(__pyx_1); __pyx_1 = 0;\n+ if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n+ Py_DECREF(__pyx_2); __pyx_2 = 0;\n+ return;\n+ __pyx_L1:;\n+ Py_XDECREF(__pyx_1);\n+ Py_XDECREF(__pyx_2);\n+ __Pyx_AddTraceback(\"mtrand\");\n+}\n+\n+static char *__pyx_filenames[] = {\n+ \"mtrand.pyx\",\n+ \"numpy.pxi\",\n+};\n+statichere char **__pyx_f = __pyx_filenames;\n+\n+/* Runtime support code */\n+\n+static int __Pyx_GetStarArgs(\n+ PyObject **args, \n+ PyObject **kwds,\n+ char *kwd_list[], \n+ int nargs,\n+ PyObject **args2, \n+ PyObject **kwds2)\n+{\n+ PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n+ \n+ if (args2)\n+ *args2 = 0;\n+ if (kwds2)\n+ *kwds2 = 0;\n+ \n+ if (args2) {\n+ args1 = PyTuple_GetSlice(*args, 0, nargs);\n+ if (!args1)\n+ goto bad;\n+ *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n+ if (!*args2)\n+ goto bad;\n+ }\n+ else {\n+ args1 = *args;\n+ Py_INCREF(args1);\n+ }\n+ \n+ if (kwds2) {\n+ if (*kwds) {\n+ char **p;\n+ kwds1 = PyDict_New();\n+ if (!kwds)\n+ goto bad;\n+ *kwds2 = PyDict_Copy(*kwds);\n+ if (!*kwds2)\n+ goto bad;\n+ for (p = kwd_list; *p; p++) {\n+ x = PyDict_GetItemString(*kwds, *p);\n+ if (x) {\n+ if (PyDict_SetItemString(kwds1, *p, x) < 0)\n+ goto bad;\n+ if (PyDict_DelItemString(*kwds2, *p) < 0)\n+ goto bad;\n+ }\n+ }\n+ }\n+ else {\n+ *kwds2 = PyDict_New();\n+ if (!*kwds2)\n+ goto bad;\n+ }\n+ }\n+ else {\n+ kwds1 = *kwds;\n+ Py_XINCREF(kwds1);\n+ }\n+ \n+ *args = args1;\n+ *kwds = kwds1;\n+ return 0;\n+bad:\n+ Py_XDECREF(args1);\n+ Py_XDECREF(kwds1);\n+ Py_XDECREF(*args2);\n+ Py_XDECREF(*kwds2);\n+ return -1;\n+}\n+\n+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n+ PyObject *__import__ = 0;\n+ PyObject *empty_list = 0;\n+ PyObject *module = 0;\n+ PyObject *global_dict = 0;\n+ PyObject *empty_dict = 0;\n+ PyObject *list;\n+ __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n+ if (!__import__)\n+ goto bad;\n+ if (from_list)\n+ list = from_list;\n+ else {\n+ empty_list = PyList_New(0);\n+ if (!empty_list)\n+ goto bad;\n+ list = empty_list;\n+ }\n+ global_dict = PyModule_GetDict(__pyx_m);\n+ if (!global_dict)\n+ goto bad;\n+ empty_dict = PyDict_New();\n+ if (!empty_dict)\n+ goto bad;\n+ module = PyObject_CallFunction(__import__, \"OOOO\",\n+ name, global_dict, empty_dict, list);\n+bad:\n+ Py_XDECREF(empty_list);\n+ Py_XDECREF(__import__);\n+ Py_XDECREF(empty_dict);\n+ return module;\n+}\n+\n+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n+ PyObject *result;\n+ result = PyObject_GetAttr(dict, name);\n+ if (!result)\n+ PyErr_SetObject(PyExc_NameError, name);\n+ return result;\n+}\n+\n+static void __Pyx_WriteUnraisable(char *name) {\n+ PyObject *old_exc, *old_val, *old_tb;\n+ PyObject *ctx;\n+ PyErr_Fetch(&old_exc, &old_val, &old_tb);\n+ ctx = PyString_FromString(name);\n+ PyErr_Restore(old_exc, old_val, old_tb);\n+ if (!ctx)\n+ ctx = Py_None;\n+ PyErr_WriteUnraisable(ctx);\n+}\n+\n+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n+ Py_XINCREF(type);\n+ Py_XINCREF(value);\n+ Py_XINCREF(tb);\n+ /* First, check the traceback argument, replacing None with NULL. */\n+ if (tb == Py_None) {\n+ Py_DECREF(tb);\n+ tb = 0;\n+ }\n+ else if (tb != NULL && !PyTraceBack_Check(tb)) {\n+ PyErr_SetString(PyExc_TypeError,\n+ \"raise: arg 3 must be a traceback or None\");\n+ goto raise_error;\n+ }\n+ /* Next, replace a missing value with None */\n+ if (value == NULL) {\n+ value = Py_None;\n+ Py_INCREF(value);\n+ }\n+ /* Next, repeatedly, replace a tuple exception with its first item */\n+ while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n+ PyObject *tmp = type;\n+ type = PyTuple_GET_ITEM(type, 0);\n+ Py_INCREF(type);\n+ Py_DECREF(tmp);\n+ }\n+ if (PyString_Check(type))\n+ ;\n+ else if (PyClass_Check(type))\n+ ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n+ else if (PyInstance_Check(type)) {\n+ /* Raising an instance. The value should be a dummy. */\n+ if (value != Py_None) {\n+ PyErr_SetString(PyExc_TypeError,\n+ \"instance exception may not have a separate value\");\n+ goto raise_error;\n+ }\n+ else {\n+ /* Normalize to raise , */\n+ Py_DECREF(value);\n+ value = type;\n+ type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n+ Py_INCREF(type);\n+ }\n+ }\n+ else {\n+ /* Not something you can raise. You get an exception\n+ anyway, just not what you specified :-) */\n+ PyErr_Format(PyExc_TypeError,\n+ \"exceptions must be strings, classes, or \"\n+ \"instances, not %s\", type->ob_type->tp_name);\n+ goto raise_error;\n+ }\n+ PyErr_Restore(type, value, tb);\n+ return;\n+raise_error:\n+ Py_XDECREF(value);\n+ Py_XDECREF(type);\n+ Py_XDECREF(tb);\n+ return;\n+}\n+\n+static void __Pyx_UnpackError(void) {\n+ PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n+}\n+\n+static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n+ PyObject *item = PySequence_GetItem(seq, i);\n+ if (!item) {\n+ if (PyErr_ExceptionMatches(PyExc_IndexError))\n+ __Pyx_UnpackError();\n+ }\n+ return item;\n+}\n+\n+static int __Pyx_EndUnpack(PyObject *seq, int i) {\n+ PyObject *item = PySequence_GetItem(seq, i);\n+ if (item) {\n+ Py_DECREF(item);\n+ __Pyx_UnpackError();\n+ return -1;\n+ }\n+ PyErr_Clear();\n+ return 0;\n+}\n+\n+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n+ while (t->p) {\n+ *t->p = PyString_InternFromString(t->s);\n+ if (!*t->p)\n+ return -1;\n+ ++t;\n+ }\n+ return 0;\n+}\n+\n+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n+ while (t->p) {\n+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n+ if (!*t->p)\n+ return -1;\n+ ++t;\n+ }\n+ return 0;\n+}\n+\n+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n+ long size) \n+{\n+ PyObject *py_module_name = 0;\n+ PyObject *py_class_name = 0;\n+ PyObject *py_name_list = 0;\n+ PyObject *py_module = 0;\n+ PyObject *result = 0;\n+ \n+ py_module_name = PyString_FromString(module_name);\n+ if (!py_module_name)\n+ goto bad;\n+ py_class_name = PyString_FromString(class_name);\n+ if (!py_class_name)\n+ goto bad;\n+ py_name_list = PyList_New(1);\n+ if (!py_name_list)\n+ goto bad;\n+ Py_INCREF(py_class_name);\n+ if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n+ goto bad;\n+ py_module = __Pyx_Import(py_module_name, py_name_list);\n+ if (!py_module)\n+ goto bad;\n+ result = PyObject_GetAttr(py_module, py_class_name);\n+ if (!result)\n+ goto bad;\n+ if (!PyType_Check(result)) {\n+ PyErr_Format(PyExc_TypeError, \n+ \"%s.%s is not a type object\",\n+ module_name, class_name);\n+ goto bad;\n+ }\n+ if (((PyTypeObject *)result)->tp_basicsize != size) {\n+ PyErr_Format(PyExc_ValueError, \n+ \"%s.%s does not appear to be the correct type object\",\n+ module_name, class_name);\n+ goto bad;\n+ }\n+ goto done;\n+bad:\n+ Py_XDECREF(result);\n+ result = 0;\n+done:\n+ Py_XDECREF(py_module_name);\n+ Py_XDECREF(py_class_name);\n+ Py_XDECREF(py_name_list);\n+ return (PyTypeObject *)result;\n+}\n+\n+#include \"compile.h\"\n+#include \"frameobject.h\"\n+#include \"traceback.h\"\n+\n+static void __Pyx_AddTraceback(char *funcname) {\n+ PyObject *py_srcfile = 0;\n+ PyObject *py_funcname = 0;\n+ PyObject *py_globals = 0;\n+ PyObject *empty_tuple = 0;\n+ PyObject *empty_string = 0;\n+ PyCodeObject *py_code = 0;\n+ PyFrameObject *py_frame = 0;\n+ \n+ py_srcfile = PyString_FromString(__pyx_filename);\n+ if (!py_srcfile) goto bad;\n+ py_funcname = PyString_FromString(funcname);\n+ if (!py_funcname) goto bad;\n+ py_globals = PyModule_GetDict(__pyx_m);\n+ if (!py_globals) goto bad;\n+ empty_tuple = PyTuple_New(0);\n+ if (!empty_tuple) goto bad;\n+ empty_string = PyString_FromString(\"\");\n+ if (!empty_string) goto bad;\n+ py_code = PyCode_New(\n+ 0, /*int argcount,*/\n+ 0, /*int nlocals,*/\n+ 0, /*int stacksize,*/\n+ 0, /*int flags,*/\n+ empty_string, /*PyObject *code,*/\n+ empty_tuple, /*PyObject *consts,*/\n+ empty_tuple, /*PyObject *names,*/\n+ empty_tuple, /*PyObject *varnames,*/\n+ empty_tuple, /*PyObject *freevars,*/\n+ empty_tuple, /*PyObject *cellvars,*/\n+ py_srcfile, /*PyObject *filename,*/\n+ py_funcname, /*PyObject *name,*/\n+ __pyx_lineno, /*int firstlineno,*/\n+ empty_string /*PyObject *lnotab*/\n+ );\n+ if (!py_code) goto bad;\n+ py_frame = PyFrame_New(\n+ PyThreadState_Get(), /*PyThreadState *tstate,*/\n+ py_code, /*PyCodeObject *code,*/\n+ py_globals, /*PyObject *globals,*/\n+ 0 /*PyObject *locals*/\n+ );\n+ if (!py_frame) goto bad;\n+ py_frame->f_lineno = __pyx_lineno;\n+ PyTraceBack_Here(py_frame);\n+bad:\n+ Py_XDECREF(py_srcfile);\n+ Py_XDECREF(py_funcname);\n+ Py_XDECREF(empty_tuple);\n+ Py_XDECREF(empty_string);\n+ Py_XDECREF(py_code);\n+ Py_XDECREF(py_frame);\n+}\n", + "added_lines": 5990, + "deleted_lines": 0, + "source_code": "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n#ifndef PY_LONG_LONG\n #define PY_LONG_LONG LONG_LONG\n#endif\n#include \"string.h\"\n#include \"math.h\"\n#include \"numpy/arrayobject.h\"\n#include \"randomkit.h\"\n#include \"distributions.h\"\n#include \"initarray.h\"\n\n\ntypedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\ntypedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\nstatic PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\nstatic int __Pyx_EndUnpack(PyObject *, int); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\nstatic void __Pyx_WriteUnraisable(char *name); /*proto*/\nstatic void __Pyx_AddTraceback(char *funcname); /*proto*/\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n\nstatic PyObject *__pyx_m;\nstatic PyObject *__pyx_b;\nstatic int __pyx_lineno;\nstatic char *__pyx_filename;\nstaticforward char **__pyx_f;\n\n/* Declarations from mtrand */\n\nstaticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n\nstruct __pyx_obj_6mtrand_RandomState {\n PyObject_HEAD\n rk_state (*internal_state);\n};\n\nstatic PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\nstatic PyObject *__pyx_k2;\nstatic PyObject *__pyx_k3;\nstatic PyObject *__pyx_k4;\nstatic PyObject *__pyx_k5;\nstatic PyObject *__pyx_k6;\nstatic PyObject *__pyx_k7;\nstatic double __pyx_k8;\nstatic double __pyx_k9;\nstatic PyObject *__pyx_k10;\nstatic PyObject *__pyx_k11;\nstatic PyObject *__pyx_k12;\nstatic PyObject *__pyx_k13;\nstatic double __pyx_k14;\nstatic double __pyx_k15;\nstatic PyObject *__pyx_k16;\nstatic PyObject *__pyx_k17;\nstatic double __pyx_k18;\nstatic PyObject *__pyx_k19;\nstatic PyObject *__pyx_k20;\nstatic PyObject *__pyx_k21;\nstatic double __pyx_k22;\nstatic PyObject *__pyx_k23;\nstatic PyObject *__pyx_k24;\nstatic PyObject *__pyx_k25;\nstatic PyObject *__pyx_k26;\nstatic PyObject *__pyx_k27;\nstatic PyObject *__pyx_k28;\nstatic PyObject *__pyx_k29;\nstatic PyObject *__pyx_k30;\nstatic PyObject *__pyx_k31;\nstatic PyObject *__pyx_k32;\nstatic PyObject *__pyx_k33;\nstatic double __pyx_k34;\nstatic double __pyx_k35;\nstatic PyObject *__pyx_k36;\nstatic double __pyx_k37;\nstatic double __pyx_k38;\nstatic PyObject *__pyx_k39;\nstatic double __pyx_k40;\nstatic double __pyx_k41;\nstatic PyObject *__pyx_k42;\nstatic double __pyx_k43;\nstatic double __pyx_k44;\nstatic PyObject *__pyx_k45;\nstatic double __pyx_k46;\nstatic PyObject *__pyx_k47;\nstatic PyObject *__pyx_k48;\nstatic PyObject *__pyx_k49;\nstatic PyObject *__pyx_k50;\nstatic PyObject *__pyx_k51;\nstatic double __pyx_k52;\nstatic PyObject *__pyx_k53;\nstatic PyObject *__pyx_k54;\nstatic PyObject *__pyx_k55;\nstatic PyObject *__pyx_k56;\nstatic PyObject *__pyx_k57;\nstatic PyObject *__pyx_k58;\nstatic PyObject *__pyx_k59;\nstatic PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n\n/* Implementation of mtrand */\n\n\nstatic PyObject *__pyx_n__sp;\nstatic PyObject *__pyx_n__rand;\nstatic PyObject *__pyx_n_seed;\nstatic PyObject *__pyx_n_get_state;\nstatic PyObject *__pyx_n_set_state;\nstatic PyObject *__pyx_n_random_sample;\nstatic PyObject *__pyx_n_randint;\nstatic PyObject *__pyx_n_bytes;\nstatic PyObject *__pyx_n_uniform;\nstatic PyObject *__pyx_n_rand;\nstatic PyObject *__pyx_n_randn;\nstatic PyObject *__pyx_n_random_integers;\nstatic PyObject *__pyx_n_standard_normal;\nstatic PyObject *__pyx_n_normal;\nstatic PyObject *__pyx_n_beta;\nstatic PyObject *__pyx_n_exponential;\nstatic PyObject *__pyx_n_standard_exponential;\nstatic PyObject *__pyx_n_standard_gamma;\nstatic PyObject *__pyx_n_gamma;\nstatic PyObject *__pyx_n_f;\nstatic PyObject *__pyx_n_noncentral_f;\nstatic PyObject *__pyx_n_chisquare;\nstatic PyObject *__pyx_n_noncentral_chisquare;\nstatic PyObject *__pyx_n_standard_cauchy;\nstatic PyObject *__pyx_n_standard_t;\nstatic PyObject *__pyx_n_vonmises;\nstatic PyObject *__pyx_n_pareto;\nstatic PyObject *__pyx_n_weibull;\nstatic PyObject *__pyx_n_power;\nstatic PyObject *__pyx_n_laplace;\nstatic PyObject *__pyx_n_gumbel;\nstatic PyObject *__pyx_n_logistic;\nstatic PyObject *__pyx_n_lognormal;\nstatic PyObject *__pyx_n_rayleigh;\nstatic PyObject *__pyx_n_wald;\nstatic PyObject *__pyx_n_triangular;\nstatic PyObject *__pyx_n_binomial;\nstatic PyObject *__pyx_n_negative_binomial;\nstatic PyObject *__pyx_n_poisson;\nstatic PyObject *__pyx_n_zipf;\nstatic PyObject *__pyx_n_geometric;\nstatic PyObject *__pyx_n_hypergeometric;\nstatic PyObject *__pyx_n_logseries;\nstatic PyObject *__pyx_n_multivariate_normal;\nstatic PyObject *__pyx_n_multinomial;\nstatic PyObject *__pyx_n_shuffle;\nstatic PyObject *__pyx_n_permutation;\nstatic PyObject *__pyx_n_numpy;\n\nstatic PyObject *__pyx_n_empty;\nstatic PyObject *__pyx_n_Float64;\n\nstatic PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont1_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont2_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont3_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_Int;\n\nstatic PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.disc0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnp_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discd_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n double __pyx_v_c;\n double __pyx_v_y;\n double __pyx_v_t;\n double __pyx_v_sum;\n long __pyx_v_i;\n double __pyx_r;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n __pyx_v_sum = (__pyx_v_darr[0]);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n __pyx_v_c = 0.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n __pyx_v_sum = __pyx_v_t;\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n __pyx_r = __pyx_v_sum;\n goto __pyx_L0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n __pyx_L0:;\n return __pyx_r;\n}\n\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n int __pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k2;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n __pyx_r = -1;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n int __pyx_1;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n goto __pyx_L0;\n __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n}\n\nstatic PyObject *__pyx_n_type;\nstatic PyObject *__pyx_n_int;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n rk_error __pyx_v_errcode;\n PyArrayObject *arrayObject_obj;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n unsigned long __pyx_5;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k3;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n __pyx_1 = __pyx_v_seed == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_1 = __pyx_4 == __pyx_2;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_3));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_3);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_MT19937;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyArrayObject *arrayObject_state;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_1 = 0;\n __pyx_4 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_state));\n arrayObject_state = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n Py_INCREF(__pyx_n_MT19937);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n Py_INCREF(((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n __pyx_4 = 0;\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_state);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_ValueError;\n\nstatic PyObject *__pyx_k62p;\nstatic PyObject *__pyx_k63p;\n\nstatic char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\nstatic char (__pyx_k63[]) = \"state must be 624 longs\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyArrayObject *arrayObject_obj;\n int __pyx_v_pos;\n PyObject *__pyx_v_algorithm_name;\n PyObject *__pyx_v_key;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n int __pyx_3;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_algorithm_name);\n __pyx_v_algorithm_name = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n __pyx_3 = __pyx_3 != 0;\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_INCREF(__pyx_k62p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_v_key);\n __pyx_v_key = __pyx_2;\n __pyx_2 = 0;\n __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_v_pos = __pyx_3;\n if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_INCREF(__pyx_k63p);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_algorithm_name);\n Py_DECREF(__pyx_v_key);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_INCREF(__pyx_v_state);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_random;\nstatic PyObject *__pyx_n___RandomState_ctor;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n __pyx_1 = 0;\n __pyx_2 = 0;\n __pyx_5 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k4;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k5;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k64p;\n\nstatic char (__pyx_k64[]) = \"low >= high\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_lo;\n long __pyx_v_hi;\n long __pyx_v_diff;\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n long __pyx_2;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k6;\n __pyx_v_size = __pyx_k7;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n __pyx_v_lo = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n __pyx_v_lo = __pyx_2;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n __pyx_1 = (__pyx_v_diff < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_INCREF(__pyx_k64p);\n PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __Pyx_Raise(__pyx_5, 0, 0);\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n goto __pyx_L4;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L4:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n unsigned int __pyx_v_length;\n void (*__pyx_v_bytes);\n PyObject *__pyx_v_bytestring;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"length\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n Py_INCREF(__pyx_v_self);\n __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n Py_DECREF(__pyx_v_bytestring);\n __pyx_v_bytestring = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n PyMem_Free(__pyx_v_bytes);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n Py_INCREF(__pyx_v_bytestring);\n __pyx_r = __pyx_v_bytestring;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_bytestring);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_low;\n double __pyx_v_high;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_low = __pyx_k8;\n __pyx_v_high = __pyx_k9;\n __pyx_v_size = __pyx_k10;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_len;\nstatic PyObject *__pyx_n_size;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_r = __pyx_5;\n __pyx_5 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k11;\n __pyx_v_size = __pyx_k12;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n Py_INCREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n __pyx_v_high = __pyx_v_low;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n Py_DECREF(__pyx_v_low);\n __pyx_v_low = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_INCREF(__pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_4;\n __pyx_4 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k13;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k66p;\n\nstatic char (__pyx_k66[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k14;\n __pyx_v_scale = __pyx_k15;\n __pyx_v_size = __pyx_k16;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_INCREF(__pyx_k66p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k67p;\nstatic PyObject *__pyx_k68p;\n\nstatic char (__pyx_k67[]) = \"a <= 0\";\nstatic char (__pyx_k68[]) = \"b <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n double __pyx_v_b;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n __pyx_v_size = __pyx_k17;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_INCREF(__pyx_k67p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_b <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_INCREF(__pyx_k68p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k69p;\n\nstatic char (__pyx_k69[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k18;\n __pyx_v_size = __pyx_k19;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_INCREF(__pyx_k69p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k20;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k70p;\n\nstatic char (__pyx_k70[]) = \"shape <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n __pyx_v_size = __pyx_k21;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_INCREF(__pyx_k70p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k71p;\nstatic PyObject *__pyx_k72p;\n\nstatic char (__pyx_k71[]) = \"shape <= 0\";\nstatic char (__pyx_k72[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k22;\n __pyx_v_size = __pyx_k23;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_INCREF(__pyx_k71p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_INCREF(__pyx_k72p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k73p;\nstatic PyObject *__pyx_k74p;\n\nstatic char (__pyx_k73[]) = \"dfnum <= 0\";\nstatic char (__pyx_k74[]) = \"dfden <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n __pyx_v_size = __pyx_k24;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n __pyx_1 = (__pyx_v_dfnum <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_INCREF(__pyx_k73p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_INCREF(__pyx_k74p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k75p;\nstatic PyObject *__pyx_k76p;\nstatic PyObject *__pyx_k77p;\n\nstatic char (__pyx_k75[]) = \"dfnum <= 1\";\nstatic char (__pyx_k76[]) = \"dfden <= 0\";\nstatic char (__pyx_k77[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k25;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n __pyx_1 = (__pyx_v_dfnum <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_INCREF(__pyx_k75p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_INCREF(__pyx_k76p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_INCREF(__pyx_k77p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k78p;\n\nstatic char (__pyx_k78[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k26;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_INCREF(__pyx_k78p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k79p;\nstatic PyObject *__pyx_k80p;\n\nstatic char (__pyx_k79[]) = \"df <= 1\";\nstatic char (__pyx_k80[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k27;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n __pyx_1 = (__pyx_v_df <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_INCREF(__pyx_k79p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_INCREF(__pyx_k80p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k28;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k81p;\n\nstatic char (__pyx_k81[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k29;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_INCREF(__pyx_k81p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k82p;\n\nstatic char (__pyx_k82[]) = \"kappa < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mu;\n double __pyx_v_kappa;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n __pyx_v_size = __pyx_k30;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n __pyx_1 = (__pyx_v_kappa < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_INCREF(__pyx_k82p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k83p;\n\nstatic char (__pyx_k83[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k31;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_INCREF(__pyx_k83p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k84p;\n\nstatic char (__pyx_k84[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k32;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_INCREF(__pyx_k84p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k85p;\n\nstatic char (__pyx_k85[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k33;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_INCREF(__pyx_k85p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k86p;\n\nstatic char (__pyx_k86[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k34;\n __pyx_v_scale = __pyx_k35;\n __pyx_v_size = __pyx_k36;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_INCREF(__pyx_k86p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k87p;\n\nstatic char (__pyx_k87[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k37;\n __pyx_v_scale = __pyx_k38;\n __pyx_v_size = __pyx_k39;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_INCREF(__pyx_k87p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k88p;\n\nstatic char (__pyx_k88[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k40;\n __pyx_v_scale = __pyx_k41;\n __pyx_v_size = __pyx_k42;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_INCREF(__pyx_k88p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k89p;\n\nstatic char (__pyx_k89[]) = \"sigma <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_sigma;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n __pyx_v_mean = __pyx_k43;\n __pyx_v_sigma = __pyx_k44;\n __pyx_v_size = __pyx_k45;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n __pyx_1 = (__pyx_v_sigma <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_INCREF(__pyx_k89p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k90p;\n\nstatic char (__pyx_k90[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k46;\n __pyx_v_size = __pyx_k47;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_INCREF(__pyx_k90p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k91p;\nstatic PyObject *__pyx_k92p;\n\nstatic char (__pyx_k91[]) = \"mean <= 0.0\";\nstatic char (__pyx_k92[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n __pyx_v_size = __pyx_k48;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n __pyx_1 = (__pyx_v_mean <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_INCREF(__pyx_k91p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_INCREF(__pyx_k92p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k93p;\nstatic PyObject *__pyx_k94p;\nstatic PyObject *__pyx_k95p;\n\nstatic char (__pyx_k93[]) = \"left > mode\";\nstatic char (__pyx_k94[]) = \"mode > right\";\nstatic char (__pyx_k95[]) = \"left == right\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_left;\n double __pyx_v_mode;\n double __pyx_v_right;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n __pyx_v_size = __pyx_k49;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_INCREF(__pyx_k93p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_INCREF(__pyx_k94p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_left == __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_INCREF(__pyx_k95p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k96p;\nstatic PyObject *__pyx_k97p;\nstatic PyObject *__pyx_k98p;\n\nstatic char (__pyx_k96[]) = \"n <= 0\";\nstatic char (__pyx_k97[]) = \"p < 0\";\nstatic char (__pyx_k98[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k50;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_INCREF(__pyx_k96p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_INCREF(__pyx_k97p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_INCREF(__pyx_k98p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k99p;\nstatic PyObject *__pyx_k100p;\nstatic PyObject *__pyx_k101p;\n\nstatic char (__pyx_k99[]) = \"n <= 0\";\nstatic char (__pyx_k100[]) = \"p < 0\";\nstatic char (__pyx_k101[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k51;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_INCREF(__pyx_k99p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_INCREF(__pyx_k100p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_INCREF(__pyx_k101p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k102p;\n\nstatic char (__pyx_k102[]) = \"lam <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_lam;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n __pyx_v_lam = __pyx_k52;\n __pyx_v_size = __pyx_k53;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n __pyx_1 = (__pyx_v_lam <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_INCREF(__pyx_k102p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k103p;\n\nstatic char (__pyx_k103[]) = \"a <= 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k54;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n __pyx_1 = (__pyx_v_a <= 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_INCREF(__pyx_k103p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k104p;\nstatic PyObject *__pyx_k105p;\n\nstatic char (__pyx_k104[]) = \"p < 0.0\";\nstatic char (__pyx_k105[]) = \"p > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k55;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n __pyx_1 = (__pyx_v_p < 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_INCREF(__pyx_k104p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_INCREF(__pyx_k105p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k106p;\nstatic PyObject *__pyx_k107p;\nstatic PyObject *__pyx_k108p;\nstatic PyObject *__pyx_k109p;\n\nstatic char (__pyx_k106[]) = \"ngood < 1\";\nstatic char (__pyx_k107[]) = \"nbad < 1\";\nstatic char (__pyx_k108[]) = \"ngood + nbad < nsample\";\nstatic char (__pyx_k109[]) = \"nsample < 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_ngood;\n long __pyx_v_nbad;\n long __pyx_v_nsample;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n __pyx_v_size = __pyx_k56;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n __pyx_1 = (__pyx_v_ngood < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_INCREF(__pyx_k106p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nbad < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_INCREF(__pyx_k107p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_INCREF(__pyx_k108p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nsample < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_INCREF(__pyx_k109p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k110p;\nstatic PyObject *__pyx_k111p;\n\nstatic char (__pyx_k110[]) = \"p < 0\";\nstatic char (__pyx_k111[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k57;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_INCREF(__pyx_k110p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_INCREF(__pyx_k111p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_array;\nstatic PyObject *__pyx_n_shape;\nstatic PyObject *__pyx_n_ArgumentError;\nstatic PyObject *__pyx_n_isinstance;\nstatic PyObject *__pyx_n_list;\nstatic PyObject *__pyx_n_append;\nstatic PyObject *__pyx_n_multiply;\nstatic PyObject *__pyx_n_reduce;\nstatic PyObject *__pyx_n_svd;\nstatic PyObject *__pyx_n_matrixmultiply;\nstatic PyObject *__pyx_n_sqrt;\nstatic PyObject *__pyx_n_add;\nstatic PyObject *__pyx_n_tuple;\n\nstatic PyObject *__pyx_k112p;\nstatic PyObject *__pyx_k113p;\nstatic PyObject *__pyx_k114p;\nstatic PyObject *__pyx_k115p;\n\nstatic char (__pyx_k112[]) = \"mean must be 1 dimensional\";\nstatic char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\nstatic char (__pyx_k114[]) = \"mean and cov must have same length\";\nstatic char (__pyx_k115[]) = \"numpy.linalg\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_mean = 0;\n PyObject *__pyx_v_cov = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_final_shape;\n PyObject *__pyx_v_x;\n PyObject *__pyx_v_svd;\n PyObject *__pyx_v_u;\n PyObject *__pyx_v_s;\n PyObject *__pyx_v_v;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n __pyx_v_size = __pyx_k58;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_mean);\n Py_INCREF(__pyx_v_cov);\n Py_INCREF(__pyx_v_size);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_mean);\n __pyx_v_mean = __pyx_3;\n __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_cov);\n __pyx_v_cov = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n __pyx_4 = __pyx_v_size == Py_None;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n Py_INCREF(__pyx_v_size);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_v_size;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_INCREF(__pyx_k112p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_3, 0, 0);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (!__pyx_4) {\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n }\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_INCREF(__pyx_k113p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n goto __pyx_L4;\n }\n __pyx_L4:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_INCREF(__pyx_k114p);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __Pyx_Raise(__pyx_2, 0, 0);\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n goto __pyx_L5;\n }\n __pyx_L5:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L6;\n }\n __pyx_L6:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n __pyx_5 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_final_shape);\n __pyx_v_final_shape = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n __pyx_3 = 0;\n __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_5;\n __pyx_5 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n __pyx_3 = 0;\n __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_INCREF(__pyx_n_svd);\n PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_v_svd);\n __pyx_v_svd = __pyx_5;\n __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_u);\n __pyx_v_u = __pyx_3;\n __pyx_3 = 0;\n __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_s);\n __pyx_v_s = __pyx_5;\n __pyx_5 = 0;\n __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_v);\n __pyx_v_v = __pyx_1;\n __pyx_1 = 0;\n if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_INCREF(__pyx_v_s);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n Py_INCREF(__pyx_v_v);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n __pyx_2 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n Py_INCREF(__pyx_v_x);\n __pyx_r = __pyx_v_x;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_final_shape);\n Py_DECREF(__pyx_v_x);\n Py_DECREF(__pyx_v_svd);\n Py_DECREF(__pyx_v_u);\n Py_DECREF(__pyx_v_s);\n Py_DECREF(__pyx_v_v);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_mean);\n Py_DECREF(__pyx_v_cov);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_zeros;\n\nstatic PyObject *__pyx_k117p;\n\nstatic char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n PyObject *__pyx_v_pvals = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_d;\n PyArrayObject *arrayObject_parr;\n PyArrayObject *arrayObject_mnarr;\n double (*__pyx_v_pix);\n long (*__pyx_v_mnix);\n long __pyx_v_i;\n long __pyx_v_j;\n long __pyx_v_dn;\n double __pyx_v_Sum;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_multin;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n __pyx_v_size = __pyx_k59;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_pvals);\n Py_INCREF(__pyx_v_size);\n arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_INCREF(__pyx_v_pvals);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_v_d = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_parr));\n arrayObject_parr = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_INCREF(__pyx_k117p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n __pyx_5 = __pyx_v_size == Py_None;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_5 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_multin);\n __pyx_v_multin = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n Py_INCREF(((PyObject *)__pyx_v_multin));\n Py_DECREF(((PyObject *)arrayObject_mnarr));\n arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n __pyx_v_i = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n while (1) {\n __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n __pyx_v_Sum = 1.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n __pyx_v_dn = __pyx_v_n;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n __pyx_4 = (__pyx_v_d - 1);\n for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n __pyx_5 = (__pyx_v_dn <= 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n goto __pyx_L7;\n goto __pyx_L8;\n }\n __pyx_L8:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n }\n __pyx_L7:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n __pyx_5 = (__pyx_v_dn > 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n goto __pyx_L9;\n }\n __pyx_L9:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n Py_INCREF(__pyx_v_multin);\n __pyx_r = __pyx_v_multin;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_parr);\n Py_DECREF(arrayObject_mnarr);\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_multin);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_pvals);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n long __pyx_v_i;\n long __pyx_v_j;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_v_i = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n while (1) {\n __pyx_5 = (__pyx_v_i > 0);\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n __pyx_v_i = (__pyx_v_i - 1);\n }\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_arange;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n PyObject *__pyx_v_arr;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_4 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_INCREF(__pyx_v_arr);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n Py_INCREF(__pyx_v_arr);\n __pyx_r = __pyx_v_arr;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_arr);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic __Pyx_InternTabEntry __pyx_intern_tab[] = {\n {&__pyx_n_ArgumentError, \"ArgumentError\"},\n {&__pyx_n_Float64, \"Float64\"},\n {&__pyx_n_Int, \"Int\"},\n {&__pyx_n_MT19937, \"MT19937\"},\n {&__pyx_n_ValueError, \"ValueError\"},\n {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n {&__pyx_n__rand, \"_rand\"},\n {&__pyx_n__sp, \"_sp\"},\n {&__pyx_n_add, \"add\"},\n {&__pyx_n_append, \"append\"},\n {&__pyx_n_arange, \"arange\"},\n {&__pyx_n_array, \"array\"},\n {&__pyx_n_beta, \"beta\"},\n {&__pyx_n_binomial, \"binomial\"},\n {&__pyx_n_bytes, \"bytes\"},\n {&__pyx_n_chisquare, \"chisquare\"},\n {&__pyx_n_empty, \"empty\"},\n {&__pyx_n_exponential, \"exponential\"},\n {&__pyx_n_f, \"f\"},\n {&__pyx_n_gamma, \"gamma\"},\n {&__pyx_n_geometric, \"geometric\"},\n {&__pyx_n_get_state, \"get_state\"},\n {&__pyx_n_gumbel, \"gumbel\"},\n {&__pyx_n_hypergeometric, \"hypergeometric\"},\n {&__pyx_n_int, \"int\"},\n {&__pyx_n_isinstance, \"isinstance\"},\n {&__pyx_n_laplace, \"laplace\"},\n {&__pyx_n_len, \"len\"},\n {&__pyx_n_list, \"list\"},\n {&__pyx_n_logistic, \"logistic\"},\n {&__pyx_n_lognormal, \"lognormal\"},\n {&__pyx_n_logseries, \"logseries\"},\n {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n {&__pyx_n_multinomial, \"multinomial\"},\n {&__pyx_n_multiply, \"multiply\"},\n {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n {&__pyx_n_negative_binomial, \"negative_binomial\"},\n {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n {&__pyx_n_noncentral_f, \"noncentral_f\"},\n {&__pyx_n_normal, \"normal\"},\n {&__pyx_n_numpy, \"numpy\"},\n {&__pyx_n_pareto, \"pareto\"},\n {&__pyx_n_permutation, \"permutation\"},\n {&__pyx_n_poisson, \"poisson\"},\n {&__pyx_n_power, \"power\"},\n {&__pyx_n_rand, \"rand\"},\n {&__pyx_n_randint, \"randint\"},\n {&__pyx_n_randn, \"randn\"},\n {&__pyx_n_random, \"random\"},\n {&__pyx_n_random_integers, \"random_integers\"},\n {&__pyx_n_random_sample, \"random_sample\"},\n {&__pyx_n_rayleigh, \"rayleigh\"},\n {&__pyx_n_reduce, \"reduce\"},\n {&__pyx_n_seed, \"seed\"},\n {&__pyx_n_set_state, \"set_state\"},\n {&__pyx_n_shape, \"shape\"},\n {&__pyx_n_shuffle, \"shuffle\"},\n {&__pyx_n_size, \"size\"},\n {&__pyx_n_sqrt, \"sqrt\"},\n {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n {&__pyx_n_standard_exponential, \"standard_exponential\"},\n {&__pyx_n_standard_gamma, \"standard_gamma\"},\n {&__pyx_n_standard_normal, \"standard_normal\"},\n {&__pyx_n_standard_t, \"standard_t\"},\n {&__pyx_n_svd, \"svd\"},\n {&__pyx_n_triangular, \"triangular\"},\n {&__pyx_n_tuple, \"tuple\"},\n {&__pyx_n_type, \"type\"},\n {&__pyx_n_uniform, \"uniform\"},\n {&__pyx_n_vonmises, \"vonmises\"},\n {&__pyx_n_wald, \"wald\"},\n {&__pyx_n_weibull, \"weibull\"},\n {&__pyx_n_zeros, \"zeros\"},\n {&__pyx_n_zipf, \"zipf\"},\n {0, 0}\n};\n\nstatic __Pyx_StringTabEntry __pyx_string_tab[] = {\n {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n {0, 0, 0}\n};\n\nstatic PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n PyObject *o = (*t->tp_alloc)(t, 0);\n struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n return o;\n}\n\nstatic void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n {\n PyObject *etype, *eval, *etb;\n PyErr_Fetch(&etype, &eval, &etb);\n ++o->ob_refcnt;\n __pyx_f_6mtrand_11RandomState___dealloc__(o);\n if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n --o->ob_refcnt;\n PyErr_Restore(etype, eval, etb);\n }\n (*o->ob_type->tp_free)(o);\n}\n\nstatic int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n return 0;\n}\n\nstatic int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n return 0;\n}\n\nstatic struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n {0, 0, 0, 0}\n};\n\nstatic PyNumberMethods __pyx_tp_as_number_RandomState = {\n 0, /*nb_add*/\n 0, /*nb_subtract*/\n 0, /*nb_multiply*/\n 0, /*nb_divide*/\n 0, /*nb_remainder*/\n 0, /*nb_divmod*/\n 0, /*nb_power*/\n 0, /*nb_negative*/\n 0, /*nb_positive*/\n 0, /*nb_absolute*/\n 0, /*nb_nonzero*/\n 0, /*nb_invert*/\n 0, /*nb_lshift*/\n 0, /*nb_rshift*/\n 0, /*nb_and*/\n 0, /*nb_xor*/\n 0, /*nb_or*/\n 0, /*nb_coerce*/\n 0, /*nb_int*/\n 0, /*nb_long*/\n 0, /*nb_float*/\n 0, /*nb_oct*/\n 0, /*nb_hex*/\n 0, /*nb_inplace_add*/\n 0, /*nb_inplace_subtract*/\n 0, /*nb_inplace_multiply*/\n 0, /*nb_inplace_divide*/\n 0, /*nb_inplace_remainder*/\n 0, /*nb_inplace_power*/\n 0, /*nb_inplace_lshift*/\n 0, /*nb_inplace_rshift*/\n 0, /*nb_inplace_and*/\n 0, /*nb_inplace_xor*/\n 0, /*nb_inplace_or*/\n 0, /*nb_floor_divide*/\n 0, /*nb_true_divide*/\n 0, /*nb_inplace_floor_divide*/\n 0, /*nb_inplace_true_divide*/\n};\n\nstatic PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n 0, /*sq_length*/\n 0, /*sq_concat*/\n 0, /*sq_repeat*/\n 0, /*sq_item*/\n 0, /*sq_slice*/\n 0, /*sq_ass_item*/\n 0, /*sq_ass_slice*/\n 0, /*sq_contains*/\n 0, /*sq_inplace_concat*/\n 0, /*sq_inplace_repeat*/\n};\n\nstatic PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n 0, /*mp_length*/\n 0, /*mp_subscript*/\n 0, /*mp_ass_subscript*/\n};\n\nstatic PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n 0, /*bf_getreadbuffer*/\n 0, /*bf_getwritebuffer*/\n 0, /*bf_getsegcount*/\n 0, /*bf_getcharbuffer*/\n};\n\nstatichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n PyObject_HEAD_INIT(0)\n 0, /*ob_size*/\n \"mtrand.RandomState\", /*tp_name*/\n sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n 0, /*tp_itemsize*/\n __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n 0, /*tp_print*/\n 0, /*tp_getattr*/\n 0, /*tp_setattr*/\n 0, /*tp_compare*/\n 0, /*tp_repr*/\n &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n 0, /*tp_hash*/\n 0, /*tp_call*/\n 0, /*tp_str*/\n 0, /*tp_getattro*/\n 0, /*tp_setattro*/\n &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n 0, /*tp_richcompare*/\n 0, /*tp_weaklistoffset*/\n 0, /*tp_iter*/\n 0, /*tp_iternext*/\n __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n 0, /*tp_members*/\n 0, /*tp_getset*/\n 0, /*tp_base*/\n 0, /*tp_dict*/\n 0, /*tp_descr_get*/\n 0, /*tp_descr_set*/\n 0, /*tp_dictoffset*/\n __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n 0, /*tp_alloc*/\n __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n 0, /*tp_free*/\n 0, /*tp_is_gc*/\n 0, /*tp_bases*/\n 0, /*tp_mro*/\n 0, /*tp_cache*/\n 0, /*tp_subclasses*/\n 0, /*tp_weaklist*/\n};\n\nstatic struct PyMethodDef __pyx_methods[] = {\n {0, 0, 0, 0}\n};\n\nDL_EXPORT(void) initmtrand(void); /*proto*/\nDL_EXPORT(void) initmtrand(void) {\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_b = PyImport_AddModule(\"__builtin__\");\n if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n import_array();\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n Py_INCREF(Py_None);\n __pyx_k2 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n Py_INCREF(Py_None);\n __pyx_k3 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n Py_INCREF(Py_None);\n __pyx_k4 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n Py_INCREF(Py_None);\n __pyx_k5 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n Py_INCREF(Py_None);\n __pyx_k6 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k7 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n __pyx_k8 = 0.0;\n __pyx_k9 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k10 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n Py_INCREF(Py_None);\n __pyx_k11 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k12 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n Py_INCREF(Py_None);\n __pyx_k13 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n __pyx_k14 = 0.0;\n __pyx_k15 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k16 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n Py_INCREF(Py_None);\n __pyx_k17 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n __pyx_k18 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k19 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n Py_INCREF(Py_None);\n __pyx_k20 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n Py_INCREF(Py_None);\n __pyx_k21 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n __pyx_k22 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k23 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n Py_INCREF(Py_None);\n __pyx_k24 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n Py_INCREF(Py_None);\n __pyx_k25 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n Py_INCREF(Py_None);\n __pyx_k26 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n Py_INCREF(Py_None);\n __pyx_k27 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n Py_INCREF(Py_None);\n __pyx_k28 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n Py_INCREF(Py_None);\n __pyx_k29 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n Py_INCREF(Py_None);\n __pyx_k30 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n Py_INCREF(Py_None);\n __pyx_k31 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n Py_INCREF(Py_None);\n __pyx_k32 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n Py_INCREF(Py_None);\n __pyx_k33 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n __pyx_k34 = 0.0;\n __pyx_k35 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k36 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n __pyx_k37 = 0.0;\n __pyx_k38 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k39 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n __pyx_k40 = 0.0;\n __pyx_k41 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k42 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n __pyx_k43 = 0.0;\n __pyx_k44 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k45 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n __pyx_k46 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k47 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n Py_INCREF(Py_None);\n __pyx_k48 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n Py_INCREF(Py_None);\n __pyx_k49 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n Py_INCREF(Py_None);\n __pyx_k50 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n Py_INCREF(Py_None);\n __pyx_k51 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n __pyx_k52 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k53 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n Py_INCREF(Py_None);\n __pyx_k54 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n Py_INCREF(Py_None);\n __pyx_k55 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n Py_INCREF(Py_None);\n __pyx_k56 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n Py_INCREF(Py_None);\n __pyx_k57 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n Py_INCREF(Py_None);\n __pyx_k58 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n Py_INCREF(Py_None);\n __pyx_k59 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n return;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n __Pyx_AddTraceback(\"mtrand\");\n}\n\nstatic char *__pyx_filenames[] = {\n \"mtrand.pyx\",\n \"numpy.pxi\",\n};\nstatichere char **__pyx_f = __pyx_filenames;\n\n/* Runtime support code */\n\nstatic int __Pyx_GetStarArgs(\n PyObject **args, \n PyObject **kwds,\n char *kwd_list[], \n int nargs,\n PyObject **args2, \n PyObject **kwds2)\n{\n PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n \n if (args2)\n *args2 = 0;\n if (kwds2)\n *kwds2 = 0;\n \n if (args2) {\n args1 = PyTuple_GetSlice(*args, 0, nargs);\n if (!args1)\n goto bad;\n *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n if (!*args2)\n goto bad;\n }\n else {\n args1 = *args;\n Py_INCREF(args1);\n }\n \n if (kwds2) {\n if (*kwds) {\n char **p;\n kwds1 = PyDict_New();\n if (!kwds)\n goto bad;\n *kwds2 = PyDict_Copy(*kwds);\n if (!*kwds2)\n goto bad;\n for (p = kwd_list; *p; p++) {\n x = PyDict_GetItemString(*kwds, *p);\n if (x) {\n if (PyDict_SetItemString(kwds1, *p, x) < 0)\n goto bad;\n if (PyDict_DelItemString(*kwds2, *p) < 0)\n goto bad;\n }\n }\n }\n else {\n *kwds2 = PyDict_New();\n if (!*kwds2)\n goto bad;\n }\n }\n else {\n kwds1 = *kwds;\n Py_XINCREF(kwds1);\n }\n \n *args = args1;\n *kwds = kwds1;\n return 0;\nbad:\n Py_XDECREF(args1);\n Py_XDECREF(kwds1);\n Py_XDECREF(*args2);\n Py_XDECREF(*kwds2);\n return -1;\n}\n\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n PyObject *__import__ = 0;\n PyObject *empty_list = 0;\n PyObject *module = 0;\n PyObject *global_dict = 0;\n PyObject *empty_dict = 0;\n PyObject *list;\n __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n if (!__import__)\n goto bad;\n if (from_list)\n list = from_list;\n else {\n empty_list = PyList_New(0);\n if (!empty_list)\n goto bad;\n list = empty_list;\n }\n global_dict = PyModule_GetDict(__pyx_m);\n if (!global_dict)\n goto bad;\n empty_dict = PyDict_New();\n if (!empty_dict)\n goto bad;\n module = PyObject_CallFunction(__import__, \"OOOO\",\n name, global_dict, empty_dict, list);\nbad:\n Py_XDECREF(empty_list);\n Py_XDECREF(__import__);\n Py_XDECREF(empty_dict);\n return module;\n}\n\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n PyObject *result;\n result = PyObject_GetAttr(dict, name);\n if (!result)\n PyErr_SetObject(PyExc_NameError, name);\n return result;\n}\n\nstatic void __Pyx_WriteUnraisable(char *name) {\n PyObject *old_exc, *old_val, *old_tb;\n PyObject *ctx;\n PyErr_Fetch(&old_exc, &old_val, &old_tb);\n ctx = PyString_FromString(name);\n PyErr_Restore(old_exc, old_val, old_tb);\n if (!ctx)\n ctx = Py_None;\n PyErr_WriteUnraisable(ctx);\n}\n\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n Py_XINCREF(type);\n Py_XINCREF(value);\n Py_XINCREF(tb);\n /* First, check the traceback argument, replacing None with NULL. */\n if (tb == Py_None) {\n Py_DECREF(tb);\n tb = 0;\n }\n else if (tb != NULL && !PyTraceBack_Check(tb)) {\n PyErr_SetString(PyExc_TypeError,\n \"raise: arg 3 must be a traceback or None\");\n goto raise_error;\n }\n /* Next, replace a missing value with None */\n if (value == NULL) {\n value = Py_None;\n Py_INCREF(value);\n }\n /* Next, repeatedly, replace a tuple exception with its first item */\n while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n PyObject *tmp = type;\n type = PyTuple_GET_ITEM(type, 0);\n Py_INCREF(type);\n Py_DECREF(tmp);\n }\n if (PyString_Check(type))\n ;\n else if (PyClass_Check(type))\n ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n else if (PyInstance_Check(type)) {\n /* Raising an instance. The value should be a dummy. */\n if (value != Py_None) {\n PyErr_SetString(PyExc_TypeError,\n \"instance exception may not have a separate value\");\n goto raise_error;\n }\n else {\n /* Normalize to raise , */\n Py_DECREF(value);\n value = type;\n type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n Py_INCREF(type);\n }\n }\n else {\n /* Not something you can raise. You get an exception\n anyway, just not what you specified :-) */\n PyErr_Format(PyExc_TypeError,\n \"exceptions must be strings, classes, or \"\n \"instances, not %s\", type->ob_type->tp_name);\n goto raise_error;\n }\n PyErr_Restore(type, value, tb);\n return;\nraise_error:\n Py_XDECREF(value);\n Py_XDECREF(type);\n Py_XDECREF(tb);\n return;\n}\n\nstatic void __Pyx_UnpackError(void) {\n PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n}\n\nstatic PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (!item) {\n if (PyErr_ExceptionMatches(PyExc_IndexError))\n __Pyx_UnpackError();\n }\n return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (item) {\n Py_DECREF(item);\n __Pyx_UnpackError();\n return -1;\n }\n PyErr_Clear();\n return 0;\n}\n\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n while (t->p) {\n *t->p = PyString_InternFromString(t->s);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n while (t->p) {\n *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n long size) \n{\n PyObject *py_module_name = 0;\n PyObject *py_class_name = 0;\n PyObject *py_name_list = 0;\n PyObject *py_module = 0;\n PyObject *result = 0;\n \n py_module_name = PyString_FromString(module_name);\n if (!py_module_name)\n goto bad;\n py_class_name = PyString_FromString(class_name);\n if (!py_class_name)\n goto bad;\n py_name_list = PyList_New(1);\n if (!py_name_list)\n goto bad;\n Py_INCREF(py_class_name);\n if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n goto bad;\n py_module = __Pyx_Import(py_module_name, py_name_list);\n if (!py_module)\n goto bad;\n result = PyObject_GetAttr(py_module, py_class_name);\n if (!result)\n goto bad;\n if (!PyType_Check(result)) {\n PyErr_Format(PyExc_TypeError, \n \"%s.%s is not a type object\",\n module_name, class_name);\n goto bad;\n }\n if (((PyTypeObject *)result)->tp_basicsize != size) {\n PyErr_Format(PyExc_ValueError, \n \"%s.%s does not appear to be the correct type object\",\n module_name, class_name);\n goto bad;\n }\n goto done;\nbad:\n Py_XDECREF(result);\n result = 0;\ndone:\n Py_XDECREF(py_module_name);\n Py_XDECREF(py_class_name);\n Py_XDECREF(py_name_list);\n return (PyTypeObject *)result;\n}\n\n#include \"compile.h\"\n#include \"frameobject.h\"\n#include \"traceback.h\"\n\nstatic void __Pyx_AddTraceback(char *funcname) {\n PyObject *py_srcfile = 0;\n PyObject *py_funcname = 0;\n PyObject *py_globals = 0;\n PyObject *empty_tuple = 0;\n PyObject *empty_string = 0;\n PyCodeObject *py_code = 0;\n PyFrameObject *py_frame = 0;\n \n py_srcfile = PyString_FromString(__pyx_filename);\n if (!py_srcfile) goto bad;\n py_funcname = PyString_FromString(funcname);\n if (!py_funcname) goto bad;\n py_globals = PyModule_GetDict(__pyx_m);\n if (!py_globals) goto bad;\n empty_tuple = PyTuple_New(0);\n if (!empty_tuple) goto bad;\n empty_string = PyString_FromString(\"\");\n if (!empty_string) goto bad;\n py_code = PyCode_New(\n 0, /*int argcount,*/\n 0, /*int nlocals,*/\n 0, /*int stacksize,*/\n 0, /*int flags,*/\n empty_string, /*PyObject *code,*/\n empty_tuple, /*PyObject *consts,*/\n empty_tuple, /*PyObject *names,*/\n empty_tuple, /*PyObject *varnames,*/\n empty_tuple, /*PyObject *freevars,*/\n empty_tuple, /*PyObject *cellvars,*/\n py_srcfile, /*PyObject *filename,*/\n py_funcname, /*PyObject *name,*/\n __pyx_lineno, /*int firstlineno,*/\n empty_string /*PyObject *lnotab*/\n );\n if (!py_code) goto bad;\n py_frame = PyFrame_New(\n PyThreadState_Get(), /*PyThreadState *tstate,*/\n py_code, /*PyCodeObject *code,*/\n py_globals, /*PyObject *globals,*/\n 0 /*PyObject *locals*/\n );\n if (!py_frame) goto bad;\n py_frame->f_lineno = __pyx_lineno;\n PyTraceBack_Here(py_frame);\nbad:\n Py_XDECREF(py_srcfile);\n Py_XDECREF(py_funcname);\n Py_XDECREF(empty_tuple);\n Py_XDECREF(empty_string);\n Py_XDECREF(py_code);\n Py_XDECREF(py_frame);\n}\n", + "source_code_before": null, + "methods": [ + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + } + ], + "nloc": 4970, + "complexity": 908, + "token_count": 48058, + "diff_parsed": { + "added": [ + "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */", + "", + "#include \"Python.h\"", + "#include \"structmember.h\"", + "#ifndef PY_LONG_LONG", + " #define PY_LONG_LONG LONG_LONG", + "#endif", + "#include \"string.h\"", + "#include \"math.h\"", + "#include \"numpy/arrayobject.h\"", + "#include \"randomkit.h\"", + "#include \"distributions.h\"", + "#include \"initarray.h\"", + "", + "", + "typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/", + "typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/", + "static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/", + "static int __Pyx_EndUnpack(PyObject *, int); /*proto*/", + "static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/", + "static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/", + "static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/", + "static void __Pyx_WriteUnraisable(char *name); /*proto*/", + "static void __Pyx_AddTraceback(char *funcname); /*proto*/", + "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/", + "static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/", + "static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/", + "static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/", + "", + "static PyObject *__pyx_m;", + "static PyObject *__pyx_b;", + "static int __pyx_lineno;", + "static char *__pyx_filename;", + "staticforward char **__pyx_f;", + "", + "/* Declarations from mtrand */", + "", + "staticforward PyTypeObject __pyx_type_6mtrand_RandomState;", + "", + "struct __pyx_obj_6mtrand_RandomState {", + " PyObject_HEAD", + " rk_state (*internal_state);", + "};", + "", + "static PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;", + "static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;", + "static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;", + "static PyObject *__pyx_k2;", + "static PyObject *__pyx_k3;", + "static PyObject *__pyx_k4;", + "static PyObject *__pyx_k5;", + "static PyObject *__pyx_k6;", + "static PyObject *__pyx_k7;", + "static double __pyx_k8;", + "static double __pyx_k9;", + "static PyObject *__pyx_k10;", + "static PyObject *__pyx_k11;", + "static PyObject *__pyx_k12;", + "static PyObject *__pyx_k13;", + "static double __pyx_k14;", + "static double __pyx_k15;", + "static PyObject *__pyx_k16;", + "static PyObject *__pyx_k17;", + "static double __pyx_k18;", + "static PyObject *__pyx_k19;", + "static PyObject *__pyx_k20;", + "static PyObject *__pyx_k21;", + "static double __pyx_k22;", + "static PyObject *__pyx_k23;", + "static PyObject *__pyx_k24;", + "static PyObject *__pyx_k25;", + "static PyObject *__pyx_k26;", + "static PyObject *__pyx_k27;", + "static PyObject *__pyx_k28;", + "static PyObject *__pyx_k29;", + "static PyObject *__pyx_k30;", + "static PyObject *__pyx_k31;", + "static PyObject *__pyx_k32;", + "static PyObject *__pyx_k33;", + "static double __pyx_k34;", + "static double __pyx_k35;", + "static PyObject *__pyx_k36;", + "static double __pyx_k37;", + "static double __pyx_k38;", + "static PyObject *__pyx_k39;", + "static double __pyx_k40;", + "static double __pyx_k41;", + "static PyObject *__pyx_k42;", + "static double __pyx_k43;", + "static double __pyx_k44;", + "static PyObject *__pyx_k45;", + "static double __pyx_k46;", + "static PyObject *__pyx_k47;", + "static PyObject *__pyx_k48;", + "static PyObject *__pyx_k49;", + "static PyObject *__pyx_k50;", + "static PyObject *__pyx_k51;", + "static double __pyx_k52;", + "static PyObject *__pyx_k53;", + "static PyObject *__pyx_k54;", + "static PyObject *__pyx_k55;", + "static PyObject *__pyx_k56;", + "static PyObject *__pyx_k57;", + "static PyObject *__pyx_k58;", + "static PyObject *__pyx_k59;", + "static PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/", + "static PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/", + "static double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/", + "", + "/* Implementation of mtrand */", + "", + "", + "static PyObject *__pyx_n__sp;", + "static PyObject *__pyx_n__rand;", + "static PyObject *__pyx_n_seed;", + "static PyObject *__pyx_n_get_state;", + "static PyObject *__pyx_n_set_state;", + "static PyObject *__pyx_n_random_sample;", + "static PyObject *__pyx_n_randint;", + "static PyObject *__pyx_n_bytes;", + "static PyObject *__pyx_n_uniform;", + "static PyObject *__pyx_n_rand;", + "static PyObject *__pyx_n_randn;", + "static PyObject *__pyx_n_random_integers;", + "static PyObject *__pyx_n_standard_normal;", + "static PyObject *__pyx_n_normal;", + "static PyObject *__pyx_n_beta;", + "static PyObject *__pyx_n_exponential;", + "static PyObject *__pyx_n_standard_exponential;", + "static PyObject *__pyx_n_standard_gamma;", + "static PyObject *__pyx_n_gamma;", + "static PyObject *__pyx_n_f;", + "static PyObject *__pyx_n_noncentral_f;", + "static PyObject *__pyx_n_chisquare;", + "static PyObject *__pyx_n_noncentral_chisquare;", + "static PyObject *__pyx_n_standard_cauchy;", + "static PyObject *__pyx_n_standard_t;", + "static PyObject *__pyx_n_vonmises;", + "static PyObject *__pyx_n_pareto;", + "static PyObject *__pyx_n_weibull;", + "static PyObject *__pyx_n_power;", + "static PyObject *__pyx_n_laplace;", + "static PyObject *__pyx_n_gumbel;", + "static PyObject *__pyx_n_logistic;", + "static PyObject *__pyx_n_lognormal;", + "static PyObject *__pyx_n_rayleigh;", + "static PyObject *__pyx_n_wald;", + "static PyObject *__pyx_n_triangular;", + "static PyObject *__pyx_n_binomial;", + "static PyObject *__pyx_n_negative_binomial;", + "static PyObject *__pyx_n_poisson;", + "static PyObject *__pyx_n_zipf;", + "static PyObject *__pyx_n_geometric;", + "static PyObject *__pyx_n_hypergeometric;", + "static PyObject *__pyx_n_logseries;", + "static PyObject *__pyx_n_multivariate_normal;", + "static PyObject *__pyx_n_multinomial;", + "static PyObject *__pyx_n_shuffle;", + "static PyObject *__pyx_n_permutation;", + "static PyObject *__pyx_n_numpy;", + "", + "static PyObject *__pyx_n_empty;", + "static PyObject *__pyx_n_Float64;", + "", + "static PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont0_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont1_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont2_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {", + " double (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */", + " __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */", + " __pyx_v_array_data = ((double (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.cont3_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_Int;", + "", + "static PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.disc0_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discnp_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discnmN_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */", + " (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.discd_array\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {", + " double __pyx_v_c;", + " double __pyx_v_y;", + " double __pyx_v_t;", + " double __pyx_v_sum;", + " long __pyx_v_i;", + " double __pyx_r;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */", + " __pyx_v_sum = (__pyx_v_darr[0]);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */", + " __pyx_v_c = 0.0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */", + " for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */", + " __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */", + " __pyx_v_t = (__pyx_v_sum + __pyx_v_y);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */", + " __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */", + " __pyx_v_sum = __pyx_v_t;", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */", + " __pyx_r = __pyx_v_sum;", + " goto __pyx_L0;", + "", + " __pyx_r = 0;", + " goto __pyx_L0;", + " __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");", + " __pyx_L0:;", + " return __pyx_r;", + "}", + "", + "static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_seed = 0;", + " int __pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {\"seed\",0};", + " __pyx_v_seed = __pyx_k2;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_seed);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */", + " ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_seed);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " __pyx_r = 0;", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");", + " __pyx_r = -1;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_seed);", + " return __pyx_r;", + "}", + "", + "static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/", + "static void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {", + " int __pyx_1;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */", + " __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */", + " PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " goto __pyx_L0;", + " __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + "}", + "", + "static PyObject *__pyx_n_type;", + "static PyObject *__pyx_n_int;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_seed = 0;", + " rk_error __pyx_v_errcode;", + " PyArrayObject *arrayObject_obj;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " unsigned long __pyx_5;", + " static char *__pyx_argnames[] = {\"seed\",0};", + " __pyx_v_seed = __pyx_k3;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_seed);", + " arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */", + " __pyx_1 = __pyx_v_seed == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */", + " __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_seed);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}", + " __pyx_1 = __pyx_4 == __pyx_2;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */", + " __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}", + " rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */", + " __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_3));", + " Py_DECREF(((PyObject *)arrayObject_obj));", + " arrayObject_obj = ((PyArrayObject *)__pyx_3);", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */", + " init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.seed\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_obj);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_seed);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_MT19937;", + "", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyArrayObject *arrayObject_state;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + " arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " __pyx_1 = 0;", + " __pyx_4 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_INCREF(((PyObject *)__pyx_1));", + " Py_DECREF(((PyObject *)arrayObject_state));", + " arrayObject_state = ((PyArrayObject *)__pyx_1);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */", + " memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */", + " __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}", + " Py_INCREF(__pyx_n_MT19937);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);", + " Py_INCREF(((PyObject *)arrayObject_state));", + " PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));", + " PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_state);", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_ValueError;", + "", + "static PyObject *__pyx_k62p;", + "static PyObject *__pyx_k63p;", + "", + "static char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";", + "static char (__pyx_k63[]) = \"state must be 624 longs\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_state = 0;", + " PyArrayObject *arrayObject_obj;", + " int __pyx_v_pos;", + " PyObject *__pyx_v_algorithm_name;", + " PyObject *__pyx_v_key;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " int __pyx_3;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"state\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_state);", + " arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);", + " __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);", + " __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_algorithm_name);", + " __pyx_v_algorithm_name = __pyx_2;", + " __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */", + " if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}", + " __pyx_3 = __pyx_3 != 0;", + " if (__pyx_3) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " Py_INCREF(__pyx_k62p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);", + " __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */", + " __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_key);", + " __pyx_v_key = __pyx_2;", + " __pyx_2 = 0;", + " __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_v_pos = __pyx_3;", + " if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */", + " __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject_obj));", + " arrayObject_obj = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */", + " __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);", + " if (__pyx_3) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " Py_INCREF(__pyx_k63p);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */", + " memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */", + " ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_obj);", + " Py_DECREF(__pyx_v_algorithm_name);", + " Py_DECREF(__pyx_v_key);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_state);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_state = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " static char *__pyx_argnames[] = {\"state\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_state);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_state);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_random;", + "static PyObject *__pyx_n___RandomState_ctor;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);", + " __pyx_1 = 0;", + " __pyx_2 = 0;", + " __pyx_5 = 0;", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k4;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k5;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */", + " __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k64p;", + "", + "static char (__pyx_k64[]) = \"low >= high\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_low = 0;", + " PyObject *__pyx_v_high = 0;", + " PyObject *__pyx_v_size = 0;", + " long __pyx_v_lo;", + " long __pyx_v_hi;", + " long __pyx_v_diff;", + " long (*__pyx_v_array_data);", + " PyArrayObject *arrayObject;", + " long __pyx_v_length;", + " long __pyx_v_i;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " long __pyx_2;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_high = __pyx_k6;", + " __pyx_v_size = __pyx_k7;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_low);", + " Py_INCREF(__pyx_v_high);", + " Py_INCREF(__pyx_v_size);", + " arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */", + " __pyx_1 = __pyx_v_high == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */", + " __pyx_v_lo = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}", + " __pyx_v_hi = __pyx_2;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}", + " __pyx_v_lo = __pyx_2;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */", + " __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}", + " __pyx_v_hi = __pyx_2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */", + " __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */", + " __pyx_1 = (__pyx_v_diff < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " Py_INCREF(__pyx_k64p);", + " PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);", + " __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __Pyx_Raise(__pyx_5, 0, 0);", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */", + " __pyx_1 = __pyx_v_size == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */", + " __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}", + " __pyx_r = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L0;", + " goto __pyx_L4;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */", + " __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_INCREF(((PyObject *)__pyx_4));", + " Py_DECREF(((PyObject *)arrayObject));", + " arrayObject = ((PyArrayObject *)__pyx_4);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */", + " __pyx_v_length = PyArray_SIZE(arrayObject);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */", + " __pyx_v_array_data = ((long (*))arrayObject->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */", + " for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */", + " (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */", + " Py_INCREF(((PyObject *)arrayObject));", + " __pyx_r = ((PyObject *)arrayObject);", + " goto __pyx_L0;", + " }", + " __pyx_L4:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.randint\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " unsigned int __pyx_v_length;", + " void (*__pyx_v_bytes);", + " PyObject *__pyx_v_bytestring;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"length\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;", + " Py_INCREF(__pyx_v_self);", + " __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */", + " __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */", + " rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */", + " __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_bytestring);", + " __pyx_v_bytestring = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */", + " PyMem_Free(__pyx_v_bytes);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */", + " Py_INCREF(__pyx_v_bytestring);", + " __pyx_r = __pyx_v_bytestring;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_bytestring);", + " Py_DECREF(__pyx_v_self);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_low;", + " double __pyx_v_high;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_low = __pyx_k8;", + " __pyx_v_high = __pyx_k9;", + " __pyx_v_size = __pyx_k10;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */", + " __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_len;", + "static PyObject *__pyx_n_size;", + "", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_args = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {0};", + " if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " Py_XDECREF(__pyx_v_args);", + " return 0;", + " }", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 == 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_r = __pyx_5;", + " __pyx_5 = 0;", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.rand\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_XDECREF(__pyx_v_args);", + " Py_DECREF(__pyx_v_self);", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_args = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " static char *__pyx_argnames[] = {0};", + " if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " Py_XDECREF(__pyx_v_args);", + " return 0;", + " }", + " Py_INCREF(__pyx_v_self);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 == 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_args);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + " }", + " __pyx_L2:;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.randn\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_XDECREF(__pyx_v_args);", + " Py_DECREF(__pyx_v_self);", + " Py_XDECREF(__pyx_args);", + " Py_XDECREF(__pyx_kwds);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_low = 0;", + " PyObject *__pyx_v_high = 0;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};", + " __pyx_v_high = __pyx_k11;", + " __pyx_v_size = __pyx_k12;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_low);", + " Py_INCREF(__pyx_v_high);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */", + " __pyx_1 = __pyx_v_high == Py_None;", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */", + " Py_INCREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " __pyx_v_high = __pyx_v_low;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */", + " __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_low);", + " __pyx_v_low = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */", + " __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_low);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);", + " __pyx_4 = 0;", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_r = __pyx_4;", + " __pyx_4 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_low);", + " Py_DECREF(__pyx_v_high);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k13;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k66p;", + "", + "static char (__pyx_k66[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k14;", + " __pyx_v_scale = __pyx_k15;", + " __pyx_v_size = __pyx_k16;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " Py_INCREF(__pyx_k66p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k67p;", + "static PyObject *__pyx_k68p;", + "", + "static char (__pyx_k67[]) = \"a <= 0\";", + "static char (__pyx_k68[]) = \"b <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " double __pyx_v_b;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};", + " __pyx_v_size = __pyx_k17;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " Py_INCREF(__pyx_k67p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_b <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " Py_INCREF(__pyx_k68p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.beta\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k69p;", + "", + "static char (__pyx_k69[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k18;", + " __pyx_v_size = __pyx_k19;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " Py_INCREF(__pyx_k69p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k20;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k70p;", + "", + "static char (__pyx_k70[]) = \"shape <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_shape;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"shape\",\"size\",0};", + " __pyx_v_size = __pyx_k21;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */", + " __pyx_1 = (__pyx_v_shape <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " Py_INCREF(__pyx_k70p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k71p;", + "static PyObject *__pyx_k72p;", + "", + "static char (__pyx_k71[]) = \"shape <= 0\";", + "static char (__pyx_k72[]) = \"scale <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_shape;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k22;", + " __pyx_v_size = __pyx_k23;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */", + " __pyx_1 = (__pyx_v_shape <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " Py_INCREF(__pyx_k71p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_scale <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " Py_INCREF(__pyx_k72p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k73p;", + "static PyObject *__pyx_k74p;", + "", + "static char (__pyx_k73[]) = \"dfnum <= 0\";", + "static char (__pyx_k74[]) = \"dfden <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_dfnum;", + " double __pyx_v_dfden;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};", + " __pyx_v_size = __pyx_k24;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */", + " __pyx_1 = (__pyx_v_dfnum <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " Py_INCREF(__pyx_k73p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_dfden <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " Py_INCREF(__pyx_k74p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.f\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k75p;", + "static PyObject *__pyx_k76p;", + "static PyObject *__pyx_k77p;", + "", + "static char (__pyx_k75[]) = \"dfnum <= 1\";", + "static char (__pyx_k76[]) = \"dfden <= 0\";", + "static char (__pyx_k77[]) = \"nonc < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_dfnum;", + " double __pyx_v_dfden;", + " double __pyx_v_nonc;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};", + " __pyx_v_size = __pyx_k25;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */", + " __pyx_1 = (__pyx_v_dfnum <= 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " Py_INCREF(__pyx_k75p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_dfden <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " Py_INCREF(__pyx_k76p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nonc < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " Py_INCREF(__pyx_k77p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */", + " __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k78p;", + "", + "static char (__pyx_k78[]) = \"df <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"size\",0};", + " __pyx_v_size = __pyx_k26;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */", + " __pyx_1 = (__pyx_v_df <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " Py_INCREF(__pyx_k78p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k79p;", + "static PyObject *__pyx_k80p;", + "", + "static char (__pyx_k79[]) = \"df <= 1\";", + "static char (__pyx_k80[]) = \"nonc < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " double __pyx_v_nonc;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};", + " __pyx_v_size = __pyx_k27;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */", + " __pyx_1 = (__pyx_v_df <= 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " Py_INCREF(__pyx_k79p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nonc < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " Py_INCREF(__pyx_k80p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " static char *__pyx_argnames[] = {\"size\",0};", + " __pyx_v_size = __pyx_k28;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */", + " __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}", + " __pyx_r = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k81p;", + "", + "static char (__pyx_k81[]) = \"df <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_df;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"df\",\"size\",0};", + " __pyx_v_size = __pyx_k29;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */", + " __pyx_1 = (__pyx_v_df <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " Py_INCREF(__pyx_k81p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k82p;", + "", + "static char (__pyx_k82[]) = \"kappa < 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mu;", + " double __pyx_v_kappa;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};", + " __pyx_v_size = __pyx_k30;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */", + " __pyx_1 = (__pyx_v_kappa < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " Py_INCREF(__pyx_k82p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k83p;", + "", + "static char (__pyx_k83[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k31;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " Py_INCREF(__pyx_k83p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k84p;", + "", + "static char (__pyx_k84[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k32;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " Py_INCREF(__pyx_k84p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k85p;", + "", + "static char (__pyx_k85[]) = \"a <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k33;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */", + " __pyx_1 = (__pyx_v_a <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " Py_INCREF(__pyx_k85p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.power\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k86p;", + "", + "static char (__pyx_k86[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k34;", + " __pyx_v_scale = __pyx_k35;", + " __pyx_v_size = __pyx_k36;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " Py_INCREF(__pyx_k86p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k87p;", + "", + "static char (__pyx_k87[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k37;", + " __pyx_v_scale = __pyx_k38;", + " __pyx_v_size = __pyx_k39;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " Py_INCREF(__pyx_k87p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k88p;", + "", + "static char (__pyx_k88[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_loc;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};", + " __pyx_v_loc = __pyx_k40;", + " __pyx_v_scale = __pyx_k41;", + " __pyx_v_size = __pyx_k42;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " Py_INCREF(__pyx_k88p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k89p;", + "", + "static char (__pyx_k89[]) = \"sigma <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mean;", + " double __pyx_v_sigma;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};", + " __pyx_v_mean = __pyx_k43;", + " __pyx_v_sigma = __pyx_k44;", + " __pyx_v_size = __pyx_k45;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */", + " __pyx_1 = (__pyx_v_sigma <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " Py_INCREF(__pyx_k89p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k90p;", + "", + "static char (__pyx_k90[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"scale\",\"size\",0};", + " __pyx_v_scale = __pyx_k46;", + " __pyx_v_size = __pyx_k47;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " Py_INCREF(__pyx_k90p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */", + " __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k91p;", + "static PyObject *__pyx_k92p;", + "", + "static char (__pyx_k91[]) = \"mean <= 0.0\";", + "static char (__pyx_k92[]) = \"scale <= 0.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_mean;", + " double __pyx_v_scale;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};", + " __pyx_v_size = __pyx_k48;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */", + " __pyx_1 = (__pyx_v_mean <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " Py_INCREF(__pyx_k91p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_scale <= 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " Py_INCREF(__pyx_k92p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */", + " __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.wald\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k93p;", + "static PyObject *__pyx_k94p;", + "static PyObject *__pyx_k95p;", + "", + "static char (__pyx_k93[]) = \"left > mode\";", + "static char (__pyx_k94[]) = \"mode > right\";", + "static char (__pyx_k95[]) = \"left == right\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_left;", + " double __pyx_v_mode;", + " double __pyx_v_right;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};", + " __pyx_v_size = __pyx_k49;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */", + " __pyx_1 = (__pyx_v_left > __pyx_v_mode);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " Py_INCREF(__pyx_k93p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_mode > __pyx_v_right);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " Py_INCREF(__pyx_k94p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_left == __pyx_v_right);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " Py_INCREF(__pyx_k95p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */", + " __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k96p;", + "static PyObject *__pyx_k97p;", + "static PyObject *__pyx_k98p;", + "", + "static char (__pyx_k96[]) = \"n <= 0\";", + "static char (__pyx_k97[]) = \"p < 0\";", + "static char (__pyx_k98[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k50;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */", + " __pyx_1 = (__pyx_v_n <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " Py_INCREF(__pyx_k96p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " Py_INCREF(__pyx_k97p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " Py_INCREF(__pyx_k98p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */", + " __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k99p;", + "static PyObject *__pyx_k100p;", + "static PyObject *__pyx_k101p;", + "", + "static char (__pyx_k99[]) = \"n <= 0\";", + "static char (__pyx_k100[]) = \"p < 0\";", + "static char (__pyx_k101[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k51;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */", + " __pyx_1 = (__pyx_v_n <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " Py_INCREF(__pyx_k99p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " Py_INCREF(__pyx_k100p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " Py_INCREF(__pyx_k101p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */", + " __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k102p;", + "", + "static char (__pyx_k102[]) = \"lam <= 0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_lam;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"lam\",\"size\",0};", + " __pyx_v_lam = __pyx_k52;", + " __pyx_v_size = __pyx_k53;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */", + " __pyx_1 = (__pyx_v_lam <= 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " Py_INCREF(__pyx_k102p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k103p;", + "", + "static char (__pyx_k103[]) = \"a <= 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_a;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"a\",\"size\",0};", + " __pyx_v_size = __pyx_k54;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */", + " __pyx_1 = (__pyx_v_a <= 1.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " Py_INCREF(__pyx_k103p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k104p;", + "static PyObject *__pyx_k105p;", + "", + "static char (__pyx_k104[]) = \"p < 0.0\";", + "static char (__pyx_k105[]) = \"p > 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k55;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */", + " __pyx_1 = (__pyx_v_p < 0.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " Py_INCREF(__pyx_k104p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1.0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " Py_INCREF(__pyx_k105p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k106p;", + "static PyObject *__pyx_k107p;", + "static PyObject *__pyx_k108p;", + "static PyObject *__pyx_k109p;", + "", + "static char (__pyx_k106[]) = \"ngood < 1\";", + "static char (__pyx_k107[]) = \"nbad < 1\";", + "static char (__pyx_k108[]) = \"ngood + nbad < nsample\";", + "static char (__pyx_k109[]) = \"nsample < 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_ngood;", + " long __pyx_v_nbad;", + " long __pyx_v_nsample;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};", + " __pyx_v_size = __pyx_k56;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */", + " __pyx_1 = (__pyx_v_ngood < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " Py_INCREF(__pyx_k106p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nbad < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " Py_INCREF(__pyx_k107p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " Py_INCREF(__pyx_k108p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_nsample < 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " Py_INCREF(__pyx_k109p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */", + " __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_k110p;", + "static PyObject *__pyx_k111p;", + "", + "static char (__pyx_k110[]) = \"p < 0\";", + "static char (__pyx_k111[]) = \"p > 1\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " double __pyx_v_p;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_r;", + " int __pyx_1;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " PyObject *__pyx_4 = 0;", + " static char *__pyx_argnames[] = {\"p\",\"size\",0};", + " __pyx_v_size = __pyx_k57;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_size);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */", + " __pyx_1 = (__pyx_v_p < 0);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " Py_INCREF(__pyx_k110p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_1 = (__pyx_v_p > 1);", + " if (__pyx_1) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " Py_INCREF(__pyx_k111p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);", + " __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_4, 0, 0);", + " Py_DECREF(__pyx_4); __pyx_4 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */", + " __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}", + " __pyx_r = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_4);", + " __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_array;", + "static PyObject *__pyx_n_shape;", + "static PyObject *__pyx_n_ArgumentError;", + "static PyObject *__pyx_n_isinstance;", + "static PyObject *__pyx_n_list;", + "static PyObject *__pyx_n_append;", + "static PyObject *__pyx_n_multiply;", + "static PyObject *__pyx_n_reduce;", + "static PyObject *__pyx_n_svd;", + "static PyObject *__pyx_n_matrixmultiply;", + "static PyObject *__pyx_n_sqrt;", + "static PyObject *__pyx_n_add;", + "static PyObject *__pyx_n_tuple;", + "", + "static PyObject *__pyx_k112p;", + "static PyObject *__pyx_k113p;", + "static PyObject *__pyx_k114p;", + "static PyObject *__pyx_k115p;", + "", + "static char (__pyx_k112[]) = \"mean must be 1 dimensional\";", + "static char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";", + "static char (__pyx_k114[]) = \"mean and cov must have same length\";", + "static char (__pyx_k115[]) = \"numpy.linalg\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_mean = 0;", + " PyObject *__pyx_v_cov = 0;", + " PyObject *__pyx_v_size = 0;", + " PyObject *__pyx_v_shape;", + " PyObject *__pyx_v_final_shape;", + " PyObject *__pyx_v_x;", + " PyObject *__pyx_v_svd;", + " PyObject *__pyx_v_u;", + " PyObject *__pyx_v_s;", + " PyObject *__pyx_v_v;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " PyObject *__pyx_5 = 0;", + " static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};", + " __pyx_v_size = __pyx_k58;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_mean);", + " Py_INCREF(__pyx_v_cov);", + " Py_INCREF(__pyx_v_size);", + " __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);", + " __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);", + " __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);", + " __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);", + " __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);", + " __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);", + " __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_mean);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_mean);", + " __pyx_v_mean = __pyx_3;", + " __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_cov);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_cov);", + " __pyx_v_cov = __pyx_2;", + " __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */", + " __pyx_4 = __pyx_v_size == Py_None;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */", + " __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */", + " Py_INCREF(__pyx_v_size);", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_v_size;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);", + " __pyx_2 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " Py_INCREF(__pyx_k112p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_3, 0, 0);", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}", + " goto __pyx_L3;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " __pyx_2 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (!__pyx_4) {", + " __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " }", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " Py_INCREF(__pyx_k113p);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);", + " __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __Pyx_Raise(__pyx_1, 0, 0);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}", + " goto __pyx_L4;", + " }", + " __pyx_L4:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */", + " __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}", + " __pyx_4 = __pyx_4 != 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " Py_INCREF(__pyx_k114p);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);", + " __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __Pyx_Raise(__pyx_2, 0, 0);", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}", + " goto __pyx_L5;", + " }", + " __pyx_L5:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */", + " __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_1;", + " __pyx_1 = 0;", + " goto __pyx_L6;", + " }", + " __pyx_L6:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */", + " __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);", + " __pyx_5 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_final_shape);", + " __pyx_v_final_shape = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */", + " __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);", + " __pyx_3 = 0;", + " __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_x);", + " __pyx_v_x = __pyx_5;", + " __pyx_5 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);", + " PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);", + " __pyx_3 = 0;", + " __pyx_5 = 0;", + " if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */", + " __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_INCREF(__pyx_n_svd);", + " PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);", + " __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_svd);", + " __pyx_v_svd = __pyx_5;", + " __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_cov);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);", + " __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_u);", + " __pyx_v_u = __pyx_3;", + " __pyx_3 = 0;", + " __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_s);", + " __pyx_v_s = __pyx_5;", + " __pyx_5 = 0;", + " __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_v_v);", + " __pyx_v_v = __pyx_1;", + " __pyx_1 = 0;", + " if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_s);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " Py_INCREF(__pyx_v_v);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);", + " __pyx_2 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_x);", + " __pyx_v_x = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_mean);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);", + " __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_final_shape);", + " PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);", + " __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_5); __pyx_5 = 0;", + " if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */", + " Py_INCREF(__pyx_v_x);", + " __pyx_r = __pyx_v_x;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " Py_XDECREF(__pyx_5);", + " __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_shape);", + " Py_DECREF(__pyx_v_final_shape);", + " Py_DECREF(__pyx_v_x);", + " Py_DECREF(__pyx_v_svd);", + " Py_DECREF(__pyx_v_u);", + " Py_DECREF(__pyx_v_s);", + " Py_DECREF(__pyx_v_v);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_mean);", + " Py_DECREF(__pyx_v_cov);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_zeros;", + "", + "static PyObject *__pyx_k117p;", + "", + "static char (__pyx_k117[]) = \"sum(pvals) > 1.0\";", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " long __pyx_v_n;", + " PyObject *__pyx_v_pvals = 0;", + " PyObject *__pyx_v_size = 0;", + " long __pyx_v_d;", + " PyArrayObject *arrayObject_parr;", + " PyArrayObject *arrayObject_mnarr;", + " double (*__pyx_v_pix);", + " long (*__pyx_v_mnix);", + " long __pyx_v_i;", + " long __pyx_v_j;", + " long __pyx_v_dn;", + " double __pyx_v_Sum;", + " PyObject *__pyx_v_shape;", + " PyObject *__pyx_v_multin;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " long __pyx_4;", + " int __pyx_5;", + " static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};", + " __pyx_v_size = __pyx_k59;", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_pvals);", + " Py_INCREF(__pyx_v_size);", + " arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);", + " arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);", + " __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);", + " __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_pvals);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_v_d = __pyx_4;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */", + " __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}", + " Py_INCREF(((PyObject *)__pyx_1));", + " Py_DECREF(((PyObject *)arrayObject_parr));", + " arrayObject_parr = ((PyArrayObject *)__pyx_1);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */", + " __pyx_v_pix = ((double (*))arrayObject_parr->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */", + " __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */", + " __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " Py_INCREF(__pyx_k117p);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __Pyx_Raise(__pyx_1, 0, 0);", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}", + " goto __pyx_L2;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */", + " __pyx_5 = __pyx_v_size == Py_None;", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);", + " __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L3;", + " }", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}", + " __pyx_5 = __pyx_3 == __pyx_1;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */", + " __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);", + " __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " goto __pyx_L3;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */", + " __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_shape);", + " __pyx_v_shape = __pyx_3;", + " __pyx_3 = 0;", + " }", + " __pyx_L3:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);", + " PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);", + " __pyx_1 = 0;", + " __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_v_multin);", + " __pyx_v_multin = __pyx_1;", + " __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */", + " Py_INCREF(((PyObject *)__pyx_v_multin));", + " Py_DECREF(((PyObject *)arrayObject_mnarr));", + " arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */", + " __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */", + " __pyx_v_i = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */", + " while (1) {", + " __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));", + " if (!__pyx_5) break;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */", + " __pyx_v_Sum = 1.0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */", + " __pyx_v_dn = __pyx_v_n;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */", + " __pyx_4 = (__pyx_v_d - 1);", + " for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */", + " (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */", + " __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */", + " __pyx_5 = (__pyx_v_dn <= 0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */", + " goto __pyx_L7;", + " goto __pyx_L8;", + " }", + " __pyx_L8:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */", + " __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));", + " }", + " __pyx_L7:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */", + " __pyx_5 = (__pyx_v_dn > 0);", + " if (__pyx_5) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */", + " (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;", + " goto __pyx_L9;", + " }", + " __pyx_L9:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */", + " __pyx_v_i = (__pyx_v_i + __pyx_v_d);", + " }", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */", + " Py_INCREF(__pyx_v_multin);", + " __pyx_r = __pyx_v_multin;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(arrayObject_parr);", + " Py_DECREF(arrayObject_mnarr);", + " Py_DECREF(__pyx_v_shape);", + " Py_DECREF(__pyx_v_multin);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_pvals);", + " Py_DECREF(__pyx_v_size);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_x = 0;", + " long __pyx_v_i;", + " long __pyx_v_j;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " long __pyx_4;", + " int __pyx_5;", + " static char *__pyx_argnames[] = {\"x\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_x);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_v_i = __pyx_4;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */", + " while (1) {", + " __pyx_5 = (__pyx_v_i > 0);", + " if (!__pyx_5) break;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */", + " __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */", + " __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */", + " __pyx_v_i = (__pyx_v_i - 1);", + " }", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_x);", + " return __pyx_r;", + "}", + "", + "static PyObject *__pyx_n_arange;", + "", + "static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/", + "static char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";", + "static PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {", + " PyObject *__pyx_v_x = 0;", + " PyObject *__pyx_v_arr;", + " PyObject *__pyx_r;", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " PyObject *__pyx_3 = 0;", + " int __pyx_4;", + " static char *__pyx_argnames[] = {\"x\",0};", + " if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;", + " Py_INCREF(__pyx_v_self);", + " Py_INCREF(__pyx_v_x);", + " __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}", + " __pyx_4 = __pyx_3 == __pyx_1;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (__pyx_4) {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */", + " __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);", + " __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_v_arr);", + " __pyx_v_arr = __pyx_2;", + " __pyx_2 = 0;", + " goto __pyx_L2;", + " }", + " /*else*/ {", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */", + " __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_x);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_v_arr);", + " __pyx_v_arr = __pyx_3;", + " __pyx_3 = 0;", + " }", + " __pyx_L2:;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */", + " __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " Py_INCREF(__pyx_v_arr);", + " PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);", + " __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " Py_DECREF(__pyx_3); __pyx_3 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */", + " Py_INCREF(__pyx_v_arr);", + " __pyx_r = __pyx_v_arr;", + " goto __pyx_L0;", + "", + " __pyx_r = Py_None; Py_INCREF(__pyx_r);", + " goto __pyx_L0;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " Py_XDECREF(__pyx_3);", + " __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");", + " __pyx_r = 0;", + " __pyx_L0:;", + " Py_DECREF(__pyx_v_arr);", + " Py_DECREF(__pyx_v_self);", + " Py_DECREF(__pyx_v_x);", + " return __pyx_r;", + "}", + "", + "static __Pyx_InternTabEntry __pyx_intern_tab[] = {", + " {&__pyx_n_ArgumentError, \"ArgumentError\"},", + " {&__pyx_n_Float64, \"Float64\"},", + " {&__pyx_n_Int, \"Int\"},", + " {&__pyx_n_MT19937, \"MT19937\"},", + " {&__pyx_n_ValueError, \"ValueError\"},", + " {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},", + " {&__pyx_n__rand, \"_rand\"},", + " {&__pyx_n__sp, \"_sp\"},", + " {&__pyx_n_add, \"add\"},", + " {&__pyx_n_append, \"append\"},", + " {&__pyx_n_arange, \"arange\"},", + " {&__pyx_n_array, \"array\"},", + " {&__pyx_n_beta, \"beta\"},", + " {&__pyx_n_binomial, \"binomial\"},", + " {&__pyx_n_bytes, \"bytes\"},", + " {&__pyx_n_chisquare, \"chisquare\"},", + " {&__pyx_n_empty, \"empty\"},", + " {&__pyx_n_exponential, \"exponential\"},", + " {&__pyx_n_f, \"f\"},", + " {&__pyx_n_gamma, \"gamma\"},", + " {&__pyx_n_geometric, \"geometric\"},", + " {&__pyx_n_get_state, \"get_state\"},", + " {&__pyx_n_gumbel, \"gumbel\"},", + " {&__pyx_n_hypergeometric, \"hypergeometric\"},", + " {&__pyx_n_int, \"int\"},", + " {&__pyx_n_isinstance, \"isinstance\"},", + " {&__pyx_n_laplace, \"laplace\"},", + " {&__pyx_n_len, \"len\"},", + " {&__pyx_n_list, \"list\"},", + " {&__pyx_n_logistic, \"logistic\"},", + " {&__pyx_n_lognormal, \"lognormal\"},", + " {&__pyx_n_logseries, \"logseries\"},", + " {&__pyx_n_matrixmultiply, \"matrixmultiply\"},", + " {&__pyx_n_multinomial, \"multinomial\"},", + " {&__pyx_n_multiply, \"multiply\"},", + " {&__pyx_n_multivariate_normal, \"multivariate_normal\"},", + " {&__pyx_n_negative_binomial, \"negative_binomial\"},", + " {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},", + " {&__pyx_n_noncentral_f, \"noncentral_f\"},", + " {&__pyx_n_normal, \"normal\"},", + " {&__pyx_n_numpy, \"numpy\"},", + " {&__pyx_n_pareto, \"pareto\"},", + " {&__pyx_n_permutation, \"permutation\"},", + " {&__pyx_n_poisson, \"poisson\"},", + " {&__pyx_n_power, \"power\"},", + " {&__pyx_n_rand, \"rand\"},", + " {&__pyx_n_randint, \"randint\"},", + " {&__pyx_n_randn, \"randn\"},", + " {&__pyx_n_random, \"random\"},", + " {&__pyx_n_random_integers, \"random_integers\"},", + " {&__pyx_n_random_sample, \"random_sample\"},", + " {&__pyx_n_rayleigh, \"rayleigh\"},", + " {&__pyx_n_reduce, \"reduce\"},", + " {&__pyx_n_seed, \"seed\"},", + " {&__pyx_n_set_state, \"set_state\"},", + " {&__pyx_n_shape, \"shape\"},", + " {&__pyx_n_shuffle, \"shuffle\"},", + " {&__pyx_n_size, \"size\"},", + " {&__pyx_n_sqrt, \"sqrt\"},", + " {&__pyx_n_standard_cauchy, \"standard_cauchy\"},", + " {&__pyx_n_standard_exponential, \"standard_exponential\"},", + " {&__pyx_n_standard_gamma, \"standard_gamma\"},", + " {&__pyx_n_standard_normal, \"standard_normal\"},", + " {&__pyx_n_standard_t, \"standard_t\"},", + " {&__pyx_n_svd, \"svd\"},", + " {&__pyx_n_triangular, \"triangular\"},", + " {&__pyx_n_tuple, \"tuple\"},", + " {&__pyx_n_type, \"type\"},", + " {&__pyx_n_uniform, \"uniform\"},", + " {&__pyx_n_vonmises, \"vonmises\"},", + " {&__pyx_n_wald, \"wald\"},", + " {&__pyx_n_weibull, \"weibull\"},", + " {&__pyx_n_zeros, \"zeros\"},", + " {&__pyx_n_zipf, \"zipf\"},", + " {0, 0}", + "};", + "", + "static __Pyx_StringTabEntry __pyx_string_tab[] = {", + " {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},", + " {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},", + " {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},", + " {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},", + " {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},", + " {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},", + " {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},", + " {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},", + " {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},", + " {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},", + " {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},", + " {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},", + " {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},", + " {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},", + " {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},", + " {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},", + " {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},", + " {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},", + " {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},", + " {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},", + " {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},", + " {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},", + " {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},", + " {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},", + " {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},", + " {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},", + " {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},", + " {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},", + " {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},", + " {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},", + " {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},", + " {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},", + " {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},", + " {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},", + " {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},", + " {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},", + " {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},", + " {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},", + " {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},", + " {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},", + " {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},", + " {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},", + " {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},", + " {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},", + " {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},", + " {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},", + " {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},", + " {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},", + " {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},", + " {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},", + " {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},", + " {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},", + " {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},", + " {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},", + " {0, 0, 0}", + "};", + "", + "static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {", + " PyObject *o = (*t->tp_alloc)(t, 0);", + " struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;", + " return o;", + "}", + "", + "static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {", + " {", + " PyObject *etype, *eval, *etb;", + " PyErr_Fetch(&etype, &eval, &etb);", + " ++o->ob_refcnt;", + " __pyx_f_6mtrand_11RandomState___dealloc__(o);", + " if (PyErr_Occurred()) PyErr_WriteUnraisable(o);", + " --o->ob_refcnt;", + " PyErr_Restore(etype, eval, etb);", + " }", + " (*o->ob_type->tp_free)(o);", + "}", + "", + "static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {", + " return 0;", + "}", + "", + "static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {", + " return 0;", + "}", + "", + "static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {", + " {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},", + " {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},", + " {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},", + " {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},", + " {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},", + " {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},", + " {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},", + " {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},", + " {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},", + " {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},", + " {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},", + " {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},", + " {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},", + " {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},", + " {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},", + " {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},", + " {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},", + " {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},", + " {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},", + " {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},", + " {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},", + " {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},", + " {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},", + " {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},", + " {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},", + " {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},", + " {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},", + " {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},", + " {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},", + " {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},", + " {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},", + " {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},", + " {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},", + " {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},", + " {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},", + " {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},", + " {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},", + " {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},", + " {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},", + " {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},", + " {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},", + " {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},", + " {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},", + " {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},", + " {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},", + " {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},", + " {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},", + " {0, 0, 0, 0}", + "};", + "", + "static PyNumberMethods __pyx_tp_as_number_RandomState = {", + " 0, /*nb_add*/", + " 0, /*nb_subtract*/", + " 0, /*nb_multiply*/", + " 0, /*nb_divide*/", + " 0, /*nb_remainder*/", + " 0, /*nb_divmod*/", + " 0, /*nb_power*/", + " 0, /*nb_negative*/", + " 0, /*nb_positive*/", + " 0, /*nb_absolute*/", + " 0, /*nb_nonzero*/", + " 0, /*nb_invert*/", + " 0, /*nb_lshift*/", + " 0, /*nb_rshift*/", + " 0, /*nb_and*/", + " 0, /*nb_xor*/", + " 0, /*nb_or*/", + " 0, /*nb_coerce*/", + " 0, /*nb_int*/", + " 0, /*nb_long*/", + " 0, /*nb_float*/", + " 0, /*nb_oct*/", + " 0, /*nb_hex*/", + " 0, /*nb_inplace_add*/", + " 0, /*nb_inplace_subtract*/", + " 0, /*nb_inplace_multiply*/", + " 0, /*nb_inplace_divide*/", + " 0, /*nb_inplace_remainder*/", + " 0, /*nb_inplace_power*/", + " 0, /*nb_inplace_lshift*/", + " 0, /*nb_inplace_rshift*/", + " 0, /*nb_inplace_and*/", + " 0, /*nb_inplace_xor*/", + " 0, /*nb_inplace_or*/", + " 0, /*nb_floor_divide*/", + " 0, /*nb_true_divide*/", + " 0, /*nb_inplace_floor_divide*/", + " 0, /*nb_inplace_true_divide*/", + "};", + "", + "static PySequenceMethods __pyx_tp_as_sequence_RandomState = {", + " 0, /*sq_length*/", + " 0, /*sq_concat*/", + " 0, /*sq_repeat*/", + " 0, /*sq_item*/", + " 0, /*sq_slice*/", + " 0, /*sq_ass_item*/", + " 0, /*sq_ass_slice*/", + " 0, /*sq_contains*/", + " 0, /*sq_inplace_concat*/", + " 0, /*sq_inplace_repeat*/", + "};", + "", + "static PyMappingMethods __pyx_tp_as_mapping_RandomState = {", + " 0, /*mp_length*/", + " 0, /*mp_subscript*/", + " 0, /*mp_ass_subscript*/", + "};", + "", + "static PyBufferProcs __pyx_tp_as_buffer_RandomState = {", + " 0, /*bf_getreadbuffer*/", + " 0, /*bf_getwritebuffer*/", + " 0, /*bf_getsegcount*/", + " 0, /*bf_getcharbuffer*/", + "};", + "", + "statichere PyTypeObject __pyx_type_6mtrand_RandomState = {", + " PyObject_HEAD_INIT(0)", + " 0, /*ob_size*/", + " \"mtrand.RandomState\", /*tp_name*/", + " sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/", + " 0, /*tp_itemsize*/", + " __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/", + " 0, /*tp_print*/", + " 0, /*tp_getattr*/", + " 0, /*tp_setattr*/", + " 0, /*tp_compare*/", + " 0, /*tp_repr*/", + " &__pyx_tp_as_number_RandomState, /*tp_as_number*/", + " &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/", + " &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/", + " 0, /*tp_hash*/", + " 0, /*tp_call*/", + " 0, /*tp_str*/", + " 0, /*tp_getattro*/", + " 0, /*tp_setattro*/", + " &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/", + " Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/", + " \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/", + " __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/", + " __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/", + " 0, /*tp_richcompare*/", + " 0, /*tp_weaklistoffset*/", + " 0, /*tp_iter*/", + " 0, /*tp_iternext*/", + " __pyx_methods_6mtrand_RandomState, /*tp_methods*/", + " 0, /*tp_members*/", + " 0, /*tp_getset*/", + " 0, /*tp_base*/", + " 0, /*tp_dict*/", + " 0, /*tp_descr_get*/", + " 0, /*tp_descr_set*/", + " 0, /*tp_dictoffset*/", + " __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/", + " 0, /*tp_alloc*/", + " __pyx_tp_new_6mtrand_RandomState, /*tp_new*/", + " 0, /*tp_free*/", + " 0, /*tp_is_gc*/", + " 0, /*tp_bases*/", + " 0, /*tp_mro*/", + " 0, /*tp_cache*/", + " 0, /*tp_subclasses*/", + " 0, /*tp_weaklist*/", + "};", + "", + "static struct PyMethodDef __pyx_methods[] = {", + " {0, 0, 0, 0}", + "};", + "", + "DL_EXPORT(void) initmtrand(void); /*proto*/", + "DL_EXPORT(void) initmtrand(void) {", + " PyObject *__pyx_1 = 0;", + " PyObject *__pyx_2 = 0;", + " __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);", + " if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " __pyx_b = PyImport_AddModule(\"__builtin__\");", + " if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};", + " __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}", + " __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}", + " if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}", + " if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}", + " __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */", + " import_array();", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */", + " __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}", + " if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */", + " Py_INCREF(Py_None);", + " __pyx_k2 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */", + " Py_INCREF(Py_None);", + " __pyx_k3 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */", + " Py_INCREF(Py_None);", + " __pyx_k4 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */", + " Py_INCREF(Py_None);", + " __pyx_k5 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */", + " Py_INCREF(Py_None);", + " __pyx_k6 = Py_None;", + " Py_INCREF(Py_None);", + " __pyx_k7 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */", + " __pyx_k8 = 0.0;", + " __pyx_k9 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k10 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */", + " Py_INCREF(Py_None);", + " __pyx_k11 = Py_None;", + " Py_INCREF(Py_None);", + " __pyx_k12 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */", + " Py_INCREF(Py_None);", + " __pyx_k13 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */", + " __pyx_k14 = 0.0;", + " __pyx_k15 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k16 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */", + " Py_INCREF(Py_None);", + " __pyx_k17 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */", + " __pyx_k18 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k19 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */", + " Py_INCREF(Py_None);", + " __pyx_k20 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */", + " Py_INCREF(Py_None);", + " __pyx_k21 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */", + " __pyx_k22 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k23 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */", + " Py_INCREF(Py_None);", + " __pyx_k24 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */", + " Py_INCREF(Py_None);", + " __pyx_k25 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */", + " Py_INCREF(Py_None);", + " __pyx_k26 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */", + " Py_INCREF(Py_None);", + " __pyx_k27 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */", + " Py_INCREF(Py_None);", + " __pyx_k28 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */", + " Py_INCREF(Py_None);", + " __pyx_k29 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */", + " Py_INCREF(Py_None);", + " __pyx_k30 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */", + " Py_INCREF(Py_None);", + " __pyx_k31 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */", + " Py_INCREF(Py_None);", + " __pyx_k32 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */", + " Py_INCREF(Py_None);", + " __pyx_k33 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */", + " __pyx_k34 = 0.0;", + " __pyx_k35 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k36 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */", + " __pyx_k37 = 0.0;", + " __pyx_k38 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k39 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */", + " __pyx_k40 = 0.0;", + " __pyx_k41 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k42 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */", + " __pyx_k43 = 0.0;", + " __pyx_k44 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k45 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */", + " __pyx_k46 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k47 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */", + " Py_INCREF(Py_None);", + " __pyx_k48 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */", + " Py_INCREF(Py_None);", + " __pyx_k49 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */", + " Py_INCREF(Py_None);", + " __pyx_k50 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */", + " Py_INCREF(Py_None);", + " __pyx_k51 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */", + " __pyx_k52 = 1.0;", + " Py_INCREF(Py_None);", + " __pyx_k53 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */", + " Py_INCREF(Py_None);", + " __pyx_k54 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */", + " Py_INCREF(Py_None);", + " __pyx_k55 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */", + " Py_INCREF(Py_None);", + " __pyx_k56 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */", + " Py_INCREF(Py_None);", + " __pyx_k57 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */", + " Py_INCREF(Py_None);", + " __pyx_k58 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */", + " Py_INCREF(Py_None);", + " __pyx_k59 = Py_None;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */", + " __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + "", + " /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */", + " __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " Py_DECREF(__pyx_1); __pyx_1 = 0;", + " if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}", + " Py_DECREF(__pyx_2); __pyx_2 = 0;", + " return;", + " __pyx_L1:;", + " Py_XDECREF(__pyx_1);", + " Py_XDECREF(__pyx_2);", + " __Pyx_AddTraceback(\"mtrand\");", + "}", + "", + "static char *__pyx_filenames[] = {", + " \"mtrand.pyx\",", + " \"numpy.pxi\",", + "};", + "statichere char **__pyx_f = __pyx_filenames;", + "", + "/* Runtime support code */", + "", + "static int __Pyx_GetStarArgs(", + " PyObject **args,", + " PyObject **kwds,", + " char *kwd_list[],", + " int nargs,", + " PyObject **args2,", + " PyObject **kwds2)", + "{", + " PyObject *x = 0, *args1 = 0, *kwds1 = 0;", + "", + " if (args2)", + " *args2 = 0;", + " if (kwds2)", + " *kwds2 = 0;", + "", + " if (args2) {", + " args1 = PyTuple_GetSlice(*args, 0, nargs);", + " if (!args1)", + " goto bad;", + " *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));", + " if (!*args2)", + " goto bad;", + " }", + " else {", + " args1 = *args;", + " Py_INCREF(args1);", + " }", + "", + " if (kwds2) {", + " if (*kwds) {", + " char **p;", + " kwds1 = PyDict_New();", + " if (!kwds)", + " goto bad;", + " *kwds2 = PyDict_Copy(*kwds);", + " if (!*kwds2)", + " goto bad;", + " for (p = kwd_list; *p; p++) {", + " x = PyDict_GetItemString(*kwds, *p);", + " if (x) {", + " if (PyDict_SetItemString(kwds1, *p, x) < 0)", + " goto bad;", + " if (PyDict_DelItemString(*kwds2, *p) < 0)", + " goto bad;", + " }", + " }", + " }", + " else {", + " *kwds2 = PyDict_New();", + " if (!*kwds2)", + " goto bad;", + " }", + " }", + " else {", + " kwds1 = *kwds;", + " Py_XINCREF(kwds1);", + " }", + "", + " *args = args1;", + " *kwds = kwds1;", + " return 0;", + "bad:", + " Py_XDECREF(args1);", + " Py_XDECREF(kwds1);", + " Py_XDECREF(*args2);", + " Py_XDECREF(*kwds2);", + " return -1;", + "}", + "", + "static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {", + " PyObject *__import__ = 0;", + " PyObject *empty_list = 0;", + " PyObject *module = 0;", + " PyObject *global_dict = 0;", + " PyObject *empty_dict = 0;", + " PyObject *list;", + " __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");", + " if (!__import__)", + " goto bad;", + " if (from_list)", + " list = from_list;", + " else {", + " empty_list = PyList_New(0);", + " if (!empty_list)", + " goto bad;", + " list = empty_list;", + " }", + " global_dict = PyModule_GetDict(__pyx_m);", + " if (!global_dict)", + " goto bad;", + " empty_dict = PyDict_New();", + " if (!empty_dict)", + " goto bad;", + " module = PyObject_CallFunction(__import__, \"OOOO\",", + " name, global_dict, empty_dict, list);", + "bad:", + " Py_XDECREF(empty_list);", + " Py_XDECREF(__import__);", + " Py_XDECREF(empty_dict);", + " return module;", + "}", + "", + "static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {", + " PyObject *result;", + " result = PyObject_GetAttr(dict, name);", + " if (!result)", + " PyErr_SetObject(PyExc_NameError, name);", + " return result;", + "}", + "", + "static void __Pyx_WriteUnraisable(char *name) {", + " PyObject *old_exc, *old_val, *old_tb;", + " PyObject *ctx;", + " PyErr_Fetch(&old_exc, &old_val, &old_tb);", + " ctx = PyString_FromString(name);", + " PyErr_Restore(old_exc, old_val, old_tb);", + " if (!ctx)", + " ctx = Py_None;", + " PyErr_WriteUnraisable(ctx);", + "}", + "", + "static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {", + " Py_XINCREF(type);", + " Py_XINCREF(value);", + " Py_XINCREF(tb);", + " /* First, check the traceback argument, replacing None with NULL. */", + " if (tb == Py_None) {", + " Py_DECREF(tb);", + " tb = 0;", + " }", + " else if (tb != NULL && !PyTraceBack_Check(tb)) {", + " PyErr_SetString(PyExc_TypeError,", + " \"raise: arg 3 must be a traceback or None\");", + " goto raise_error;", + " }", + " /* Next, replace a missing value with None */", + " if (value == NULL) {", + " value = Py_None;", + " Py_INCREF(value);", + " }", + " /* Next, repeatedly, replace a tuple exception with its first item */", + " while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {", + " PyObject *tmp = type;", + " type = PyTuple_GET_ITEM(type, 0);", + " Py_INCREF(type);", + " Py_DECREF(tmp);", + " }", + " if (PyString_Check(type))", + " ;", + " else if (PyClass_Check(type))", + " ; /*PyErr_NormalizeException(&type, &value, &tb);*/", + " else if (PyInstance_Check(type)) {", + " /* Raising an instance. The value should be a dummy. */", + " if (value != Py_None) {", + " PyErr_SetString(PyExc_TypeError,", + " \"instance exception may not have a separate value\");", + " goto raise_error;", + " }", + " else {", + " /* Normalize to raise , */", + " Py_DECREF(value);", + " value = type;", + " type = (PyObject*) ((PyInstanceObject*)type)->in_class;", + " Py_INCREF(type);", + " }", + " }", + " else {", + " /* Not something you can raise. You get an exception", + " anyway, just not what you specified :-) */", + " PyErr_Format(PyExc_TypeError,", + " \"exceptions must be strings, classes, or \"", + " \"instances, not %s\", type->ob_type->tp_name);", + " goto raise_error;", + " }", + " PyErr_Restore(type, value, tb);", + " return;", + "raise_error:", + " Py_XDECREF(value);", + " Py_XDECREF(type);", + " Py_XDECREF(tb);", + " return;", + "}", + "", + "static void __Pyx_UnpackError(void) {", + " PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");", + "}", + "", + "static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {", + " PyObject *item = PySequence_GetItem(seq, i);", + " if (!item) {", + " if (PyErr_ExceptionMatches(PyExc_IndexError))", + " __Pyx_UnpackError();", + " }", + " return item;", + "}", + "", + "static int __Pyx_EndUnpack(PyObject *seq, int i) {", + " PyObject *item = PySequence_GetItem(seq, i);", + " if (item) {", + " Py_DECREF(item);", + " __Pyx_UnpackError();", + " return -1;", + " }", + " PyErr_Clear();", + " return 0;", + "}", + "", + "static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {", + " while (t->p) {", + " *t->p = PyString_InternFromString(t->s);", + " if (!*t->p)", + " return -1;", + " ++t;", + " }", + " return 0;", + "}", + "", + "static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {", + " while (t->p) {", + " *t->p = PyString_FromStringAndSize(t->s, t->n - 1);", + " if (!*t->p)", + " return -1;", + " ++t;", + " }", + " return 0;", + "}", + "", + "static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,", + " long size)", + "{", + " PyObject *py_module_name = 0;", + " PyObject *py_class_name = 0;", + " PyObject *py_name_list = 0;", + " PyObject *py_module = 0;", + " PyObject *result = 0;", + "", + " py_module_name = PyString_FromString(module_name);", + " if (!py_module_name)", + " goto bad;", + " py_class_name = PyString_FromString(class_name);", + " if (!py_class_name)", + " goto bad;", + " py_name_list = PyList_New(1);", + " if (!py_name_list)", + " goto bad;", + " Py_INCREF(py_class_name);", + " if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)", + " goto bad;", + " py_module = __Pyx_Import(py_module_name, py_name_list);", + " if (!py_module)", + " goto bad;", + " result = PyObject_GetAttr(py_module, py_class_name);", + " if (!result)", + " goto bad;", + " if (!PyType_Check(result)) {", + " PyErr_Format(PyExc_TypeError,", + " \"%s.%s is not a type object\",", + " module_name, class_name);", + " goto bad;", + " }", + " if (((PyTypeObject *)result)->tp_basicsize != size) {", + " PyErr_Format(PyExc_ValueError,", + " \"%s.%s does not appear to be the correct type object\",", + " module_name, class_name);", + " goto bad;", + " }", + " goto done;", + "bad:", + " Py_XDECREF(result);", + " result = 0;", + "done:", + " Py_XDECREF(py_module_name);", + " Py_XDECREF(py_class_name);", + " Py_XDECREF(py_name_list);", + " return (PyTypeObject *)result;", + "}", + "", + "#include \"compile.h\"", + "#include \"frameobject.h\"", + "#include \"traceback.h\"", + "", + "static void __Pyx_AddTraceback(char *funcname) {", + " PyObject *py_srcfile = 0;", + " PyObject *py_funcname = 0;", + " PyObject *py_globals = 0;", + " PyObject *empty_tuple = 0;", + " PyObject *empty_string = 0;", + " PyCodeObject *py_code = 0;", + " PyFrameObject *py_frame = 0;", + "", + " py_srcfile = PyString_FromString(__pyx_filename);", + " if (!py_srcfile) goto bad;", + " py_funcname = PyString_FromString(funcname);", + " if (!py_funcname) goto bad;", + " py_globals = PyModule_GetDict(__pyx_m);", + " if (!py_globals) goto bad;", + " empty_tuple = PyTuple_New(0);", + " if (!empty_tuple) goto bad;", + " empty_string = PyString_FromString(\"\");", + " if (!empty_string) goto bad;", + " py_code = PyCode_New(", + " 0, /*int argcount,*/", + " 0, /*int nlocals,*/", + " 0, /*int stacksize,*/", + " 0, /*int flags,*/", + " empty_string, /*PyObject *code,*/", + " empty_tuple, /*PyObject *consts,*/", + " empty_tuple, /*PyObject *names,*/", + " empty_tuple, /*PyObject *varnames,*/", + " empty_tuple, /*PyObject *freevars,*/", + " empty_tuple, /*PyObject *cellvars,*/", + " py_srcfile, /*PyObject *filename,*/", + " py_funcname, /*PyObject *name,*/", + " __pyx_lineno, /*int firstlineno,*/", + " empty_string /*PyObject *lnotab*/", + " );", + " if (!py_code) goto bad;", + " py_frame = PyFrame_New(", + " PyThreadState_Get(), /*PyThreadState *tstate,*/", + " py_code, /*PyCodeObject *code,*/", + " py_globals, /*PyObject *globals,*/", + " 0 /*PyObject *locals*/", + " );", + " if (!py_frame) goto bad;", + " py_frame->f_lineno = __pyx_lineno;", + " PyTraceBack_Here(py_frame);", + "bad:", + " Py_XDECREF(py_srcfile);", + " Py_XDECREF(py_funcname);", + " Py_XDECREF(empty_tuple);", + " Py_XDECREF(empty_string);", + " Py_XDECREF(py_code);", + " Py_XDECREF(py_frame);", + "}" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "f69c9a67449c1dc61ba24e1bc1319e87a89a6388", + "msg": "Changed how to get dual numpy/scipy behavior. Use explicit numpy.dual module.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T07:08:37+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:08:37+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "fb605c6e86e09a4366af88ddf6e843d7adba5876" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 31, + "insertions": 37, + "lines": 68, + "files": 3, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/dft/__init__.py", + "new_path": "numpy/dft/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,18 +4,5 @@\n from fftpack import *\n from helper import *\n \n-# re-define duplicated functions if full numpy installed.\n-try:\n- import scipy.fftpack\n-except ImportError:\n- pass\n-else:\n- fft = scipy.fftpack.fft\n- ifft = scipy.fftpack.ifft\n- fftn = scipy.fftpack.fftn\n- ifftn = scipy.fftpack.ifftn\n- fft2 = scipy.fftpack.fft2\n- ifft2 = scipy.fftpack.ifft2\n-\n from numpy.testing import ScipyTest \n test = ScipyTest().test\n", + "added_lines": 0, + "deleted_lines": 13, + "source_code": "# To get sub-modules\nfrom info import __doc__\n\nfrom fftpack import *\nfrom helper import *\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "source_code_before": "# To get sub-modules\nfrom info import __doc__\n\nfrom fftpack import *\nfrom helper import *\n\n# re-define duplicated functions if full numpy installed.\ntry:\n import scipy.fftpack\nexcept ImportError:\n pass\nelse:\n fft = scipy.fftpack.fft\n ifft = scipy.fftpack.ifft\n fftn = scipy.fftpack.fftn\n ifftn = scipy.fftpack.ifftn\n fft2 = scipy.fftpack.fft2\n ifft2 = scipy.fftpack.ifft2\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 5, + "complexity": 0, + "token_count": 25, + "diff_parsed": { + "added": [], + "deleted": [ + "# re-define duplicated functions if full numpy installed.", + "try:", + " import scipy.fftpack", + "except ImportError:", + " pass", + "else:", + " fft = scipy.fftpack.fft", + " ifft = scipy.fftpack.ifft", + " fftn = scipy.fftpack.fftn", + " ifftn = scipy.fftpack.ifftn", + " fft2 = scipy.fftpack.fft2", + " ifft2 = scipy.fftpack.ifft2", + "" + ] + } + }, + { + "old_path": null, + "new_path": "numpy/dual.py", + "filename": "dual.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,37 @@\n+# This module should be used for functions both in numpy and scipy if\n+# you want to use the numpy version if available but the scipy version\n+# otherwise.\n+# Usage --- import numpy.dual\n+\n+__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n+ 'inv','svd','solve','det','eig','eigvals','lstsq',\n+ 'pinv','cholesky']\n+\n+try:\n+ import scipy.linalg as linpkg\n+except ImportError:\n+ import numpy.linalg as linpkg\n+\n+try:\n+ import scipy.fftpack as fftpkg\n+except ImportError:\n+ import numpy.dft as fftpkg\n+\n+\n+fft = fftpkg.fft\n+ifft = fftpkg.ifft\n+fftn = fftpkg.fftn\n+ifftn = fftpkg.ifftn\n+fft2 = fftpkg.fft2\n+ifft2 = fftpkg.ifft2\n+\n+inv = linpkg.inv\n+svd = linpkg.svd\n+solve = linpkg.solve\n+det = linpkg.det\n+eig = linpkg.eig\n+eigvals = linpkg.eigvals\n+lstsq = linpkg.lstsq\n+pinv = linpkg.pinv\n+cholesky = linpkg.cholesky\n+ \n", + "added_lines": 37, + "deleted_lines": 0, + "source_code": "# This module should be used for functions both in numpy and scipy if\n# you want to use the numpy version if available but the scipy version\n# otherwise.\n# Usage --- import numpy.dual\n\n__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n 'pinv','cholesky']\n\ntry:\n import scipy.linalg as linpkg\nexcept ImportError:\n import numpy.linalg as linpkg\n\ntry:\n import scipy.fftpack as fftpkg\nexcept ImportError:\n import numpy.dft as fftpkg\n\n\nfft = fftpkg.fft\nifft = fftpkg.ifft\nfftn = fftpkg.fftn\nifftn = fftpkg.ifftn\nfft2 = fftpkg.fft2\nifft2 = fftpkg.ifft2\n\ninv = linpkg.inv\nsvd = linpkg.svd\nsolve = linpkg.solve\ndet = linpkg.det\neig = linpkg.eig\neigvals = linpkg.eigvals\nlstsq = linpkg.lstsq\npinv = linpkg.pinv\ncholesky = linpkg.cholesky\n \n", + "source_code_before": null, + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 26, + "complexity": 0, + "token_count": 142, + "diff_parsed": { + "added": [ + "# This module should be used for functions both in numpy and scipy if", + "# you want to use the numpy version if available but the scipy version", + "# otherwise.", + "# Usage --- import numpy.dual", + "", + "__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',", + " 'inv','svd','solve','det','eig','eigvals','lstsq',", + " 'pinv','cholesky']", + "", + "try:", + " import scipy.linalg as linpkg", + "except ImportError:", + " import numpy.linalg as linpkg", + "", + "try:", + " import scipy.fftpack as fftpkg", + "except ImportError:", + " import numpy.dft as fftpkg", + "", + "", + "fft = fftpkg.fft", + "ifft = fftpkg.ifft", + "fftn = fftpkg.fftn", + "ifftn = fftpkg.ifftn", + "fft2 = fftpkg.fft2", + "ifft2 = fftpkg.ifft2", + "", + "inv = linpkg.inv", + "svd = linpkg.svd", + "solve = linpkg.solve", + "det = linpkg.det", + "eig = linpkg.eig", + "eigvals = linpkg.eigvals", + "lstsq = linpkg.lstsq", + "pinv = linpkg.pinv", + "cholesky = linpkg.cholesky", + "" + ], + "deleted": [] + } + }, + { + "old_path": "numpy/linalg/__init__.py", + "new_path": "numpy/linalg/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -3,23 +3,5 @@\n \n from linalg import *\n \n-# re-define duplicated functions if full scipy installed.\n-try:\n- import scipy.linalg\n-except ImportError:\n- pass\n-else:\n- inv = scipy.linalg.inv\n- svd = scipy.linalg.svd\n- solve = scipy.linalg.solve\n- det = scipy.linalg.det\n- eig = scipy.linalg.eig\n- eigvals = scipy.linalg.eigvals\n- lstsq = scipy.linalg.lstsq\n- pinv = scipy.linalg.pinv\n- cholesky = scipy.linalg.cholesky\n- \n-\n-\n from numpy.testing import ScipyTest \n test = ScipyTest().test\n", + "added_lines": 0, + "deleted_lines": 18, + "source_code": "# To get sub-modules\nfrom info import __doc__\n\nfrom linalg import *\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "source_code_before": "# To get sub-modules\nfrom info import __doc__\n\nfrom linalg import *\n\n# re-define duplicated functions if full scipy installed.\ntry:\n import scipy.linalg\nexcept ImportError:\n pass\nelse:\n inv = scipy.linalg.inv\n svd = scipy.linalg.svd\n solve = scipy.linalg.solve\n det = scipy.linalg.det\n eig = scipy.linalg.eig\n eigvals = scipy.linalg.eigvals\n lstsq = scipy.linalg.lstsq\n pinv = scipy.linalg.pinv\n cholesky = scipy.linalg.cholesky\n \n\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 4, + "complexity": 0, + "token_count": 21, + "diff_parsed": { + "added": [], + "deleted": [ + "# re-define duplicated functions if full scipy installed.", + "try:", + " import scipy.linalg", + "except ImportError:", + " pass", + "else:", + " inv = scipy.linalg.inv", + " svd = scipy.linalg.svd", + " solve = scipy.linalg.solve", + " det = scipy.linalg.det", + " eig = scipy.linalg.eig", + " eigvals = scipy.linalg.eigvals", + " lstsq = scipy.linalg.lstsq", + " pinv = scipy.linalg.pinv", + " cholesky = scipy.linalg.cholesky", + "", + "", + "" + ] + } + } + ] + }, + { + "hash": "10d4896f49e6af4be274367077455dd21fee4044", + "msg": "Removed pkg names from dual", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T07:17:48+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:17:48+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "f69c9a67449c1dc61ba24e1bc1319e87a89a6388" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1, + "insertions": 4, + "lines": 5, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/dual.py", + "new_path": "numpy/dual.py", + "filename": "dual.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,7 +1,7 @@\n # This module should be used for functions both in numpy and scipy if\n # you want to use the numpy version if available but the scipy version\n # otherwise.\n-# Usage --- import numpy.dual\n+# Usage --- from numpy.dual import fft, inv\n \n __all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n@@ -34,4 +34,7 @@\n lstsq = linpkg.lstsq\n pinv = linpkg.pinv\n cholesky = linpkg.cholesky\n+\n+del linpkg\n+del fftpkg\n \n", + "added_lines": 4, + "deleted_lines": 1, + "source_code": "# This module should be used for functions both in numpy and scipy if\n# you want to use the numpy version if available but the scipy version\n# otherwise.\n# Usage --- from numpy.dual import fft, inv\n\n__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n 'pinv','cholesky']\n\ntry:\n import scipy.linalg as linpkg\nexcept ImportError:\n import numpy.linalg as linpkg\n\ntry:\n import scipy.fftpack as fftpkg\nexcept ImportError:\n import numpy.dft as fftpkg\n\n\nfft = fftpkg.fft\nifft = fftpkg.ifft\nfftn = fftpkg.fftn\nifftn = fftpkg.ifftn\nfft2 = fftpkg.fft2\nifft2 = fftpkg.ifft2\n\ninv = linpkg.inv\nsvd = linpkg.svd\nsolve = linpkg.solve\ndet = linpkg.det\neig = linpkg.eig\neigvals = linpkg.eigvals\nlstsq = linpkg.lstsq\npinv = linpkg.pinv\ncholesky = linpkg.cholesky\n\ndel linpkg\ndel fftpkg\n \n", + "source_code_before": "# This module should be used for functions both in numpy and scipy if\n# you want to use the numpy version if available but the scipy version\n# otherwise.\n# Usage --- import numpy.dual\n\n__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n 'pinv','cholesky']\n\ntry:\n import scipy.linalg as linpkg\nexcept ImportError:\n import numpy.linalg as linpkg\n\ntry:\n import scipy.fftpack as fftpkg\nexcept ImportError:\n import numpy.dft as fftpkg\n\n\nfft = fftpkg.fft\nifft = fftpkg.ifft\nfftn = fftpkg.fftn\nifftn = fftpkg.ifftn\nfft2 = fftpkg.fft2\nifft2 = fftpkg.ifft2\n\ninv = linpkg.inv\nsvd = linpkg.svd\nsolve = linpkg.solve\ndet = linpkg.det\neig = linpkg.eig\neigvals = linpkg.eigvals\nlstsq = linpkg.lstsq\npinv = linpkg.pinv\ncholesky = linpkg.cholesky\n \n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 28, + "complexity": 0, + "token_count": 146, + "diff_parsed": { + "added": [ + "# Usage --- from numpy.dual import fft, inv", + "", + "del linpkg", + "del fftpkg" + ], + "deleted": [ + "# Usage --- import numpy.dual" + ] + } + } + ] + }, + { + "hash": "c2b11e885235161de4cf34eff4392ef9c746dad3", + "msg": "Removed pkgload from numpy - all imports can be done explicitly.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-05T07:20:03+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:20:03+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "10d4896f49e6af4be274367077455dd21fee4044" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 447, + "insertions": 12, + "lines": 459, + "files": 3, + "dmm_unit_size": 0.7870036101083032, + "dmm_unit_complexity": 0.7256317689530686, + "dmm_unit_interfacing": 0.2924187725631769, + "modified_files": [ + { + "old_path": "numpy/__init__.py", + "new_path": "numpy/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -20,48 +20,26 @@\n NUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n \n try:\n- from __core_config__ import show as show_core_config\n+ from __config__ import show as show_config\n except ImportError:\n- show_core_config = None\n+ show_config = None\n \n try:\n import pkg_resources # activate namespace packages (manipulates __path__)\n except ImportError:\n pass\n \n-import _import_tools\n-pkgload = _import_tools.PackageLoader()\n-\n-if show_core_config is None:\n- print >> sys.stderr, 'Running from numpy core source directory.'\n+if show_config is None:\n+ print >> sys.stderr, 'Running from numpy source directory.'\n else:\n from version import version as __version__\n-\n- pkgload('testing','core','lib','dft','linalg','random',\n- verbose=NUMPY_IMPORT_VERBOSE)\n+ from testing import ScipyTest\n+ from core import *\n+ from lib import *\n+ from dft import fft, ifft\n+ from random import rand, randn\n+ __all__ = filter(lambda s:not s.startswith('_'),dir())\n \n test = ScipyTest('numpy').test\n- __all__.append('test')\n-\n-__numpy_doc__ = \"\"\"\n-\n-NumPy: A scientific computing package for Python\n-================================================\n-\n-Available subpackages\n----------------------\n-\"\"\"\n-\n-if show_core_config is None:\n- show_numpy_config = None\n-else:\n- try:\n- from __numpy_config__ import show as show_numpy_config\n- except ImportError:\n- show_numpy_config = None\n-\n \n-if show_numpy_config is not None:\n- from numpy_version import numpy_version as __numpy_version__\n- __doc__ += __numpy_doc__\n- pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n+ # TODO: Fix __doc__\n", + "added_lines": 11, + "deleted_lines": 32, + "source_code": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __config__ import show as show_config\nexcept ImportError:\n show_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nif show_config is None:\n print >> sys.stderr, 'Running from numpy source directory.'\nelse:\n from version import version as __version__\n from testing import ScipyTest\n from core import *\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n\n test = ScipyTest('numpy').test\n\n # TODO: Fix __doc__\n", + "source_code_before": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __core_config__ import show as show_core_config\nexcept ImportError:\n show_core_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nimport _import_tools\npkgload = _import_tools.PackageLoader()\n\nif show_core_config is None:\n print >> sys.stderr, 'Running from numpy core source directory.'\nelse:\n from version import version as __version__\n\n pkgload('testing','core','lib','dft','linalg','random',\n verbose=NUMPY_IMPORT_VERBOSE)\n\n test = ScipyTest('numpy').test\n __all__.append('test')\n\n__numpy_doc__ = \"\"\"\n\nNumPy: A scientific computing package for Python\n================================================\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nif show_core_config is None:\n show_numpy_config = None\nelse:\n try:\n from __numpy_config__ import show as show_numpy_config\n except ImportError:\n show_numpy_config = None\n\n\nif show_numpy_config is not None:\n from numpy_version import numpy_version as __numpy_version__\n __doc__ += __numpy_doc__\n pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 38, + "complexity": 0, + "token_count": 114, + "diff_parsed": { + "added": [ + " from __config__ import show as show_config", + " show_config = None", + "if show_config is None:", + " print >> sys.stderr, 'Running from numpy source directory.'", + " from testing import ScipyTest", + " from core import *", + " from lib import *", + " from dft import fft, ifft", + " from random import rand, randn", + " __all__ = filter(lambda s:not s.startswith('_'),dir())", + " # TODO: Fix __doc__" + ], + "deleted": [ + " from __core_config__ import show as show_core_config", + " show_core_config = None", + "import _import_tools", + "pkgload = _import_tools.PackageLoader()", + "", + "if show_core_config is None:", + " print >> sys.stderr, 'Running from numpy core source directory.'", + "", + " pkgload('testing','core','lib','dft','linalg','random',", + " verbose=NUMPY_IMPORT_VERBOSE)", + " __all__.append('test')", + "", + "__numpy_doc__ = \"\"\"", + "", + "NumPy: A scientific computing package for Python", + "================================================", + "", + "Available subpackages", + "---------------------", + "\"\"\"", + "", + "if show_core_config is None:", + " show_numpy_config = None", + "else:", + " try:", + " from __numpy_config__ import show as show_numpy_config", + " except ImportError:", + " show_numpy_config = None", + "", + "if show_numpy_config is not None:", + " from numpy_version import numpy_version as __numpy_version__", + " __doc__ += __numpy_doc__", + " pkgload(verbose=NUMPY_IMPORT_VERBOSE,postpone=True)" + ] + } + }, + { + "old_path": "numpy/_import_tools.py", + "new_path": null, + "filename": "_import_tools.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,413 +0,0 @@\n-\n-import os\n-import sys\n-import imp\n-from glob import glob\n-\n-class PackageImport:\n- \"\"\" Import packages from the current directory that implement\n- info.py. See numpy/doc/DISTUTILS.txt for more info.\n- \"\"\"\n-\n- imported_packages = []\n-\n- def __init__(self):\n- self.frame = frame = sys._getframe(1)\n- self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n- self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n-\n- def get_info_modules(self,packages=None):\n- \"\"\"\n- Return info modules of packages or all packages in parent path.\n- \"\"\"\n- if packages is None:\n- info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n- else:\n- info_files = [os.path.join(self.parent_path,package,'info.py') \\\n- for package in packages]\n- info_modules = {}\n- for info_file in info_files:\n- package_name = os.path.basename(os.path.dirname(info_file))\n- fullname = self.parent_name +'.'+ package_name\n- try:\n- info_module = imp.load_module(fullname+'.info',\n- open(info_file,'U'),\n- info_file,\n- ('.py','U',1))\n- except Exception,msg:\n- print >> sys.stderr, msg\n- info_module = None\n-\n- if info_module is None:\n- continue\n- if getattr(info_module,'ignore',False):\n- continue\n-\n- info_modules[fullname] = info_module\n-\n- return info_modules\n-\n- def _sort_info_modules(self, info_modules):\n- \"\"\"\n- Return package names sorted in the order as they should be\n- imported due to dependence relations between packages. \n- \"\"\"\n- depend_dict = {}\n- for fullname,info_module in info_modules.items():\n- depend_dict[fullname] = getattr(info_module,'depends',[])\n- package_names = []\n-\n- for name in depend_dict.keys():\n- if not depend_dict[name]:\n- package_names.append(name)\n- del depend_dict[name]\n-\n- while depend_dict:\n- for name, lst in depend_dict.items():\n- new_lst = [n for n in lst if depend_dict.has_key(n)]\n- if not new_lst:\n- package_names.append(name)\n- del depend_dict[name]\n- else:\n- depend_dict[name] = new_lst\n-\n- return package_names\n-\n- def _get_doc_title(self, info_module):\n- \"\"\" Get the title from a package info.py file.\n- \"\"\"\n- title = getattr(info_module,'__doc_title__',None)\n- if title is not None:\n- return title\n- title = getattr(info_module,'__doc__',None)\n- if title is not None:\n- title = title.lstrip().split('\\n',1)[0]\n- return title\n- return '* Not Available *'\n-\n- def _format_titles(self,titles):\n- lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n- max_length = max(lengths)\n- lines = []\n- for (name,title) in titles:\n- name = name[name.find('.')+1:]\n- w = max_length - len(name)\n- lines.append('%s%s --- %s' % (name, w*' ', title))\n- return '\\n'.join(lines)\n-\n- def import_packages(self, packages=None):\n- \"\"\"\n- Import packages that implement info.py.\n- Return a list of documentation strings info.__doc__ of succesfully\n- imported packages.\n- \"\"\"\n- info_modules = self.get_info_modules(packages)\n- package_names = self._sort_info_modules(info_modules)\n- frame = self.frame\n-\n- titles = []\n-\n- for fullname in package_names:\n- if fullname in self.imported_packages:\n- continue\n- package_name = fullname.split('.')[-1]\n- info_module = info_modules[fullname]\n- global_symbols = getattr(info_module,'global_symbols',[])\n- postpone_import = getattr(info_module,'postpone_import',True)\n- \n- try:\n- #print 'Importing',package_name,'to',self.parent_name\n- exec ('import '+package_name, frame.f_globals,frame.f_locals)\n- except Exception,msg:\n- print >> sys.stderr, 'Failed to import',package_name\n- print >> sys.stderr, msg\n- raise\n- continue\n-\n- self.imported_packages.append(fullname)\n-\n- for symbol in global_symbols:\n- try:\n- exec ('from '+package_name+' import '+symbol,\n- frame.f_globals,frame.f_locals)\n- except Exception,msg:\n- print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n- print >> sys.stderr, msg\n- continue\n-\n- titles.append((fullname,self._get_doc_title(info_module)))\n-\n- try:\n- exec ('\\n%s.test = ScipyTest(%s).test' \\\n- % (package_name,package_name),\n- frame.f_globals,frame.f_locals)\n- except Exception,msg:\n-\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n- print >> sys.stderr, msg\n-\n- return self._format_titles(titles)\n-\n-class PackageLoader:\n- def __init__(self):\n- \"\"\" Manages loading NumPy packages.\n- \"\"\"\n-\n- self.parent_frame = frame = sys._getframe(1)\n- self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n- self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n- if not frame.f_locals.has_key('__all__'):\n- exec('__all__ = []',frame.f_globals,frame.f_locals)\n- self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n-\n- self.info_modules = None\n- self.imported_packages = []\n- self.verbose = None\n-\n- def _get_info_files(self, package_dir, parent_path, parent_package=None):\n- \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n- \"\"\"\n- from glob import glob\n- files = glob(os.path.join(parent_path,package_dir,'info.py'))\n- for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n- if info_file[:-1] not in files:\n- files.append(info_file)\n- info_files = []\n- for info_file in files:\n- package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n- .replace(os.sep,'.')\n- if parent_package:\n- package_name = parent_package + '.' + package_name\n- info_files.append((package_name,info_file))\n- info_files.extend(self._get_info_files('*',\n- os.path.dirname(info_file),\n- package_name))\n- return info_files\n-\n- def _init_info_modules(self, packages=None):\n- \"\"\"Initialize info_modules = {: }.\n- \"\"\"\n- import imp\n- info_files = []\n- if packages is None:\n- for path in self.parent_path:\n- info_files.extend(self._get_info_files('*',path))\n- else:\n- for package_name in packages:\n- package_dir = os.path.join(*package_name.split('.'))\n- for path in self.parent_path:\n- names_files = self._get_info_files(package_dir, path)\n- if names_files:\n- info_files.extend(names_files)\n- break\n- else:\n- self.warn('Package %r does not have info.py file. Ignoring.'\\\n- % package_name)\n-\n- info_modules = self.info_modules\n- for package_name,info_file in info_files:\n- if info_modules.has_key(package_name):\n- continue\n- fullname = self.parent_name +'.'+ package_name\n- if info_file[-1]=='c':\n- filedescriptor = ('.pyc','rb',2)\n- else:\n- filedescriptor = ('.py','U',1)\n-\n- try:\n- info_module = imp.load_module(fullname+'.info',\n- open(info_file,filedescriptor[1]),\n- info_file,\n- filedescriptor)\n- except Exception,msg:\n- self.error(msg)\n- info_module = None\n-\n- if info_module is None or getattr(info_module,'ignore',False):\n- info_modules.pop(package_name,None)\n- else:\n- self._init_info_modules(getattr(info_module,'depends',[]))\n- info_modules[package_name] = info_module\n-\n- return\n-\n- def _get_sorted_names(self):\n- \"\"\" Return package names sorted in the order as they should be\n- imported due to dependence relations between packages. \n- \"\"\"\n-\n- depend_dict = {}\n- for name,info_module in self.info_modules.items():\n- depend_dict[name] = getattr(info_module,'depends',[])\n- package_names = []\n-\n- for name in depend_dict.keys():\n- if not depend_dict[name]:\n- package_names.append(name)\n- del depend_dict[name]\n-\n- while depend_dict:\n- for name, lst in depend_dict.items():\n- new_lst = [n for n in lst if depend_dict.has_key(n)]\n- if not new_lst:\n- package_names.append(name)\n- del depend_dict[name]\n- else:\n- depend_dict[name] = new_lst\n-\n- return package_names\n-\n- def __call__(self,*packages, **options):\n- \"\"\"Load one or more packages into numpy's top-level namespace.\n-\n- Usage:\n-\n- This function is intended to shorten the need to import many of numpy's\n- submodules constantly with statements such as\n-\n- import numpy.linalg, numpy.fft, numpy.etc...\n-\n- Instead, you can say:\n-\n- import numpy\n- numpy.pkgload('linalg','fft',...)\n-\n- or\n-\n- numpy.pkgload()\n-\n- to load all of them in one call.\n-\n- If a name which doesn't exist in numpy's namespace is\n- given, an exception [[WHAT? ImportError, probably?]] is raised.\n- [NotImplemented]\n-\n- Inputs:\n-\n- - the names (one or more strings) of all the numpy modules one wishes to\n- load into the top-level namespace.\n-\n- Optional keyword inputs:\n-\n- - verbose - integer specifying verbosity level [default: 0].\n- - force - when True, force reloading loaded packages [default: False].\n- - postpone - when True, don't load packages [default: False]\n-\n- If no input arguments are given, then all of numpy's subpackages are\n- imported.\n-\n-\n- Outputs:\n-\n- The function returns a tuple with all the names of the modules which\n- were actually imported. [NotImplemented]\n-\n- \"\"\"\n- frame = self.parent_frame\n- self.info_modules = {}\n- if options.get('force',False):\n- self.imported_packages = []\n- self.verbose = verbose = options.get('verbose',False)\n- postpone = options.get('postpone',False)\n-\n- self._init_info_modules(packages or None)\n-\n- self.log('Imports to %r namespace\\n----------------------------'\\\n- % self.parent_name)\n-\n- for package_name in self._get_sorted_names():\n- if package_name in self.imported_packages:\n- continue\n- info_module = self.info_modules[package_name]\n- global_symbols = getattr(info_module,'global_symbols',[]) \n- if postpone and not global_symbols:\n- self.log('__all__.append(%r)' % (package_name))\n- if '.' not in package_name:\n- self.parent_export_names.append(package_name)\n- continue\n- \n- old_object = frame.f_locals.get(package_name,None)\n-\n- cmdstr = 'import '+package_name\n- if self._execcmd(cmdstr):\n- continue\n- self.imported_packages.append(package_name)\n- \n- if verbose!=-1:\n- new_object = frame.f_locals.get(package_name)\n- if old_object is not None and old_object is not new_object:\n- self.warn('Overwriting %s=%s (was %s)' \\\n- % (package_name,self._obj2str(new_object),\n- self._obj2str(old_object)))\n-\n- if '.' not in package_name:\n- self.parent_export_names.append(package_name)\n-\n- for symbol in global_symbols:\n- if symbol=='*':\n- symbols = eval('getattr(%s,\"__all__\",None)'\\\n- % (package_name),\n- frame.f_globals,frame.f_locals)\n- if symbols is None:\n- symbols = eval('dir(%s)' % (package_name),\n- frame.f_globals,frame.f_locals)\n- symbols = filter(lambda s:not s.startswith('_'),symbols)\n- else:\n- symbols = [symbol]\n-\n- if verbose!=-1:\n- old_objects = {}\n- for s in symbols:\n- if frame.f_locals.has_key(s):\n- old_objects[s] = frame.f_locals[s]\n-\n- cmdstr = 'from '+package_name+' import '+symbol\n- if self._execcmd(cmdstr):\n- continue\n-\n- if verbose!=-1:\n- for s,old_object in old_objects.items():\n- new_object = frame.f_locals[s]\n- if new_object is not old_object:\n- self.warn('Overwriting %s=%s (was %s)' \\\n- % (s,self._obj2repr(new_object),\n- self._obj2repr(old_object)))\n-\n- if symbol=='*':\n- self.parent_export_names.extend(symbols)\n- else:\n- self.parent_export_names.append(symbol)\n-\n- return\n-\n- def _execcmd(self,cmdstr):\n- \"\"\" Execute command in parent_frame.\"\"\"\n- frame = self.parent_frame\n- try:\n- exec (cmdstr, frame.f_globals,frame.f_locals)\n- except Exception,msg:\n- self.error('%s -> failed: %s' % (cmdstr,msg))\n- return True\n- else:\n- self.log('%s -> success' % (cmdstr)) \n- return\n-\n- def _obj2repr(self,obj):\n- \"\"\" Return repr(obj) with\"\"\"\n- module = getattr(obj,'__module__',None)\n- file = getattr(obj,'__file__',None)\n- if module is not None:\n- return repr(obj) + ' from ' + module\n- if file is not None:\n- return repr(obj) + ' from ' + file\n- return repr(obj)\n-\n- def log(self,mess):\n- if self.verbose>1:\n- print >> sys.stderr, str(mess)\n- def warn(self,mess):\n- if self.verbose>=0:\n- print >> sys.stderr, str(mess)\n- def error(self,mess):\n- if self.verbose!=-1:\n- print >> sys.stderr, str(mess)\n-\n", + "added_lines": 0, + "deleted_lines": 413, + "source_code": null, + "source_code_before": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\n", + "methods": [], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "", + "import os", + "import sys", + "import imp", + "from glob import glob", + "", + "class PackageImport:", + " \"\"\" Import packages from the current directory that implement", + " info.py. See numpy/doc/DISTUTILS.txt for more info.", + " \"\"\"", + "", + " imported_packages = []", + "", + " def __init__(self):", + " self.frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)", + "", + " def get_info_modules(self,packages=None):", + " \"\"\"", + " Return info modules of packages or all packages in parent path.", + " \"\"\"", + " if packages is None:", + " info_files = glob(os.path.join(self.parent_path,'*','info.py'))", + " else:", + " info_files = [os.path.join(self.parent_path,package,'info.py') \\", + " for package in packages]", + " info_modules = {}", + " for info_file in info_files:", + " package_name = os.path.basename(os.path.dirname(info_file))", + " fullname = self.parent_name +'.'+ package_name", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,'U'),", + " info_file,", + " ('.py','U',1))", + " except Exception,msg:", + " print >> sys.stderr, msg", + " info_module = None", + "", + " if info_module is None:", + " continue", + " if getattr(info_module,'ignore',False):", + " continue", + "", + " info_modules[fullname] = info_module", + "", + " return info_modules", + "", + " def _sort_info_modules(self, info_modules):", + " \"\"\"", + " Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + " depend_dict = {}", + " for fullname,info_module in info_modules.items():", + " depend_dict[fullname] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def _get_doc_title(self, info_module):", + " \"\"\" Get the title from a package info.py file.", + " \"\"\"", + " title = getattr(info_module,'__doc_title__',None)", + " if title is not None:", + " return title", + " title = getattr(info_module,'__doc__',None)", + " if title is not None:", + " title = title.lstrip().split('\\n',1)[0]", + " return title", + " return '* Not Available *'", + "", + " def _format_titles(self,titles):", + " lengths = [len(name)-name.find('.')-1 for (name,title) in titles]", + " max_length = max(lengths)", + " lines = []", + " for (name,title) in titles:", + " name = name[name.find('.')+1:]", + " w = max_length - len(name)", + " lines.append('%s%s --- %s' % (name, w*' ', title))", + " return '\\n'.join(lines)", + "", + " def import_packages(self, packages=None):", + " \"\"\"", + " Import packages that implement info.py.", + " Return a list of documentation strings info.__doc__ of succesfully", + " imported packages.", + " \"\"\"", + " info_modules = self.get_info_modules(packages)", + " package_names = self._sort_info_modules(info_modules)", + " frame = self.frame", + "", + " titles = []", + "", + " for fullname in package_names:", + " if fullname in self.imported_packages:", + " continue", + " package_name = fullname.split('.')[-1]", + " info_module = info_modules[fullname]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " postpone_import = getattr(info_module,'postpone_import',True)", + "", + " try:", + " #print 'Importing',package_name,'to',self.parent_name", + " exec ('import '+package_name, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " print >> sys.stderr, 'Failed to import',package_name", + " print >> sys.stderr, msg", + " raise", + " continue", + "", + " self.imported_packages.append(fullname)", + "", + " for symbol in global_symbols:", + " try:", + " exec ('from '+package_name+' import '+symbol,", + " frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " print >> sys.stderr, 'Failed to import',symbol,'from',package_name", + " print >> sys.stderr, msg", + " continue", + "", + " titles.append((fullname,self._get_doc_title(info_module)))", + "", + " try:", + " exec ('\\n%s.test = ScipyTest(%s).test' \\", + " % (package_name,package_name),", + " frame.f_globals,frame.f_locals)", + " except Exception,msg:", + "\t\tprint >> sys.stderr, 'Failed to set test function for',package_name", + " print >> sys.stderr, msg", + "", + " return self._format_titles(titles)", + "", + "class PackageLoader:", + " def __init__(self):", + " \"\"\" Manages loading NumPy packages.", + " \"\"\"", + "", + " self.parent_frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)", + " if not frame.f_locals.has_key('__all__'):", + " exec('__all__ = []',frame.f_globals,frame.f_locals)", + " self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)", + "", + " self.info_modules = None", + " self.imported_packages = []", + " self.verbose = None", + "", + " def _get_info_files(self, package_dir, parent_path, parent_package=None):", + " \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.", + " \"\"\"", + " from glob import glob", + " files = glob(os.path.join(parent_path,package_dir,'info.py'))", + " for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):", + " if info_file[:-1] not in files:", + " files.append(info_file)", + " info_files = []", + " for info_file in files:", + " package_name = os.path.dirname(info_file[len(parent_path)+1:])\\", + " .replace(os.sep,'.')", + " if parent_package:", + " package_name = parent_package + '.' + package_name", + " info_files.append((package_name,info_file))", + " info_files.extend(self._get_info_files('*',", + " os.path.dirname(info_file),", + " package_name))", + " return info_files", + "", + " def _init_info_modules(self, packages=None):", + " \"\"\"Initialize info_modules = {: }.", + " \"\"\"", + " import imp", + " info_files = []", + " if packages is None:", + " for path in self.parent_path:", + " info_files.extend(self._get_info_files('*',path))", + " else:", + " for package_name in packages:", + " package_dir = os.path.join(*package_name.split('.'))", + " for path in self.parent_path:", + " names_files = self._get_info_files(package_dir, path)", + " if names_files:", + " info_files.extend(names_files)", + " break", + " else:", + " self.warn('Package %r does not have info.py file. Ignoring.'\\", + " % package_name)", + "", + " info_modules = self.info_modules", + " for package_name,info_file in info_files:", + " if info_modules.has_key(package_name):", + " continue", + " fullname = self.parent_name +'.'+ package_name", + " if info_file[-1]=='c':", + " filedescriptor = ('.pyc','rb',2)", + " else:", + " filedescriptor = ('.py','U',1)", + "", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,filedescriptor[1]),", + " info_file,", + " filedescriptor)", + " except Exception,msg:", + " self.error(msg)", + " info_module = None", + "", + " if info_module is None or getattr(info_module,'ignore',False):", + " info_modules.pop(package_name,None)", + " else:", + " self._init_info_modules(getattr(info_module,'depends',[]))", + " info_modules[package_name] = info_module", + "", + " return", + "", + " def _get_sorted_names(self):", + " \"\"\" Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + "", + " depend_dict = {}", + " for name,info_module in self.info_modules.items():", + " depend_dict[name] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def __call__(self,*packages, **options):", + " \"\"\"Load one or more packages into numpy's top-level namespace.", + "", + " Usage:", + "", + " This function is intended to shorten the need to import many of numpy's", + " submodules constantly with statements such as", + "", + " import numpy.linalg, numpy.fft, numpy.etc...", + "", + " Instead, you can say:", + "", + " import numpy", + " numpy.pkgload('linalg','fft',...)", + "", + " or", + "", + " numpy.pkgload()", + "", + " to load all of them in one call.", + "", + " If a name which doesn't exist in numpy's namespace is", + " given, an exception [[WHAT? ImportError, probably?]] is raised.", + " [NotImplemented]", + "", + " Inputs:", + "", + " - the names (one or more strings) of all the numpy modules one wishes to", + " load into the top-level namespace.", + "", + " Optional keyword inputs:", + "", + " - verbose - integer specifying verbosity level [default: 0].", + " - force - when True, force reloading loaded packages [default: False].", + " - postpone - when True, don't load packages [default: False]", + "", + " If no input arguments are given, then all of numpy's subpackages are", + " imported.", + "", + "", + " Outputs:", + "", + " The function returns a tuple with all the names of the modules which", + " were actually imported. [NotImplemented]", + "", + " \"\"\"", + " frame = self.parent_frame", + " self.info_modules = {}", + " if options.get('force',False):", + " self.imported_packages = []", + " self.verbose = verbose = options.get('verbose',False)", + " postpone = options.get('postpone',False)", + "", + " self._init_info_modules(packages or None)", + "", + " self.log('Imports to %r namespace\\n----------------------------'\\", + " % self.parent_name)", + "", + " for package_name in self._get_sorted_names():", + " if package_name in self.imported_packages:", + " continue", + " info_module = self.info_modules[package_name]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " if postpone and not global_symbols:", + " self.log('__all__.append(%r)' % (package_name))", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + " continue", + "", + " old_object = frame.f_locals.get(package_name,None)", + "", + " cmdstr = 'import '+package_name", + " if self._execcmd(cmdstr):", + " continue", + " self.imported_packages.append(package_name)", + "", + " if verbose!=-1:", + " new_object = frame.f_locals.get(package_name)", + " if old_object is not None and old_object is not new_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (package_name,self._obj2str(new_object),", + " self._obj2str(old_object)))", + "", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + "", + " for symbol in global_symbols:", + " if symbol=='*':", + " symbols = eval('getattr(%s,\"__all__\",None)'\\", + " % (package_name),", + " frame.f_globals,frame.f_locals)", + " if symbols is None:", + " symbols = eval('dir(%s)' % (package_name),", + " frame.f_globals,frame.f_locals)", + " symbols = filter(lambda s:not s.startswith('_'),symbols)", + " else:", + " symbols = [symbol]", + "", + " if verbose!=-1:", + " old_objects = {}", + " for s in symbols:", + " if frame.f_locals.has_key(s):", + " old_objects[s] = frame.f_locals[s]", + "", + " cmdstr = 'from '+package_name+' import '+symbol", + " if self._execcmd(cmdstr):", + " continue", + "", + " if verbose!=-1:", + " for s,old_object in old_objects.items():", + " new_object = frame.f_locals[s]", + " if new_object is not old_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (s,self._obj2repr(new_object),", + " self._obj2repr(old_object)))", + "", + " if symbol=='*':", + " self.parent_export_names.extend(symbols)", + " else:", + " self.parent_export_names.append(symbol)", + "", + " return", + "", + " def _execcmd(self,cmdstr):", + " \"\"\" Execute command in parent_frame.\"\"\"", + " frame = self.parent_frame", + " try:", + " exec (cmdstr, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " self.error('%s -> failed: %s' % (cmdstr,msg))", + " return True", + " else:", + " self.log('%s -> success' % (cmdstr))", + " return", + "", + " def _obj2repr(self,obj):", + " \"\"\" Return repr(obj) with\"\"\"", + " module = getattr(obj,'__module__',None)", + " file = getattr(obj,'__file__',None)", + " if module is not None:", + " return repr(obj) + ' from ' + module", + " if file is not None:", + " return repr(obj) + ' from ' + file", + " return repr(obj)", + "", + " def log(self,mess):", + " if self.verbose>1:", + " print >> sys.stderr, str(mess)", + " def warn(self,mess):", + " if self.verbose>=0:", + " print >> sys.stderr, str(mess)", + " def error(self,mess):", + " if self.verbose!=-1:", + " print >> sys.stderr, str(mess)", + "" + ] + } + }, + { + "old_path": "numpy/setup.py", + "new_path": "numpy/setup.py", + "filename": "setup.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -13,7 +13,7 @@ def configuration(parent_package='',top_path=None):\n config.add_subpackage('linalg')\n config.add_subpackage('random')\n config.add_data_dir('doc')\n- config.make_config_py(name='__core_config__') # installs __core_config__.py\n+ config.make_config_py() # installs __config__.py\n \n return config.todict()\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\nimport os\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('numpy',parent_package,top_path)\n config.add_subpackage('distutils')\n config.add_subpackage('testing')\n config.add_subpackage('f2py')\n config.add_subpackage('core')\n config.add_subpackage('lib')\n config.add_subpackage('dft')\n config.add_subpackage('linalg')\n config.add_subpackage('random')\n config.add_data_dir('doc')\n config.make_config_py() # installs __config__.py\n\n return config.todict()\n\nif __name__ == '__main__':\n # Remove current working directory from sys.path\n # to avoid importing numpy.distutils as Python std. distutils:\n import os, sys\n sys.path.remove(os.getcwd())\n\n from numpy.distutils.core import setup\n setup(**configuration(top_path=''))\n", + "source_code_before": "#!/usr/bin/env python\nimport os\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('numpy',parent_package,top_path)\n config.add_subpackage('distutils')\n config.add_subpackage('testing')\n config.add_subpackage('f2py')\n config.add_subpackage('core')\n config.add_subpackage('lib')\n config.add_subpackage('dft')\n config.add_subpackage('linalg')\n config.add_subpackage('random')\n config.add_data_dir('doc')\n config.make_config_py(name='__core_config__') # installs __core_config__.py\n\n return config.todict()\n\nif __name__ == '__main__':\n # Remove current working directory from sys.path\n # to avoid importing numpy.distutils as Python std. distutils:\n import os, sys\n sys.path.remove(os.getcwd())\n\n from numpy.distutils.core import setup\n setup(**configuration(top_path=''))\n", + "methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' , top_path = None )", + "filename": "setup.py", + "nloc": 14, + "complexity": 1, + "token_count": 94, + "parameters": [ + "parent_package", + "top_path" + ], + "start_line": 4, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' , top_path = None )", + "filename": "setup.py", + "nloc": 14, + "complexity": 1, + "token_count": 97, + "parameters": [ + "parent_package", + "top_path" + ], + "start_line": 4, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' , top_path = None )", + "filename": "setup.py", + "nloc": 14, + "complexity": 1, + "token_count": 94, + "parameters": [ + "parent_package", + "top_path" + ], + "start_line": 4, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 20, + "complexity": 1, + "token_count": 136, + "diff_parsed": { + "added": [ + " config.make_config_py() # installs __config__.py" + ], + "deleted": [ + " config.make_config_py(name='__core_config__') # installs __core_config__.py" + ] + } + } + ] + }, + { + "hash": "8081b28a284049bec54db9479de3e1d34380589a", + "msg": "Re-added sasha's 1780 patches", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T07:28:38+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:28:38+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "c2b11e885235161de4cf34eff4392ef9c746dad3" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 47, + "insertions": 56, + "lines": 103, + "files": 2, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": "numpy/core/ma.py", + "new_path": "numpy/core/ma.py", + "filename": "ma.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -300,21 +300,16 @@ def __call__ (self, a, *args, **kwargs):\n d1 = filled(a, self.fill)\n if self.domain is not None:\n m = mask_or(m, self.domain(d1))\n- if m is None:\n- result = self.f(d1, *args, **kwargs)\n- if type(result) is ndarray:\n- return masked_array (result)\n- else:\n- return result\n- else:\n- dx = masked_array(d1, m)\n- result = self.f(filled(dx, self.fill), *args, **kwargs)\n- if type(result) is ndarray:\n- return masked_array(result, m)\n- elif m[...]:\n- return masked\n+ result = self.f(d1, *args, **kwargs)\n+ if m is not None:\n+ try:\n+ shape = result.shape\n+ except AttributeError:\n+ pass\n else:\n- return result\n+ if m.shape != shape:\n+ m = mask_or(getmaskarray(a), getmaskarray(b))\n+ return masked_array(result, m)\n \n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n@@ -352,21 +347,17 @@ def __call__(self, a, b):\n d2 = where(t, self.filly, d2)\n mb = mask_or(mb, t)\n m = mask_or(ma, mb)\n- if m is None:\n- result = self.f(d1, d2)\n- if type(result) is ndarray:\n- return masked_array(result)\n+ result = self.f(d1, d2)\n+ if m is not None:\n+ try:\n+ shape = result.shape\n+ except AttributeError:\n+ pass\n else:\n- return result\n- result = self.f(d1, d2)\n- if type(result) is ndarray:\n- if m.shape != result.shape:\n- m = mask_or(getmaskarray(a), getmaskarray(b))\n- return masked_array(result, m)\n- elif m[...]:\n- return masked\n- else:\n- return result\n+ if m.shape != shape:\n+ m = mask_or(getmaskarray(a), getmaskarray(b))\n+ return masked_array(result, m)\n+ \n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n \n@@ -383,25 +374,18 @@ def __init__ (self, abfunc, fillx=0, filly=0):\n def __call__ (self, a, b, *args, **kwargs):\n \"Execute the call behavior.\"\n m = mask_or(getmask(a), getmask(b))\n- if m is None:\n- d1 = filled(a, self.fillx)\n- d2 = filled(b, self.filly)\n- result = self.f(d1, d2, *args, **kwargs)\n- if type(result) is ndarray:\n- return masked_array(result)\n- else:\n- return result\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n- if type(result) is ndarray:\n- if m.shape != result.shape:\n- m = mask_or(getmaskarray(a), getmaskarray(b))\n- return masked_array(result, m)\n- elif m[...]:\n- return masked\n- else:\n- return result\n+ if m is not None:\n+ try:\n+ shape = result.shape\n+ except AttributeError:\n+ pass\n+ else:\n+ if m.shape != shape:\n+ m = mask_or(getmaskarray(a), getmaskarray(b))\n+ return masked_array(result, m)\n \n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis with this function.\"\"\"\n@@ -833,6 +817,18 @@ def __setslice__(self, i, j, value):\n self._shared_mask = False\n self._mask[i:j] = m\n \n+ def __nonzero__(self):\n+ \"\"\"returns true if any element is non-zero or masked\n+\n+ \"\"\"\n+ # XXX: This changes bool conversion logic from MA.\n+ # XXX: In MA bool(a) == len(a) != 0, but in scipy\n+ # XXX: scalars do not have len \n+ m = self._mask\n+ d = self._data\n+ return bool(m is not None and m.any()\n+ or d is not None and d.any())\n+ \n def __len__ (self):\n \"\"\"Return length of first dimension. This is weird but Python's\n slicing behavior depends on it.\"\"\"\n@@ -1905,7 +1901,7 @@ def __call__ (self, a, b=None):\n else:\n return amin(ac.raw_data())\n else:\n- return where(less(a, b), a, b)[...]\n+ return where(less(a, b), a, b)\n \n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n@@ -1954,7 +1950,7 @@ def __call__ (self, a, b=None):\n else:\n return amax(ac.raw_data())\n else:\n- return where(greater(a, b), a, b)[...]\n+ return where(greater(a, b), a, b)\n \n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n", + "added_lines": 42, + "deleted_lines": 46, + "source_code": "\"\"\"MA: a facility for dealing with missing observations\nMA is generally used as a numpy.array look-alike.\nby Paul F. Dubois.\n\nCopyright 1999, 2000, 2001 Regents of the University of California.\nReleased for unlimited redistribution.\nAdapted for numpy_core 2005 by Travis Oliphant and\n(mainly) Paul Dubois.\n\"\"\"\nimport string, types, sys\n\nimport umath\nimport oldnumeric\nfrom numeric import e, pi, newaxis, ndarray, inf\nfrom oldnumeric import typecodes, amax, amin\nfrom numerictypes import *\nimport numeric\n\n \nMaskType=bool_\ndivide_tolerance = 1.e-35\n\nclass MAError (Exception):\n def __init__ (self, args=None):\n \"Create an exception\"\n self.args = args\n def __str__(self):\n \"Calculate the string representation\"\n return str(self.args)\n __repr__ = __str__\n\nclass _MaskedPrintOption:\n \"One instance of this class, masked_print_option, is created.\"\n def __init__ (self, display):\n \"Create the masked print option object.\"\n self.set_display(display)\n self._enabled = 1\n\n def display (self):\n \"Show what prints for masked values.\"\n return self._display\n\n def set_display (self, s):\n \"set_display(s) sets what prints for masked values.\"\n self._display = s\n\n def enabled (self):\n \"Is the use of the display value enabled?\"\n return self._enabled\n\n def enable(self, flag=1):\n \"Set the enabling flag to flag.\"\n self._enabled = flag\n\n def __str__ (self):\n return str(self._display)\n\n#if you single index into a masked location you get this object.\nmasked_print_option = _MaskedPrintOption('--')\n\n# Use single element arrays or scalars.\ndefault_real_fill_value = 1.e20\ndefault_complex_fill_value = 1.e20 + 0.0j\ndefault_character_fill_value = '-'\ndefault_integer_fill_value = 999999\ndefault_object_fill_value = '?'\n\ndef default_fill_value (obj):\n \"Function to calculate default fill value for an object.\"\n if isinstance(obj, types.FloatType):\n return default_real_fill_value\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return default_integer_fill_value\n elif isinstance(obj, types.StringType):\n return default_character_fill_value\n elif isinstance(obj, types.ComplexType):\n return default_complex_fill_value\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return default_real_fill_value\n if x in typecodes['Integer']:\n return default_integer_fill_value\n if x in typecodes['Complex']:\n return default_complex_fill_value\n if x in typecodes['Character']:\n return default_character_fill_value\n if x in typecodes['UnsignedInteger']:\n return umath.absolute(default_integer_fill_value)\n return default_object_fill_value\n else:\n return default_object_fill_value\n\ndef minimum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking minima.\"\n if isinstance(obj, types.FloatType):\n return numeric.inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return numeric.inf\n if x in typecodes['Integer']:\n return sys.maxint\n if x in typecodes['UnsignedInteger']:\n return sys.maxint\n else:\n raise TypeError, 'Unsuitable type for calculating minimum.'\n\ndef maximum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking maxima.\"\n if isinstance(obj, types.FloatType):\n return -inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return -sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return -inf\n if x in typecodes['Integer']:\n return -sys.maxint\n if x in typecodes['UnsignedInteger']:\n return 0\n else:\n raise TypeError, 'Unsuitable type for calculating maximum.'\n\ndef set_fill_value (a, fill_value):\n \"Set fill value of a if it is a masked array.\"\n if isMaskedArray(a):\n a.set_fill_value (fill_value)\n\ndef getmask (a):\n \"\"\"Mask of values in a; could be None.\n Returns None if a is not a masked array.\n To get an array for sure use getmaskarray.\"\"\"\n if isinstance(a, MaskedArray):\n return a.raw_mask()\n else:\n return None\n\ndef getmaskarray (a):\n \"\"\"Mask of values in a; an array of zeros if mask is None\n or not a masked array, and is a byte-sized integer.\n Do not try to add up entries, for example.\n \"\"\"\n m = getmask(a)\n if m is None:\n return make_mask_none(shape(a))\n else:\n return m\n\ndef is_mask (m):\n \"\"\"Is m a legal mask? Does not check contents, only type.\n \"\"\"\n if m is None or (isinstance(m, ndarray) and \\\n m.dtype is MaskType):\n return 1\n else:\n return 0\n\ndef make_mask (m, copy=0, flag=0):\n \"\"\"make_mask(m, copy=0, flag=0)\n return m as a mask, creating a copy if necessary or requested.\n Can accept any sequence of integers or None. Does not check\n that contents must be 0s and 1s.\n if flag, return None if m contains no true elements.\n \"\"\"\n if m is None:\n return None\n elif isinstance(m, ndarray):\n if m.dtype is MaskType:\n if copy:\n result = numeric.array(m, dtype=MaskType, copy=copy)\n else:\n result = m\n else:\n result = m.astype(MaskType)\n else:\n result = filled(m,True).astype(MaskType)\n\n if flag and not oldnumeric.sometrue(oldnumeric.ravel(result)):\n return None\n else:\n return result\n\ndef make_mask_none (s):\n \"Return a mask of all zeros of shape s.\"\n result = numeric.zeros(s, dtype=MaskType)\n result.shape = s\n return result\n\ndef mask_or (m1, m2):\n \"\"\"Logical or of the mask candidates m1 and m2, treating None as false.\n Result may equal m1 or m2 if the other is None.\n \"\"\"\n if m1 is None: return make_mask(m2)\n if m2 is None: return make_mask(m1)\n if m1 is m2 and is_mask(m1): return m1\n return make_mask(umath.logical_or(m1, m2))\n\ndef filled (a, value = None):\n \"\"\"a as a contiguous numeric array with any masked areas replaced by value\n if value is None or the special element \"masked\", get_fill_value(a)\n is used instead.\n\n If a is already a contiguous numeric array, a itself is returned.\n\n filled(a) can be used to be sure that the result is numeric when\n passing an object a to other software ignorant of MA, in particular to\n numeric itself.\n \"\"\"\n if isinstance(a, MaskedArray):\n return a.filled(value)\n elif isinstance(a, ndarray) and a.flags['CONTIGUOUS']:\n return a\n elif isinstance(a, types.DictType):\n return numeric.array(a, 'O')\n else:\n return numeric.array(a)\n\ndef get_fill_value (a):\n \"\"\"\n The fill value of a, if it has one; otherwise, the default fill value\n for that type.\n \"\"\"\n if isMaskedArray(a):\n result = a.fill_value()\n else:\n result = default_fill_value(a)\n return result\n\ndef common_fill_value (a, b):\n \"The common fill_value of a and b, if there is one, or None\"\n t1 = get_fill_value(a)\n t2 = get_fill_value(b)\n if t1 == t2: return t1\n return None\n\n# Domain functions return 1 where the argument(s) are not in the domain.\nclass domain_check_interval:\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n def __init__(self, y1, y2):\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n self.y1 = y1\n self.y2 = y2\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.logical_or(umath.greater (x, self.y2),\n umath.less(x, self.y1)\n )\n\nclass domain_tan:\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n def __init__(self, eps):\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n self.eps = eps\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less(umath.absolute(umath.cos(x)), self.eps)\n\nclass domain_greater:\n \"domain_greater(v)(x) = true where x <= v\"\n def __init__(self, critical_value):\n \"domain_greater(v)(x) = true where x <= v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less_equal (x, self.critical_value)\n\nclass domain_greater_equal:\n \"domain_greater_equal(v)(x) = true where x < v\"\n def __init__(self, critical_value):\n \"domain_greater_equal(v)(x) = true where x < v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less (x, self.critical_value)\n\nclass masked_unary_operation:\n def __init__ (self, aufunc, fill=0, domain=None):\n \"\"\" masked_unary_operation(aufunc, fill=0, domain=None)\n aufunc(fill) must be defined\n self(x) returns aufunc(x)\n with masked values where domain(x) is true or getmask(x) is true.\n \"\"\"\n self.f = aufunc\n self.fill = fill\n self.domain = domain\n self.__doc__ = getattr(aufunc, \"__doc__\", str(aufunc))\n\n def __call__ (self, a, *args, **kwargs):\n \"Execute the call behavior.\"\n# numeric tries to return scalars rather than arrays when given scalars.\n m = getmask(a)\n d1 = filled(a, self.fill)\n if self.domain is not None:\n m = mask_or(m, self.domain(d1))\n result = self.f(d1, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\n\nclass domain_safe_divide:\n def __init__ (self, tolerance=divide_tolerance):\n self.tolerance = tolerance\n def __call__ (self, a, b):\n return umath.absolute(a) * self.tolerance >= umath.absolute(b)\n\nclass domained_binary_operation:\n \"\"\"Binary operations that have a domain, like divide. These are complicated so they\n are a separate class. They have no reduce, outer or accumulate.\n \"\"\"\n def __init__ (self, abfunc, domain, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.domain = domain\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__(self, a, b):\n \"Execute the call behavior.\"\n ma = getmask(a)\n mb = getmask(b)\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n t = self.domain(d1, d2)\n\n if oldnumeric.sometrue(t, None):\n d2 = where(t, self.filly, d2)\n mb = mask_or(mb, t)\n m = mask_or(ma, mb)\n result = self.f(d1, d2)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n \n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nclass masked_binary_operation:\n def __init__ (self, abfunc, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__ (self, a, b, *args, **kwargs):\n \"Execute the call behavior.\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis with this function.\"\"\"\n m = getmask(target)\n t = filled(target, self.filly)\n if t.shape == ():\n t = t.reshape(1)\n if m is not None:\n m = make_mask(m, copy=1)\n m.shape = (1,)\n if m is None:\n return masked_array (self.f.reduce (t, axis))\n else:\n t = masked_array (t, m)\n t = self.f.reduce(filled(t, self.filly), axis)\n m = umath.logical_and.reduce(m, axis)\n if isinstance(t, ndarray):\n return masked_array(t, m, get_fill_value(target))\n elif m:\n return masked\n else:\n return t\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = self.f.outer(filled(a, self.fillx), filled(b, self.filly))\n return masked_array(d, m)\n\n def accumulate (self, target, axis=0):\n \"\"\"Accumulate target along axis after filling with y fill value.\"\"\"\n t = filled(target, self.filly)\n return masked_array (self.f.accumulate (t, axis))\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nsqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0))\nlog = masked_unary_operation(umath.log, 1.0, domain_greater(0.0))\nlog10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0))\nexp = masked_unary_operation(umath.exp)\nconjugate = masked_unary_operation(umath.conjugate)\nsin = masked_unary_operation(umath.sin)\ncos = masked_unary_operation(umath.cos)\ntan = masked_unary_operation(umath.tan, 0.0, domain_tan(1.e-35))\narcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-1.0, 1.0))\narccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-1.0, 1.0))\narctan = masked_unary_operation(umath.arctan)\n# Missing from numeric\narcsinh = masked_unary_operation(umath.arcsinh)\narccosh = masked_unary_operation(umath.arccosh)\narctanh = masked_unary_operation(umath.arctanh)\nsinh = masked_unary_operation(umath.sinh)\ncosh = masked_unary_operation(umath.cosh)\ntanh = masked_unary_operation(umath.tanh)\nabsolute = masked_unary_operation(umath.absolute)\nfabs = masked_unary_operation(umath.fabs)\nnegative = masked_unary_operation(umath.negative)\nnonzero = masked_unary_operation(oldnumeric.nonzero)\naround = masked_unary_operation(oldnumeric.round_)\nfloor = masked_unary_operation(umath.floor)\nceil = masked_unary_operation(umath.ceil)\nsometrue = masked_unary_operation(oldnumeric.sometrue)\nalltrue = masked_unary_operation(oldnumeric.alltrue, 1)\nlogical_not = masked_unary_operation(umath.logical_not)\n\nadd = masked_binary_operation(umath.add)\nsubtract = masked_binary_operation(umath.subtract)\nsubtract.reduce = None\nmultiply = masked_binary_operation(umath.multiply, 1, 1)\ndivide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1)\ntrue_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1)\nfloor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1)\nremainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1)\nfmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1)\nhypot = masked_binary_operation(umath.hypot)\narctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0)\narctan2.reduce = None\nequal = masked_binary_operation(umath.equal)\nequal.reduce = None\nnot_equal = masked_binary_operation(umath.not_equal)\nnot_equal.reduce = None\nless_equal = masked_binary_operation(umath.less_equal)\nless_equal.reduce = None\ngreater_equal = masked_binary_operation(umath.greater_equal)\ngreater_equal.reduce = None\nless = masked_binary_operation(umath.less)\nless.reduce = None\ngreater = masked_binary_operation(umath.greater)\ngreater.reduce = None\nlogical_and = masked_binary_operation(umath.logical_and)\nlogical_or = masked_binary_operation(umath.logical_or)\nlogical_xor = masked_binary_operation(umath.logical_xor)\nbitwise_and = masked_binary_operation(umath.bitwise_and)\nbitwise_or = masked_binary_operation(umath.bitwise_or)\nbitwise_xor = masked_binary_operation(umath.bitwise_xor)\n\ndef rank (object):\n return oldnumeric.rank(filled(object))\n\ndef shape (object):\n return oldnumeric.shape(filled(object))\n\ndef size (object, axis=None):\n return oldnumeric.size(filled(object), axis)\n\nclass MaskedArray (object):\n \"\"\"Arrays with possibly masked values.\n Masked values of 1 exclude the corresponding element from \n any computation.\n\n Construction:\n x = array(data, dtype=None, copy=True, fortran=False,\n mask = None, fill_value=None)\n\n If copy=False, every effort is made not to copy the data:\n If data is a MaskedArray, and argument mask=None,\n then the candidate data is data.data and the\n mask used is data.mask. If data is a numeric array,\n it is used as the candidate raw data.\n If dtypechar is not None and\n is != data.dtypechar then a data copy is required.\n Otherwise, the candidate is used.\n\n If a data copy is required, raw data stored is the result of:\n numeric.array(data, dtype=dtypechar, copy=copy)\n\n If mask is None there are no masked values. Otherwise mask must\n be convertible to an array of booleans with the same shape as x.\n\n fill_value is used to fill in masked values when necessary,\n such as when printing and in method/function filled().\n The fill_value is not used for computation within this module.\n \"\"\"\n def __init__(self, data, dtype=None, copy=True, fortran=False, \n mask=None, fill_value=None):\n \"\"\"array(data, dtype=None, copy=True, fortran=False, mask=None, fill_value=None)\n If data already a numeric array, its dtype becomes the default value of dtype.\n \"\"\"\n tc = dtype\n need_data_copied = copy\n if isinstance(data, MaskedArray):\n c = data.data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n if mask is None:\n mask = data.mask\n elif mask is not None: #attempting to change the mask\n need_data_copied = True\n\n elif isinstance(data, ndarray):\n c = data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n else:\n need_data_copied = False #because I'll do it now\n c = numeric.array(data, dtype=tc, copy=True, fortran=fortran)\n\n if need_data_copied:\n if tc == ctc:\n self._data = numeric.array(c, dtype=tc, copy=True, fortran=fortran)\n else:\n self._data = c.astype(tc)\n else:\n self._data = c\n\n if mask is None:\n self._mask = None\n self._shared_mask = 0\n else:\n self._mask = make_mask (mask)\n if self._mask is None:\n self._shared_mask = 0\n else:\n self._shared_mask = (self._mask is mask)\n nm = size(self._mask)\n nd = size(self._data)\n if nm != nd:\n if nm == 1:\n self._mask = oldnumeric.resize(self._mask, self._data.shape)\n self._shared_mask = 0\n elif nd == 1:\n self._data = oldnumeric.resize(self._data, self._mask.shape)\n self._data.shape = self._mask.shape\n else:\n raise MAError, \"Mask and data not compatible.\"\n elif nm == 1 and shape(self._mask) != shape(self._data):\n self.unshare_mask()\n self._mask.shape = self._data.shape\n\n self.set_fill_value(fill_value)\n\n def __array__ (self, t = None):\n \"Special hook for numeric. Converts to numeric if possible.\"\n if self._mask is not None:\n if oldnumeric.ravel(self._mask).any():\n raise MAError, \\\n \"\"\"Cannot automatically convert masked array to numeric because data\n is masked in one or more locations.\n \"\"\"\n else: # Mask is all false\n # Optimize to avoid future invocations of this section.\n self._mask = None\n self._shared_mask = 0\n if t:\n return self._data.astype(t)\n else:\n return self._data\n\n def _get_shape(self):\n \"Return the current shape.\"\n return self._data.shape\n\n def _set_shape (self, newshape):\n \"Set the array's shape.\"\n self._data.shape = newshape\n if self._mask is not None:\n self._mask = self._mask.copy()\n self._mask.shape = newshape\n\n def _get_flat(self):\n \"\"\"Calculate the flat value.\n \"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel(), mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.ravel(),\n mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_flat (self, value):\n \"x.flat = value\"\n y = self.ravel()\n y[:] = value\n\n def _get_real(self):\n \"Get the real part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.real, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.real, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_real (self, value):\n \"x.real = value\"\n y = self.real\n y[...] = value\n\n def _get_imaginary(self):\n \"Get the imaginary part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.imag, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.imag, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_imaginary (self, value):\n \"x.imaginary = value\"\n y = self.imaginary\n y[...] = value\n\n def __str__(self):\n \"\"\"Calculate the str representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n if masked_print_option.enabled():\n f = masked_print_option\n else:\n f = self.fill_value()\n res = self.filled(f)\n return str(res)\n\n def __repr__(self):\n \"\"\"Calculate the repr representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n with_mask = \"\"\"\\\narray(data =\n %(data)s,\n mask =\n %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n with_mask1 = \"\"\"\\\narray(data = %(data)s,\n mask = %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n without_mask = \"\"\"array(\n %(data)s)\"\"\"\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n\n n = len(self.shape)\n if self._mask is None:\n if n <=1:\n return without_mask1 % {'data':str(self.filled())}\n return without_mask % {'data':str(self.filled())}\n else:\n if n <=1:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n if self._mask is None:\n return without_mask % {'data':str(self.filled())}\n else:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n\n def __float__(self):\n \"Convert self to float.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python float.'\n return float(self.data.item())\n\n def __int__(self):\n \"Convert self to int.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python int.'\n return int(self.data.item())\n\n def __getitem__(self, i):\n \"Get item described by i. Not a copy as in previous versions.\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i]\n if m is None:\n return dout\n mi = m[i]\n if mi.size == 1:\n if mi: \n return masked\n else:\n return dout\n else:\n return masked_array(dout, mi, fill_value=self._fill_value)\n\n def __getslice__(self, i, j):\n \"Get slice described by i, j\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i:j]\n if m is None:\n return masked_array(dout, fill_value=self._fill_value)\n else:\n return masked_array(dout, mask = m[i:j], fill_value=self._fill_value)\n\n# --------\n# setitem and setslice notes\n# note that if value is masked, it means to mask those locations.\n# setting a value changes the mask to match the value in those locations.\n\n def __setitem__(self, index, value):\n \"Set item described by index. If value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, 'Cannot alter the masked element.'\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n else:\n self.unshare_mask()\n self._mask[index] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[index] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[index] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = True\n else:\n self.unshare_mask()\n self._mask[index] = m\n\n def __setslice__(self, i, j, value):\n \"Set slice i:j; if value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, \"Cannot alter the 'masked' object.\"\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n self._mask[i:j] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[i:j] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[i:j] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(self._data.shape)\n self._shared_mask = False\n self._mask[i:j] = m\n\n def __nonzero__(self):\n \"\"\"returns true if any element is non-zero or masked\n\n \"\"\"\n # XXX: This changes bool conversion logic from MA.\n # XXX: In MA bool(a) == len(a) != 0, but in scipy\n # XXX: scalars do not have len \n m = self._mask\n d = self._data\n return bool(m is not None and m.any()\n or d is not None and d.any())\n \n def __len__ (self):\n \"\"\"Return length of first dimension. This is weird but Python's\n slicing behavior depends on it.\"\"\"\n return len(self._data)\n\n def __and__(self, other):\n \"Return bitwise_and\"\n return bitwise_and(self, other)\n\n def __or__(self, other):\n \"Return bitwise_or\"\n return bitwise_or(self, other)\n\n def __xor__(self, other):\n \"Return bitwise_xor\"\n return bitwise_xor(self, other)\n\n __rand__ = __and__\n __ror__ = __or__\n __rxor__ = __xor__\n\n def __abs__(self):\n \"Return absolute(self)\"\n return absolute(self)\n\n def __neg__(self):\n \"Return negative(self)\"\n return negative(self)\n\n def __pos__(self):\n \"Return array(self)\"\n return array(self)\n\n def __add__(self, other):\n \"Return add(self, other)\"\n return add(self, other)\n\n __radd__ = __add__\n\n def __mod__ (self, other):\n \"Return remainder(self, other)\"\n return remainder(self, other)\n\n def __rmod__ (self, other):\n \"Return remainder(other, self)\"\n return remainder(other, self)\n\n def __lshift__ (self, n):\n return left_shift(self, n)\n\n def __rshift__ (self, n):\n return right_shift(self, n)\n\n def __sub__(self, other):\n \"Return subtract(self, other)\"\n return subtract(self, other)\n\n def __rsub__(self, other):\n \"Return subtract(other, self)\"\n return subtract(other, self)\n\n def __mul__(self, other):\n \"Return multiply(self, other)\"\n return multiply(self, other)\n\n __rmul__ = __mul__\n\n def __div__(self, other):\n \"Return divide(self, other)\"\n return divide(self, other)\n\n def __rdiv__(self, other):\n \"Return divide(other, self)\"\n return divide(other, self)\n\n def __truediv__(self, other):\n \"Return divide(self, other)\"\n return true_divide(self, other)\n\n def __rtruediv__(self, other):\n \"Return divide(other, self)\"\n return true_divide(other, self)\n\n def __floordiv__(self, other):\n \"Return divide(self, other)\"\n return floor_divide(self, other)\n\n def __rfloordiv__(self, other):\n \"Return divide(other, self)\"\n return floor_divide(other, self)\n\n def __pow__(self,other, third=None):\n \"Return power(self, other, third)\"\n return power(self, other, third)\n\n def __sqrt__(self):\n \"Return sqrt(self)\"\n return sqrt(self)\n\n def __iadd__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data += f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = add(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __imul__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data *= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = multiply(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __isub__(self, other):\n \"Subtract other from self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data -= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = subtract(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n\n\n def __idiv__(self, other):\n \"Divide self by other in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n mo = getmask(other)\n result = divide(self, masked_array(f, mask=mo))\n self._data = result.data\n dm = result.raw_mask()\n if dm is not self._mask:\n self._mask = dm\n self._shared_mask = 1\n return self\n\n def __eq__(self,other):\n return equal(self,other)\n\n def __ne__(self,other):\n return not_equal(self,other)\n\n def __lt__(self,other):\n return less(self,other)\n\n def __le__(self,other):\n return less_equal(self,other)\n\n def __gt__(self,other):\n return greater(self,other)\n\n def __ge__(self,other):\n return greater_equal(self,other)\n\n def astype (self, tc):\n \"return self as array of given type.\"\n d = self._data.astype(tc)\n return array(d, mask=self._mask)\n\n def byte_swapped(self):\n \"\"\"Returns the raw data field, byte_swapped. Included for consistency\n with numeric but doesn't make sense in this context.\n \"\"\"\n return self._data.byte_swapped()\n\n def compressed (self):\n \"A 1-D array of all the non-masked data.\"\n d = oldnumeric.ravel(self._data)\n if self._mask is None:\n return array(d)\n else:\n m = 1 - oldnumeric.ravel(self._mask)\n c = oldnumeric.compress(m, d)\n return array(c, copy=0)\n\n def count (self, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n m = self._mask\n s = self._data.shape\n ls = len(s)\n if m is None:\n if ls == 0:\n return 1\n if ls == 1:\n return s[0]\n if axis is None:\n return reduce(lambda x,y:x*y, s)\n else:\n n = s[axis]\n t = list(s)\n del t[axis]\n return ones(t) * n\n if axis is None:\n w = oldnumeric.ravel(m).astype(int) \n n1 = size(w)\n if n1 == 1:\n n2 = w[0]\n else:\n n2 = umath.add.reduce(w)\n return n1 - n2\n else:\n n1 = size(m, axis)\n n2 = sum(m.astype(int), axis)\n return n1 - n2\n\n def dot (self, other):\n \"s.dot(other) = innerproduct(s, other)\"\n return innerproduct(self, other)\n\n def fill_value(self):\n \"Get the current fill value.\"\n return self._fill_value\n\n def filled (self, fill_value=None):\n \"\"\"A numeric array with masked values filled. If fill_value is None,\n use self.fill_value().\n\n If mask is None, copy data only if not contiguous.\n Result is always a contiguous, numeric array.\n# Is contiguous really necessary now?\n \"\"\"\n d = self._data\n m = self._mask\n if m is None:\n if d.flags['CONTIGUOUS']:\n return d\n else:\n return d.copy()\n else:\n if fill_value is None:\n value = self._fill_value\n else:\n value = fill_value\n\n if self is masked:\n result = numeric.array(value).reshape(*d.shape)\n else:\n try:\n result = numeric.array(d, dtype=d.dtype, copy=1)\n result[m] = value\n except:\n #ok, can't put that value in here\n value = numeric.array(value, dtype=object)\n d = d.astype(object)\n result = oldnumeric.choose(m, (d, value))\n return result\n\n def ids (self):\n \"\"\"Return the ids of the data and mask areas\"\"\"\n return (id(self._data), id(self._mask))\n\n def iscontiguous (self):\n \"Is the data contiguous?\"\n return self._data.flags['CONTIGUOUS']\n\n def itemsize(self):\n \"Item size of each data item.\"\n return self._data.itemsize\n\n\n def outer(self, other):\n \"s.outer(other) = outerproduct(s, other)\"\n return outerproduct(self, other)\n\n def put (self, values):\n \"\"\"Set the non-masked entries of self to filled(values).\n No change to mask\n \"\"\"\n iota = numeric.arange(self.size)\n d = self._data\n if self._mask is None:\n ind = iota\n else:\n ind = oldnumeric.compress(1 - self._mask, iota)\n d[ind] = filled(values).astype(d.dtype)\n\n def putmask (self, values):\n \"\"\"Set the masked entries of self to filled(values).\n Mask changed to None.\n \"\"\"\n d = self._data\n if self._mask is not None:\n d[self._mask] = filled(values).astype(d.dtype)\n self._shared_mask = 0\n self._mask = None\n\n def ravel (self):\n \"\"\"Return a 1-D view of self.\"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel())\n else:\n return masked_array(self._data.ravel(), self._mask.ravel())\n\n def raw_data (self):\n \"\"\" Obsolete; use data property instead.\n The raw data; portions may be meaningless.\n May be noncontiguous. Expert use only.\"\"\"\n return self._data\n data = property(fget=raw_data, \n doc=\"The data, but values at masked locations are meaningless.\")\n\n def raw_mask (self):\n \"\"\" Obsolete; use mask property instead.\n May be noncontiguous. Expert use only.\n \"\"\"\n return self._mask\n mask = property(fget=raw_mask, \n doc=\"The mask, may be None. Values where mask true are meaningless.\")\n\n def reshape (self, *s):\n \"\"\"This array reshaped to shape s\"\"\"\n d = self._data.reshape(*s)\n if self._mask is None:\n return masked_array(d)\n else:\n m = self._mask.reshape(*s)\n return masked_array(d, m)\n\n def set_fill_value (self, v=None):\n \"Set the fill value to v. Omit v to restore default.\"\n if v is None:\n v = default_fill_value (self.raw_data())\n self._fill_value = v\n\n def _get_size (self):\n return self._data.size\n size = property(fget=_get_size, doc=\"Number of elements in the array.\")\n## CHECK THIS: signature of numeric.array.size?\n \n def _get_dtypechar(self):\n return self._data.dtypechar\n dtypechar = property(fget=_get_dtypechar, doc=\"type character of the array.\")\n\n def _get_dtype(self):\n return self._data.dtype\n dtype = property(fget=_get_dtype, doc=\"type of the array elements.\")\n\n def item(self):\n \"Return Python scalar if possible.\"\n if self._mask is not None:\n m = oldnumeric.ravel(self._mask)\n try:\n if m[0]:\n return masked\n except IndexError:\n return masked\n return self._data.item()\n\n def tolist(self, fill_value=None):\n \"Convert to list\"\n return self.filled(fill_value).tolist()\n\n def tostring(self, fill_value=None):\n \"Convert to string\"\n return self.filled(fill_value).tostring()\n\n def unmask (self):\n \"Replace the mask by None if possible.\"\n if self._mask is None: return\n m = make_mask(self._mask, flag=1)\n if m is None:\n self._mask = None\n self._shared_mask = 0\n\n def unshare_mask (self):\n \"If currently sharing mask, make a copy.\"\n if self._shared_mask:\n self._mask = make_mask (self._mask, copy=1, flag=0)\n self._shared_mask = 0\n\n shape = property(_get_shape, _set_shape,\n doc = 'tuple giving the shape of the array')\n\n flat = property(_get_flat, _set_flat,\n doc = 'Access array in flat form.')\n\n real = property(_get_real, _set_real,\n doc = 'Access the real part of the array')\n\n imaginary = property(_get_imaginary, _set_imaginary,\n doc = 'Access the imaginary part of the array')\n\n imag = imaginary\n\n#end class MaskedArray\n\narray = MaskedArray\n\ndef isMaskedArray (x):\n \"Is x a masked array, that is, an instance of MaskedArray?\"\n return isinstance(x, MaskedArray)\n\nisarray = isMaskedArray\nisMA = isMaskedArray #backward compatibility\n\ndef allclose (a, b, fill_value=1, rtol=1.e-5, atol=1.e-8):\n \"\"\" Returns true if all components of a and b are equal\n subject to given tolerances.\n If fill_value is 1, masked values considered equal.\n If fill_value is 0, masked values considered unequal.\n The relative error rtol should be positive and << 1.0\n The absolute error atol comes into play for those elements\n of b that are very small or zero; it says how small a must be also.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a)\n d2 = filled(b)\n x = filled(array(d1, copy=0, mask=m), fill_value).astype(float)\n y = filled(array(d2, copy=0, mask=m), 1).astype(float)\n d = umath.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y))\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n\ndef allequal (a, b, fill_value=1):\n \"\"\"\n True if all entries of a and b are equal, using\n fill_value as a truth value where either or both are masked.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n if m is None:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n elif fill_value:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n dm = array(d, mask=m, copy=0)\n return oldnumeric.alltrue(oldnumeric.ravel(filled(dm, 1)))\n else:\n return 0\n\ndef masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1):\n \"\"\"\n masked_values(data, value, rtol=1.e-5, atol=1.e-8)\n Create a masked array; mask is None if possible.\n If copy==0, and otherwise possible, result\n may share data values with original array.\n Let d = filled(data, value). Returns d\n masked where abs(data-value)<= atol + rtol * abs(value)\n if d is of a floating point type. Otherwise returns\n masked_object(d, value, copy)\n \"\"\"\n abs = umath.absolute\n d = filled(data, value)\n if issubclass(d.dtype, numeric.floating):\n m = umath.less_equal(abs(d-value), atol+rtol*abs(value))\n m = make_mask(m, flag=1)\n return array(d, mask = m, copy=copy,\n fill_value=value)\n else:\n return masked_object(d, value, copy=copy)\n\ndef masked_object (data, value, copy=1):\n \"Create array masked where exactly data equal to value\"\n d = filled(data, value)\n dm = make_mask(umath.equal(d, value), flag=1)\n return array(d, mask=dm, copy=copy, fill_value=value)\n\ndef arrayrange(start, stop=None, step=1, dtype=None):\n \"\"\"Just like range() except it returns a array whose type can be specified\n by the keyword argument dtypechar.\n \"\"\"\n return array(numeric.arrayrange(start, stop, step, dtype))\n\narange = arrayrange\n\ndef fromstring (s, t):\n \"Construct a masked array from a string. Result will have no mask.\"\n return masked_array(numeric.fromstring(s, t))\n\ndef left_shift (a, n):\n \"Left shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.left_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.left_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef right_shift (a, n):\n \"Right shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.right_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.right_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef resize (a, new_shape):\n \"\"\"resize(a, new_shape) returns a new array with the specified shape.\n The original array's total size can be any size.\"\"\"\n m = getmask(a)\n if m is not None:\n m = oldnumeric.resize(m, new_shape)\n result = array(oldnumeric.resize(filled(a), new_shape), mask=m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef repeat(a, repeats, axis=0):\n \"\"\"repeat elements of a repeats times along axis\n repeats is a sequence of length a.shape[axis]\n telling how many times to repeat each element.\n \"\"\"\n af = filled(a)\n if isinstance(repeats, types.IntType):\n repeats = tuple([repeats]*(shape(af)[axis]))\n\n m = getmask(a)\n if m is not None:\n m = oldnumeric.repeat(m, repeats, axis)\n d = oldnumeric.repeat(af, repeats, axis)\n result = masked_array(d, m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef identity(n):\n \"\"\"identity(n) returns the identity matrix of shape n x n.\n \"\"\"\n return array(numeric.identity(n))\n\ndef indices (dimensions, dtype=None):\n \"\"\"indices(dimensions,dtype=None) returns an array representing a grid\n of indices with row-only, and column-only variation.\n \"\"\"\n return array(numeric.indices(dimensions, dtype))\n\ndef zeros (shape, dtype=int):\n \"\"\"zeros(n, dtype=int) =\n an array of all zeros of the given length or shape.\"\"\"\n return array(numeric.zeros(shape, dtype))\n\ndef ones (shape, dtype=int):\n \"\"\"ones(n, dtype=int) =\n an array of all ones of the given length or shape.\"\"\"\n return array(numeric.ones(shape, dtype))\n\n\ndef count (a, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n a = masked_array(a)\n return a.count(axis)\n\ndef power (a, b, third=None):\n \"a**b\"\n if third is not None:\n raise MAError, \"3-argument power not supported.\"\n ma = getmask(a)\n mb = getmask(b)\n m = mask_or(ma, mb)\n fa = filled(a, 1)\n fb = filled(b, 1)\n if fb.dtypechar in typecodes[\"Integer\"]:\n return masked_array(umath.power(fa, fb), m)\n md = make_mask(umath.less_equal (fa, 0), flag=1)\n m = mask_or(m, md)\n if m is None:\n return masked_array(umath.power(fa, fb))\n else:\n fa = numeric.where(m, 1, fa)\n return masked_array(umath.power(fa, fb), m)\n\ndef masked_array (a, mask=None, fill_value=None):\n \"\"\"masked_array(a, mask=None) =\n array(a, mask=mask, copy=0, fill_value=fill_value)\n \"\"\"\n return array(a, mask=mask, copy=0, fill_value=fill_value)\n\nsum = add.reduce\nproduct = multiply.reduce\n\ndef average (a, axis=0, weights=None, returned = 0):\n \"\"\"average(a, axis=0, weights=None)\n Computes average along indicated axis.\n If axis is None, average over the entire array\n Inputs can be integer or floating types; result is of type float.\n\n If weights are given, result is sum(a*weights)/(sum(weights)*1.0)\n weights must have a's shape or be the 1-d with length the size\n of a in the given axis.\n\n If returned, return a tuple: the result and the sum of the weights\n or count of values. Results will have the same shape.\n\n masked values in the weights will be set to 0.0\n \"\"\"\n a = masked_array(a)\n mask = a.mask\n ash = a.shape\n if ash == ():\n ash = (1,)\n if axis is None:\n if mask is None:\n if weights is None:\n n = add.reduce(a.raw_data().ravel())\n d = reduce(lambda x, y: x * y, ash, 1.0)\n else:\n w = filled(weights, 0.0).ravel()\n n = umath.add.reduce(a.raw_data().ravel() * w)\n d = umath.add.reduce(w)\n del w\n else:\n if weights is None:\n n = add.reduce(a.ravel())\n w = oldnumeric.choose(mask, (1.0,0.0)).ravel()\n d = umath.add.reduce(w)\n del w\n else:\n w = array(filled(weights, 0.0), float, mask=mask).ravel()\n n = add.reduce(a.ravel() * w)\n d = add.reduce(w)\n del w\n else:\n if mask is None:\n if weights is None:\n d = ash[axis] * 1.0\n n = umath.add.reduce(a.raw_data(), axis)\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = numeric.array(w, float, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * ones(ash, float)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w, r\n else:\n raise ValueError, 'average: weights wrong shape.'\n else:\n if weights is None:\n n = add.reduce(a, axis)\n w = numeric.choose(mask, (1.0, 0.0))\n d = umath.add.reduce(w, axis)\n del w\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = array(w, float, mask=mask, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * masked_array(ones(ash, float), mask)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n else:\n raise ValueError, 'average: weights wrong shape.'\n del w\n #print n, d, repr(mask), repr(weights)\n if n is masked or d is masked: return masked\n result = divide (n, d)\n del n\n\n if isinstance(result, MaskedArray):\n result.unmask()\n if returned:\n if not isinstance(d, MaskedArray):\n d = masked_array(d)\n if not d.shape == result.shape:\n d = ones(result.shape, float) * d\n d.unmask()\n if returned:\n return result, d\n else:\n return result\n\ndef where (condition, x, y):\n \"\"\"where(condition, x, y) is x where condition is nonzero, y otherwise.\n condition must be convertible to an integer array.\n Answer is always the shape of condition.\n The type depends on x and y. It is integer if both x and y are\n the value masked.\n \"\"\"\n fc = filled(not_equal(condition,0), 0)\n if x is masked:\n xv = 0\n xm = 1\n else:\n xv = filled(x)\n xm = getmask(x)\n if xm is None: xm = 0\n if y is masked:\n yv = 0\n ym = 1\n else:\n yv = filled(y)\n ym = getmask(y)\n if ym is None: ym = 0\n d = numeric.choose(fc, (yv, xv))\n md = numeric.choose(fc, (ym, xm))\n m = getmask(condition)\n m = make_mask(mask_or(m, md), copy=0, flag=1)\n return masked_array(d, m)\n\ndef choose (indices, t):\n \"Returns array shaped like indices with elements chosen from t\"\n def fmask (x):\n if x is masked: return 1\n return filled(x)\n def nmask (x):\n if x is masked: return 1\n m = getmask(x)\n if m is None: return 0\n return m\n c = filled(indices,0)\n masks = [nmask(x) for x in t]\n a = [fmask(x) for x in t]\n d = numeric.choose(c, a)\n m = numeric.choose(c, masks)\n m = make_mask(mask_or(m, getmask(indices)), copy=0, flag=1)\n return masked_array(d, m)\n\ndef masked_where(condition, x, copy=1):\n \"\"\"Return x as an array masked where condition is true.\n Also masked where x or condition masked.\n \"\"\"\n cm = filled(condition,1)\n m = mask_or(getmask(x), cm)\n return array(filled(x), copy=copy, mask=m)\n\ndef masked_greater(x, value, copy=1):\n \"masked_greater(x, value) = x masked where x > value\"\n return masked_where(greater(x, value), x, copy)\n\ndef masked_greater_equal(x, value, copy=1):\n \"masked_greater_equal(x, value) = x masked where x >= value\"\n return masked_where(greater_equal(x, value), x, copy)\n\ndef masked_less(x, value, copy=1):\n \"masked_less(x, value) = x masked where x < value\"\n return masked_where(less(x, value), x, copy)\n\ndef masked_less_equal(x, value, copy=1):\n \"masked_less_equal(x, value) = x masked where x <= value\"\n return masked_where(less_equal(x, value), x, copy)\n\ndef masked_not_equal(x, value, copy=1):\n \"masked_not_equal(x, value) = x masked where x != value\"\n d = filled(x,0)\n c = umath.not_equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_equal(x, value, copy=1):\n \"\"\"masked_equal(x, value) = x masked where x == value\n For floating point consider masked_values(x, value) instead.\n \"\"\"\n d = filled(x,0)\n c = umath.equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_inside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are inside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d=filled(x, 0)\n c = umath.logical_and(umath.less_equal(d, v2), umath.greater_equal(d, v1))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef masked_outside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are outside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d = filled(x,0)\n c = umath.logical_or(umath.less(d, v1), umath.greater(d, v2))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef reshape (a, *newshape):\n \"Copy of a with a new shape.\"\n m = getmask(a)\n d = filled(a).reshape(*newshape)\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.reshape(m, *newshape))\n\ndef ravel (a):\n \"a as one-dimensional, may share data and mask\"\n m = getmask(a)\n d = oldnumeric.ravel(filled(a))\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.ravel(m))\n\ndef concatenate (arrays, axis=0):\n \"Concatenate the arrays along the given axis\"\n d = []\n for x in arrays:\n d.append(filled(x))\n d = numeric.concatenate(d, axis)\n for x in arrays:\n if getmask(x) is not None: break\n else:\n return masked_array(d)\n dm = []\n for x in arrays:\n dm.append(getmaskarray(x))\n dm = numeric.concatenate(dm, axis)\n return masked_array(d, mask=dm)\n\ndef take (a, indices, axis=0):\n \"take(a, indices, axis=0) returns selection of items from a.\"\n m = getmask(a)\n d = masked_array(a).raw_data()\n if m is None:\n return masked_array(numeric.take(d, indices, axis))\n else:\n return masked_array(numeric.take(d, indices, axis),\n mask = numeric.take(m, indices, axis))\n\ndef transpose(a, axes=None):\n \"transpose(a, axes=None) reorder dimensions per tuple axes\"\n m = getmask(a)\n d = filled(a)\n if m is None:\n return masked_array(numeric.transpose(d, axes))\n else:\n return masked_array(numeric.transpose(d, axes),\n mask = numeric.transpose(m, axes))\n\n\ndef put(a, indices, values):\n \"\"\"put(a, indices, values) sets storage-indexed locations to corresponding values.\n\n Values and indices are filled if necessary.\n\n \"\"\"\n d = a.raw_data()\n ind = filled(indices)\n v = filled(values)\n numeric.put (d, ind, v)\n m = getmask(a)\n if m is not None:\n a.unshare_mask()\n numeric.put(a.raw_mask(), ind, 0)\n\ndef putmask(a, mask, values):\n \"putmask(a, mask, values) sets a where mask is true.\"\n if mask is None:\n return\n numeric.putmask(a.raw_data(), mask, values)\n m = getmask(a)\n if m is None: return\n a.unshare_mask()\n numeric.putmask(a.raw_mask(), mask, 0)\n\ndef innerproduct(a,b):\n \"\"\"innerproduct(a,b) returns the dot product of two arrays, which has\n shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the\n product of the elements from the last dimensions of a and b.\n Masked elements are replace by zeros.\n \"\"\"\n fa = filled(a, 0)\n fb = filled(b, 0)\n if len(fa.shape) == 0: fa.shape = (1,)\n if len(fb.shape) == 0: fb.shape = (1,)\n return masked_array(numeric.innerproduct(fa, fb))\n\ndef outerproduct(a, b):\n \"\"\"outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))\"\"\"\n fa = filled(a,0).ravel()\n fb = filled(b,0).ravel()\n d = numeric.outerproduct(fa, fb)\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n return masked_array(d)\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = make_mask(1-numeric.outerproduct(1-ma,1-mb), copy=0)\n return masked_array(d, m)\n\ndef dot(a, b):\n \"\"\"dot(a,b) returns matrix-multiplication between a and b. The product-sum\n is over the last dimension of a and the second-to-last dimension of b.\n Masked values are replaced by zeros. See also innerproduct.\n \"\"\"\n return innerproduct(filled(a,0), numeric.swapaxes(filled(b,0), -1, -2))\n\ndef compress(condition, x, dimension=-1):\n \"\"\"Select those parts of x for which condition is true.\n Masked values in condition are considered false.\n \"\"\"\n c = filled(condition, 0)\n m = getmask(x)\n if m is not None:\n m=numeric.compress(c, m, dimension)\n d = numeric.compress(c, filled(x), dimension)\n return masked_array(d, m)\n\nclass _minimum_operation:\n \"Object to calculate minima\"\n def __init__ (self):\n \"\"\"minimum(a, b) or minimum(a)\n In one argument case returns the scalar minimum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amin(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amin(ac.raw_data())\n else:\n return where(less(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.minimum.reduce (t, axis))\n else:\n t = umath.minimum.reduce(filled(target, minimum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.minimum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nminimum = _minimum_operation ()\n\nclass _maximum_operation:\n \"Object to calculate maxima\"\n def __init__ (self):\n \"\"\"maximum(a, b) or maximum(a)\n In one argument case returns the scalar maximum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amax(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amax(ac.raw_data())\n else:\n return where(greater(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.maximum.reduce (t, axis))\n else:\n t = umath.maximum.reduce(filled(target, maximum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.maximum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nmaximum = _maximum_operation ()\n\ndef sort (x, axis = -1, fill_value=None):\n \"\"\"If x does not have a mask, return a masked array formed from the\n result of numeric.sort(x, axis).\n Otherwise, fill x with fill_value. Sort it.\n Set a mask where the result is equal to fill_value.\n Note that this may have unintended consequences if the data contains the\n fill value at a non-masked site.\n\n If fill_value is not given the default fill value for x's type will be\n used.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n d = filled(x, fill_value)\n s = oldnumeric.sort(d, axis)\n if getmask(x) is None:\n return masked_array(s)\n return masked_values(s, fill_value, copy=0)\n\ndef diagonal(a, k = 0, axis1=0, axis2=1):\n \"\"\"diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a\"\"\"\n d = oldnumeric.diagonal(filled(a), k, axis1, axis2)\n m = getmask(a)\n if m is None:\n return masked_array(d, m)\n else:\n return masked_array(d, oldnumeric.diagonal(m, k, axis1, axis2))\n\ndef argsort (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for sorting along given axis.\n if fill_value is None, use get_fill_value(x)\n Returns a numpy array.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argsort(d, axis)\n\ndef argmin (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return indices for minimum values along given axis.\n if fill_value is None, use get_fill_value(x).\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argmin(d, axis)\n\ndef argmax (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for maximum along given axis.\n if fill_value is None, use -get_fill_value(x) if it exists.\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n try:\n fill_value = - fill_value\n except:\n pass\n d = filled(x, fill_value)\n return oldnumeric.argmax(d, axis)\n\ndef fromfunction (f, s):\n \"\"\"apply f to s to create array as in umath.\"\"\"\n return masked_array(numeric.fromfunction(f,s))\n\ndef asarray(data, dtype=None):\n \"\"\"asarray(data, dtype) = array(data, dtype, copy=0)\n \"\"\"\n if isinstance(data, MaskedArray) and \\\n (dtype is None or dtype == data.dtype):\n return data\n return array(data, dtype=dtype, copy=0)\n\nmasked = MaskedArray([0], int, mask=[1])[0:0]\nmasked = masked[0:0]\n", + "source_code_before": "\"\"\"MA: a facility for dealing with missing observations\nMA is generally used as a numpy.array look-alike.\nby Paul F. Dubois.\n\nCopyright 1999, 2000, 2001 Regents of the University of California.\nReleased for unlimited redistribution.\nAdapted for numpy_core 2005 by Travis Oliphant and\n(mainly) Paul Dubois.\n\"\"\"\nimport string, types, sys\n\nimport umath\nimport oldnumeric\nfrom numeric import e, pi, newaxis, ndarray, inf\nfrom oldnumeric import typecodes, amax, amin\nfrom numerictypes import *\nimport numeric\n\n \nMaskType=bool_\ndivide_tolerance = 1.e-35\n\nclass MAError (Exception):\n def __init__ (self, args=None):\n \"Create an exception\"\n self.args = args\n def __str__(self):\n \"Calculate the string representation\"\n return str(self.args)\n __repr__ = __str__\n\nclass _MaskedPrintOption:\n \"One instance of this class, masked_print_option, is created.\"\n def __init__ (self, display):\n \"Create the masked print option object.\"\n self.set_display(display)\n self._enabled = 1\n\n def display (self):\n \"Show what prints for masked values.\"\n return self._display\n\n def set_display (self, s):\n \"set_display(s) sets what prints for masked values.\"\n self._display = s\n\n def enabled (self):\n \"Is the use of the display value enabled?\"\n return self._enabled\n\n def enable(self, flag=1):\n \"Set the enabling flag to flag.\"\n self._enabled = flag\n\n def __str__ (self):\n return str(self._display)\n\n#if you single index into a masked location you get this object.\nmasked_print_option = _MaskedPrintOption('--')\n\n# Use single element arrays or scalars.\ndefault_real_fill_value = 1.e20\ndefault_complex_fill_value = 1.e20 + 0.0j\ndefault_character_fill_value = '-'\ndefault_integer_fill_value = 999999\ndefault_object_fill_value = '?'\n\ndef default_fill_value (obj):\n \"Function to calculate default fill value for an object.\"\n if isinstance(obj, types.FloatType):\n return default_real_fill_value\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return default_integer_fill_value\n elif isinstance(obj, types.StringType):\n return default_character_fill_value\n elif isinstance(obj, types.ComplexType):\n return default_complex_fill_value\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return default_real_fill_value\n if x in typecodes['Integer']:\n return default_integer_fill_value\n if x in typecodes['Complex']:\n return default_complex_fill_value\n if x in typecodes['Character']:\n return default_character_fill_value\n if x in typecodes['UnsignedInteger']:\n return umath.absolute(default_integer_fill_value)\n return default_object_fill_value\n else:\n return default_object_fill_value\n\ndef minimum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking minima.\"\n if isinstance(obj, types.FloatType):\n return numeric.inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return numeric.inf\n if x in typecodes['Integer']:\n return sys.maxint\n if x in typecodes['UnsignedInteger']:\n return sys.maxint\n else:\n raise TypeError, 'Unsuitable type for calculating minimum.'\n\ndef maximum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking maxima.\"\n if isinstance(obj, types.FloatType):\n return -inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return -sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return -inf\n if x in typecodes['Integer']:\n return -sys.maxint\n if x in typecodes['UnsignedInteger']:\n return 0\n else:\n raise TypeError, 'Unsuitable type for calculating maximum.'\n\ndef set_fill_value (a, fill_value):\n \"Set fill value of a if it is a masked array.\"\n if isMaskedArray(a):\n a.set_fill_value (fill_value)\n\ndef getmask (a):\n \"\"\"Mask of values in a; could be None.\n Returns None if a is not a masked array.\n To get an array for sure use getmaskarray.\"\"\"\n if isinstance(a, MaskedArray):\n return a.raw_mask()\n else:\n return None\n\ndef getmaskarray (a):\n \"\"\"Mask of values in a; an array of zeros if mask is None\n or not a masked array, and is a byte-sized integer.\n Do not try to add up entries, for example.\n \"\"\"\n m = getmask(a)\n if m is None:\n return make_mask_none(shape(a))\n else:\n return m\n\ndef is_mask (m):\n \"\"\"Is m a legal mask? Does not check contents, only type.\n \"\"\"\n if m is None or (isinstance(m, ndarray) and \\\n m.dtype is MaskType):\n return 1\n else:\n return 0\n\ndef make_mask (m, copy=0, flag=0):\n \"\"\"make_mask(m, copy=0, flag=0)\n return m as a mask, creating a copy if necessary or requested.\n Can accept any sequence of integers or None. Does not check\n that contents must be 0s and 1s.\n if flag, return None if m contains no true elements.\n \"\"\"\n if m is None:\n return None\n elif isinstance(m, ndarray):\n if m.dtype is MaskType:\n if copy:\n result = numeric.array(m, dtype=MaskType, copy=copy)\n else:\n result = m\n else:\n result = m.astype(MaskType)\n else:\n result = filled(m,True).astype(MaskType)\n\n if flag and not oldnumeric.sometrue(oldnumeric.ravel(result)):\n return None\n else:\n return result\n\ndef make_mask_none (s):\n \"Return a mask of all zeros of shape s.\"\n result = numeric.zeros(s, dtype=MaskType)\n result.shape = s\n return result\n\ndef mask_or (m1, m2):\n \"\"\"Logical or of the mask candidates m1 and m2, treating None as false.\n Result may equal m1 or m2 if the other is None.\n \"\"\"\n if m1 is None: return make_mask(m2)\n if m2 is None: return make_mask(m1)\n if m1 is m2 and is_mask(m1): return m1\n return make_mask(umath.logical_or(m1, m2))\n\ndef filled (a, value = None):\n \"\"\"a as a contiguous numeric array with any masked areas replaced by value\n if value is None or the special element \"masked\", get_fill_value(a)\n is used instead.\n\n If a is already a contiguous numeric array, a itself is returned.\n\n filled(a) can be used to be sure that the result is numeric when\n passing an object a to other software ignorant of MA, in particular to\n numeric itself.\n \"\"\"\n if isinstance(a, MaskedArray):\n return a.filled(value)\n elif isinstance(a, ndarray) and a.flags['CONTIGUOUS']:\n return a\n elif isinstance(a, types.DictType):\n return numeric.array(a, 'O')\n else:\n return numeric.array(a)\n\ndef get_fill_value (a):\n \"\"\"\n The fill value of a, if it has one; otherwise, the default fill value\n for that type.\n \"\"\"\n if isMaskedArray(a):\n result = a.fill_value()\n else:\n result = default_fill_value(a)\n return result\n\ndef common_fill_value (a, b):\n \"The common fill_value of a and b, if there is one, or None\"\n t1 = get_fill_value(a)\n t2 = get_fill_value(b)\n if t1 == t2: return t1\n return None\n\n# Domain functions return 1 where the argument(s) are not in the domain.\nclass domain_check_interval:\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n def __init__(self, y1, y2):\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n self.y1 = y1\n self.y2 = y2\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.logical_or(umath.greater (x, self.y2),\n umath.less(x, self.y1)\n )\n\nclass domain_tan:\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n def __init__(self, eps):\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n self.eps = eps\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less(umath.absolute(umath.cos(x)), self.eps)\n\nclass domain_greater:\n \"domain_greater(v)(x) = true where x <= v\"\n def __init__(self, critical_value):\n \"domain_greater(v)(x) = true where x <= v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less_equal (x, self.critical_value)\n\nclass domain_greater_equal:\n \"domain_greater_equal(v)(x) = true where x < v\"\n def __init__(self, critical_value):\n \"domain_greater_equal(v)(x) = true where x < v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less (x, self.critical_value)\n\nclass masked_unary_operation:\n def __init__ (self, aufunc, fill=0, domain=None):\n \"\"\" masked_unary_operation(aufunc, fill=0, domain=None)\n aufunc(fill) must be defined\n self(x) returns aufunc(x)\n with masked values where domain(x) is true or getmask(x) is true.\n \"\"\"\n self.f = aufunc\n self.fill = fill\n self.domain = domain\n self.__doc__ = getattr(aufunc, \"__doc__\", str(aufunc))\n\n def __call__ (self, a, *args, **kwargs):\n \"Execute the call behavior.\"\n# numeric tries to return scalars rather than arrays when given scalars.\n m = getmask(a)\n d1 = filled(a, self.fill)\n if self.domain is not None:\n m = mask_or(m, self.domain(d1))\n if m is None:\n result = self.f(d1, *args, **kwargs)\n if type(result) is ndarray:\n return masked_array (result)\n else:\n return result\n else:\n dx = masked_array(d1, m)\n result = self.f(filled(dx, self.fill), *args, **kwargs)\n if type(result) is ndarray:\n return masked_array(result, m)\n elif m[...]:\n return masked\n else:\n return result\n\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\n\nclass domain_safe_divide:\n def __init__ (self, tolerance=divide_tolerance):\n self.tolerance = tolerance\n def __call__ (self, a, b):\n return umath.absolute(a) * self.tolerance >= umath.absolute(b)\n\nclass domained_binary_operation:\n \"\"\"Binary operations that have a domain, like divide. These are complicated so they\n are a separate class. They have no reduce, outer or accumulate.\n \"\"\"\n def __init__ (self, abfunc, domain, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.domain = domain\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__(self, a, b):\n \"Execute the call behavior.\"\n ma = getmask(a)\n mb = getmask(b)\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n t = self.domain(d1, d2)\n\n if oldnumeric.sometrue(t, None):\n d2 = where(t, self.filly, d2)\n mb = mask_or(mb, t)\n m = mask_or(ma, mb)\n if m is None:\n result = self.f(d1, d2)\n if type(result) is ndarray:\n return masked_array(result)\n else:\n return result\n result = self.f(d1, d2)\n if type(result) is ndarray:\n if m.shape != result.shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n elif m[...]:\n return masked\n else:\n return result\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nclass masked_binary_operation:\n def __init__ (self, abfunc, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__ (self, a, b, *args, **kwargs):\n \"Execute the call behavior.\"\n m = mask_or(getmask(a), getmask(b))\n if m is None:\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n if type(result) is ndarray:\n return masked_array(result)\n else:\n return result\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n if type(result) is ndarray:\n if m.shape != result.shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n elif m[...]:\n return masked\n else:\n return result\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis with this function.\"\"\"\n m = getmask(target)\n t = filled(target, self.filly)\n if t.shape == ():\n t = t.reshape(1)\n if m is not None:\n m = make_mask(m, copy=1)\n m.shape = (1,)\n if m is None:\n return masked_array (self.f.reduce (t, axis))\n else:\n t = masked_array (t, m)\n t = self.f.reduce(filled(t, self.filly), axis)\n m = umath.logical_and.reduce(m, axis)\n if isinstance(t, ndarray):\n return masked_array(t, m, get_fill_value(target))\n elif m:\n return masked\n else:\n return t\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = self.f.outer(filled(a, self.fillx), filled(b, self.filly))\n return masked_array(d, m)\n\n def accumulate (self, target, axis=0):\n \"\"\"Accumulate target along axis after filling with y fill value.\"\"\"\n t = filled(target, self.filly)\n return masked_array (self.f.accumulate (t, axis))\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nsqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0))\nlog = masked_unary_operation(umath.log, 1.0, domain_greater(0.0))\nlog10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0))\nexp = masked_unary_operation(umath.exp)\nconjugate = masked_unary_operation(umath.conjugate)\nsin = masked_unary_operation(umath.sin)\ncos = masked_unary_operation(umath.cos)\ntan = masked_unary_operation(umath.tan, 0.0, domain_tan(1.e-35))\narcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-1.0, 1.0))\narccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-1.0, 1.0))\narctan = masked_unary_operation(umath.arctan)\n# Missing from numeric\narcsinh = masked_unary_operation(umath.arcsinh)\narccosh = masked_unary_operation(umath.arccosh)\narctanh = masked_unary_operation(umath.arctanh)\nsinh = masked_unary_operation(umath.sinh)\ncosh = masked_unary_operation(umath.cosh)\ntanh = masked_unary_operation(umath.tanh)\nabsolute = masked_unary_operation(umath.absolute)\nfabs = masked_unary_operation(umath.fabs)\nnegative = masked_unary_operation(umath.negative)\nnonzero = masked_unary_operation(oldnumeric.nonzero)\naround = masked_unary_operation(oldnumeric.round_)\nfloor = masked_unary_operation(umath.floor)\nceil = masked_unary_operation(umath.ceil)\nsometrue = masked_unary_operation(oldnumeric.sometrue)\nalltrue = masked_unary_operation(oldnumeric.alltrue, 1)\nlogical_not = masked_unary_operation(umath.logical_not)\n\nadd = masked_binary_operation(umath.add)\nsubtract = masked_binary_operation(umath.subtract)\nsubtract.reduce = None\nmultiply = masked_binary_operation(umath.multiply, 1, 1)\ndivide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1)\ntrue_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1)\nfloor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1)\nremainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1)\nfmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1)\nhypot = masked_binary_operation(umath.hypot)\narctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0)\narctan2.reduce = None\nequal = masked_binary_operation(umath.equal)\nequal.reduce = None\nnot_equal = masked_binary_operation(umath.not_equal)\nnot_equal.reduce = None\nless_equal = masked_binary_operation(umath.less_equal)\nless_equal.reduce = None\ngreater_equal = masked_binary_operation(umath.greater_equal)\ngreater_equal.reduce = None\nless = masked_binary_operation(umath.less)\nless.reduce = None\ngreater = masked_binary_operation(umath.greater)\ngreater.reduce = None\nlogical_and = masked_binary_operation(umath.logical_and)\nlogical_or = masked_binary_operation(umath.logical_or)\nlogical_xor = masked_binary_operation(umath.logical_xor)\nbitwise_and = masked_binary_operation(umath.bitwise_and)\nbitwise_or = masked_binary_operation(umath.bitwise_or)\nbitwise_xor = masked_binary_operation(umath.bitwise_xor)\n\ndef rank (object):\n return oldnumeric.rank(filled(object))\n\ndef shape (object):\n return oldnumeric.shape(filled(object))\n\ndef size (object, axis=None):\n return oldnumeric.size(filled(object), axis)\n\nclass MaskedArray (object):\n \"\"\"Arrays with possibly masked values.\n Masked values of 1 exclude the corresponding element from \n any computation.\n\n Construction:\n x = array(data, dtype=None, copy=True, fortran=False,\n mask = None, fill_value=None)\n\n If copy=False, every effort is made not to copy the data:\n If data is a MaskedArray, and argument mask=None,\n then the candidate data is data.data and the\n mask used is data.mask. If data is a numeric array,\n it is used as the candidate raw data.\n If dtypechar is not None and\n is != data.dtypechar then a data copy is required.\n Otherwise, the candidate is used.\n\n If a data copy is required, raw data stored is the result of:\n numeric.array(data, dtype=dtypechar, copy=copy)\n\n If mask is None there are no masked values. Otherwise mask must\n be convertible to an array of booleans with the same shape as x.\n\n fill_value is used to fill in masked values when necessary,\n such as when printing and in method/function filled().\n The fill_value is not used for computation within this module.\n \"\"\"\n def __init__(self, data, dtype=None, copy=True, fortran=False, \n mask=None, fill_value=None):\n \"\"\"array(data, dtype=None, copy=True, fortran=False, mask=None, fill_value=None)\n If data already a numeric array, its dtype becomes the default value of dtype.\n \"\"\"\n tc = dtype\n need_data_copied = copy\n if isinstance(data, MaskedArray):\n c = data.data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n if mask is None:\n mask = data.mask\n elif mask is not None: #attempting to change the mask\n need_data_copied = True\n\n elif isinstance(data, ndarray):\n c = data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n else:\n need_data_copied = False #because I'll do it now\n c = numeric.array(data, dtype=tc, copy=True, fortran=fortran)\n\n if need_data_copied:\n if tc == ctc:\n self._data = numeric.array(c, dtype=tc, copy=True, fortran=fortran)\n else:\n self._data = c.astype(tc)\n else:\n self._data = c\n\n if mask is None:\n self._mask = None\n self._shared_mask = 0\n else:\n self._mask = make_mask (mask)\n if self._mask is None:\n self._shared_mask = 0\n else:\n self._shared_mask = (self._mask is mask)\n nm = size(self._mask)\n nd = size(self._data)\n if nm != nd:\n if nm == 1:\n self._mask = oldnumeric.resize(self._mask, self._data.shape)\n self._shared_mask = 0\n elif nd == 1:\n self._data = oldnumeric.resize(self._data, self._mask.shape)\n self._data.shape = self._mask.shape\n else:\n raise MAError, \"Mask and data not compatible.\"\n elif nm == 1 and shape(self._mask) != shape(self._data):\n self.unshare_mask()\n self._mask.shape = self._data.shape\n\n self.set_fill_value(fill_value)\n\n def __array__ (self, t = None):\n \"Special hook for numeric. Converts to numeric if possible.\"\n if self._mask is not None:\n if oldnumeric.ravel(self._mask).any():\n raise MAError, \\\n \"\"\"Cannot automatically convert masked array to numeric because data\n is masked in one or more locations.\n \"\"\"\n else: # Mask is all false\n # Optimize to avoid future invocations of this section.\n self._mask = None\n self._shared_mask = 0\n if t:\n return self._data.astype(t)\n else:\n return self._data\n\n def _get_shape(self):\n \"Return the current shape.\"\n return self._data.shape\n\n def _set_shape (self, newshape):\n \"Set the array's shape.\"\n self._data.shape = newshape\n if self._mask is not None:\n self._mask = self._mask.copy()\n self._mask.shape = newshape\n\n def _get_flat(self):\n \"\"\"Calculate the flat value.\n \"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel(), mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.ravel(),\n mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_flat (self, value):\n \"x.flat = value\"\n y = self.ravel()\n y[:] = value\n\n def _get_real(self):\n \"Get the real part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.real, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.real, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_real (self, value):\n \"x.real = value\"\n y = self.real\n y[...] = value\n\n def _get_imaginary(self):\n \"Get the imaginary part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.imag, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.imag, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_imaginary (self, value):\n \"x.imaginary = value\"\n y = self.imaginary\n y[...] = value\n\n def __str__(self):\n \"\"\"Calculate the str representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n if masked_print_option.enabled():\n f = masked_print_option\n else:\n f = self.fill_value()\n res = self.filled(f)\n return str(res)\n\n def __repr__(self):\n \"\"\"Calculate the repr representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n with_mask = \"\"\"\\\narray(data =\n %(data)s,\n mask =\n %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n with_mask1 = \"\"\"\\\narray(data = %(data)s,\n mask = %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n without_mask = \"\"\"array(\n %(data)s)\"\"\"\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n\n n = len(self.shape)\n if self._mask is None:\n if n <=1:\n return without_mask1 % {'data':str(self.filled())}\n return without_mask % {'data':str(self.filled())}\n else:\n if n <=1:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n if self._mask is None:\n return without_mask % {'data':str(self.filled())}\n else:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n\n def __float__(self):\n \"Convert self to float.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python float.'\n return float(self.data.item())\n\n def __int__(self):\n \"Convert self to int.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python int.'\n return int(self.data.item())\n\n def __getitem__(self, i):\n \"Get item described by i. Not a copy as in previous versions.\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i]\n if m is None:\n return dout\n mi = m[i]\n if mi.size == 1:\n if mi: \n return masked\n else:\n return dout\n else:\n return masked_array(dout, mi, fill_value=self._fill_value)\n\n def __getslice__(self, i, j):\n \"Get slice described by i, j\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i:j]\n if m is None:\n return masked_array(dout, fill_value=self._fill_value)\n else:\n return masked_array(dout, mask = m[i:j], fill_value=self._fill_value)\n\n# --------\n# setitem and setslice notes\n# note that if value is masked, it means to mask those locations.\n# setting a value changes the mask to match the value in those locations.\n\n def __setitem__(self, index, value):\n \"Set item described by index. If value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, 'Cannot alter the masked element.'\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n else:\n self.unshare_mask()\n self._mask[index] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[index] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[index] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = True\n else:\n self.unshare_mask()\n self._mask[index] = m\n\n def __setslice__(self, i, j, value):\n \"Set slice i:j; if value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, \"Cannot alter the 'masked' object.\"\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n self._mask[i:j] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[i:j] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[i:j] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(self._data.shape)\n self._shared_mask = False\n self._mask[i:j] = m\n\n def __len__ (self):\n \"\"\"Return length of first dimension. This is weird but Python's\n slicing behavior depends on it.\"\"\"\n return len(self._data)\n\n def __and__(self, other):\n \"Return bitwise_and\"\n return bitwise_and(self, other)\n\n def __or__(self, other):\n \"Return bitwise_or\"\n return bitwise_or(self, other)\n\n def __xor__(self, other):\n \"Return bitwise_xor\"\n return bitwise_xor(self, other)\n\n __rand__ = __and__\n __ror__ = __or__\n __rxor__ = __xor__\n\n def __abs__(self):\n \"Return absolute(self)\"\n return absolute(self)\n\n def __neg__(self):\n \"Return negative(self)\"\n return negative(self)\n\n def __pos__(self):\n \"Return array(self)\"\n return array(self)\n\n def __add__(self, other):\n \"Return add(self, other)\"\n return add(self, other)\n\n __radd__ = __add__\n\n def __mod__ (self, other):\n \"Return remainder(self, other)\"\n return remainder(self, other)\n\n def __rmod__ (self, other):\n \"Return remainder(other, self)\"\n return remainder(other, self)\n\n def __lshift__ (self, n):\n return left_shift(self, n)\n\n def __rshift__ (self, n):\n return right_shift(self, n)\n\n def __sub__(self, other):\n \"Return subtract(self, other)\"\n return subtract(self, other)\n\n def __rsub__(self, other):\n \"Return subtract(other, self)\"\n return subtract(other, self)\n\n def __mul__(self, other):\n \"Return multiply(self, other)\"\n return multiply(self, other)\n\n __rmul__ = __mul__\n\n def __div__(self, other):\n \"Return divide(self, other)\"\n return divide(self, other)\n\n def __rdiv__(self, other):\n \"Return divide(other, self)\"\n return divide(other, self)\n\n def __truediv__(self, other):\n \"Return divide(self, other)\"\n return true_divide(self, other)\n\n def __rtruediv__(self, other):\n \"Return divide(other, self)\"\n return true_divide(other, self)\n\n def __floordiv__(self, other):\n \"Return divide(self, other)\"\n return floor_divide(self, other)\n\n def __rfloordiv__(self, other):\n \"Return divide(other, self)\"\n return floor_divide(other, self)\n\n def __pow__(self,other, third=None):\n \"Return power(self, other, third)\"\n return power(self, other, third)\n\n def __sqrt__(self):\n \"Return sqrt(self)\"\n return sqrt(self)\n\n def __iadd__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data += f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = add(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __imul__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data *= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = multiply(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __isub__(self, other):\n \"Subtract other from self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data -= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = subtract(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n\n\n def __idiv__(self, other):\n \"Divide self by other in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n mo = getmask(other)\n result = divide(self, masked_array(f, mask=mo))\n self._data = result.data\n dm = result.raw_mask()\n if dm is not self._mask:\n self._mask = dm\n self._shared_mask = 1\n return self\n\n def __eq__(self,other):\n return equal(self,other)\n\n def __ne__(self,other):\n return not_equal(self,other)\n\n def __lt__(self,other):\n return less(self,other)\n\n def __le__(self,other):\n return less_equal(self,other)\n\n def __gt__(self,other):\n return greater(self,other)\n\n def __ge__(self,other):\n return greater_equal(self,other)\n\n def astype (self, tc):\n \"return self as array of given type.\"\n d = self._data.astype(tc)\n return array(d, mask=self._mask)\n\n def byte_swapped(self):\n \"\"\"Returns the raw data field, byte_swapped. Included for consistency\n with numeric but doesn't make sense in this context.\n \"\"\"\n return self._data.byte_swapped()\n\n def compressed (self):\n \"A 1-D array of all the non-masked data.\"\n d = oldnumeric.ravel(self._data)\n if self._mask is None:\n return array(d)\n else:\n m = 1 - oldnumeric.ravel(self._mask)\n c = oldnumeric.compress(m, d)\n return array(c, copy=0)\n\n def count (self, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n m = self._mask\n s = self._data.shape\n ls = len(s)\n if m is None:\n if ls == 0:\n return 1\n if ls == 1:\n return s[0]\n if axis is None:\n return reduce(lambda x,y:x*y, s)\n else:\n n = s[axis]\n t = list(s)\n del t[axis]\n return ones(t) * n\n if axis is None:\n w = oldnumeric.ravel(m).astype(int) \n n1 = size(w)\n if n1 == 1:\n n2 = w[0]\n else:\n n2 = umath.add.reduce(w)\n return n1 - n2\n else:\n n1 = size(m, axis)\n n2 = sum(m.astype(int), axis)\n return n1 - n2\n\n def dot (self, other):\n \"s.dot(other) = innerproduct(s, other)\"\n return innerproduct(self, other)\n\n def fill_value(self):\n \"Get the current fill value.\"\n return self._fill_value\n\n def filled (self, fill_value=None):\n \"\"\"A numeric array with masked values filled. If fill_value is None,\n use self.fill_value().\n\n If mask is None, copy data only if not contiguous.\n Result is always a contiguous, numeric array.\n# Is contiguous really necessary now?\n \"\"\"\n d = self._data\n m = self._mask\n if m is None:\n if d.flags['CONTIGUOUS']:\n return d\n else:\n return d.copy()\n else:\n if fill_value is None:\n value = self._fill_value\n else:\n value = fill_value\n\n if self is masked:\n result = numeric.array(value).reshape(*d.shape)\n else:\n try:\n result = numeric.array(d, dtype=d.dtype, copy=1)\n result[m] = value\n except:\n #ok, can't put that value in here\n value = numeric.array(value, dtype=object)\n d = d.astype(object)\n result = oldnumeric.choose(m, (d, value))\n return result\n\n def ids (self):\n \"\"\"Return the ids of the data and mask areas\"\"\"\n return (id(self._data), id(self._mask))\n\n def iscontiguous (self):\n \"Is the data contiguous?\"\n return self._data.flags['CONTIGUOUS']\n\n def itemsize(self):\n \"Item size of each data item.\"\n return self._data.itemsize\n\n\n def outer(self, other):\n \"s.outer(other) = outerproduct(s, other)\"\n return outerproduct(self, other)\n\n def put (self, values):\n \"\"\"Set the non-masked entries of self to filled(values).\n No change to mask\n \"\"\"\n iota = numeric.arange(self.size)\n d = self._data\n if self._mask is None:\n ind = iota\n else:\n ind = oldnumeric.compress(1 - self._mask, iota)\n d[ind] = filled(values).astype(d.dtype)\n\n def putmask (self, values):\n \"\"\"Set the masked entries of self to filled(values).\n Mask changed to None.\n \"\"\"\n d = self._data\n if self._mask is not None:\n d[self._mask] = filled(values).astype(d.dtype)\n self._shared_mask = 0\n self._mask = None\n\n def ravel (self):\n \"\"\"Return a 1-D view of self.\"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel())\n else:\n return masked_array(self._data.ravel(), self._mask.ravel())\n\n def raw_data (self):\n \"\"\" Obsolete; use data property instead.\n The raw data; portions may be meaningless.\n May be noncontiguous. Expert use only.\"\"\"\n return self._data\n data = property(fget=raw_data, \n doc=\"The data, but values at masked locations are meaningless.\")\n\n def raw_mask (self):\n \"\"\" Obsolete; use mask property instead.\n May be noncontiguous. Expert use only.\n \"\"\"\n return self._mask\n mask = property(fget=raw_mask, \n doc=\"The mask, may be None. Values where mask true are meaningless.\")\n\n def reshape (self, *s):\n \"\"\"This array reshaped to shape s\"\"\"\n d = self._data.reshape(*s)\n if self._mask is None:\n return masked_array(d)\n else:\n m = self._mask.reshape(*s)\n return masked_array(d, m)\n\n def set_fill_value (self, v=None):\n \"Set the fill value to v. Omit v to restore default.\"\n if v is None:\n v = default_fill_value (self.raw_data())\n self._fill_value = v\n\n def _get_size (self):\n return self._data.size\n size = property(fget=_get_size, doc=\"Number of elements in the array.\")\n## CHECK THIS: signature of numeric.array.size?\n \n def _get_dtypechar(self):\n return self._data.dtypechar\n dtypechar = property(fget=_get_dtypechar, doc=\"type character of the array.\")\n\n def _get_dtype(self):\n return self._data.dtype\n dtype = property(fget=_get_dtype, doc=\"type of the array elements.\")\n\n def item(self):\n \"Return Python scalar if possible.\"\n if self._mask is not None:\n m = oldnumeric.ravel(self._mask)\n try:\n if m[0]:\n return masked\n except IndexError:\n return masked\n return self._data.item()\n\n def tolist(self, fill_value=None):\n \"Convert to list\"\n return self.filled(fill_value).tolist()\n\n def tostring(self, fill_value=None):\n \"Convert to string\"\n return self.filled(fill_value).tostring()\n\n def unmask (self):\n \"Replace the mask by None if possible.\"\n if self._mask is None: return\n m = make_mask(self._mask, flag=1)\n if m is None:\n self._mask = None\n self._shared_mask = 0\n\n def unshare_mask (self):\n \"If currently sharing mask, make a copy.\"\n if self._shared_mask:\n self._mask = make_mask (self._mask, copy=1, flag=0)\n self._shared_mask = 0\n\n shape = property(_get_shape, _set_shape,\n doc = 'tuple giving the shape of the array')\n\n flat = property(_get_flat, _set_flat,\n doc = 'Access array in flat form.')\n\n real = property(_get_real, _set_real,\n doc = 'Access the real part of the array')\n\n imaginary = property(_get_imaginary, _set_imaginary,\n doc = 'Access the imaginary part of the array')\n\n imag = imaginary\n\n#end class MaskedArray\n\narray = MaskedArray\n\ndef isMaskedArray (x):\n \"Is x a masked array, that is, an instance of MaskedArray?\"\n return isinstance(x, MaskedArray)\n\nisarray = isMaskedArray\nisMA = isMaskedArray #backward compatibility\n\ndef allclose (a, b, fill_value=1, rtol=1.e-5, atol=1.e-8):\n \"\"\" Returns true if all components of a and b are equal\n subject to given tolerances.\n If fill_value is 1, masked values considered equal.\n If fill_value is 0, masked values considered unequal.\n The relative error rtol should be positive and << 1.0\n The absolute error atol comes into play for those elements\n of b that are very small or zero; it says how small a must be also.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a)\n d2 = filled(b)\n x = filled(array(d1, copy=0, mask=m), fill_value).astype(float)\n y = filled(array(d2, copy=0, mask=m), 1).astype(float)\n d = umath.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y))\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n\ndef allequal (a, b, fill_value=1):\n \"\"\"\n True if all entries of a and b are equal, using\n fill_value as a truth value where either or both are masked.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n if m is None:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n elif fill_value:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n dm = array(d, mask=m, copy=0)\n return oldnumeric.alltrue(oldnumeric.ravel(filled(dm, 1)))\n else:\n return 0\n\ndef masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1):\n \"\"\"\n masked_values(data, value, rtol=1.e-5, atol=1.e-8)\n Create a masked array; mask is None if possible.\n If copy==0, and otherwise possible, result\n may share data values with original array.\n Let d = filled(data, value). Returns d\n masked where abs(data-value)<= atol + rtol * abs(value)\n if d is of a floating point type. Otherwise returns\n masked_object(d, value, copy)\n \"\"\"\n abs = umath.absolute\n d = filled(data, value)\n if issubclass(d.dtype, numeric.floating):\n m = umath.less_equal(abs(d-value), atol+rtol*abs(value))\n m = make_mask(m, flag=1)\n return array(d, mask = m, copy=copy,\n fill_value=value)\n else:\n return masked_object(d, value, copy=copy)\n\ndef masked_object (data, value, copy=1):\n \"Create array masked where exactly data equal to value\"\n d = filled(data, value)\n dm = make_mask(umath.equal(d, value), flag=1)\n return array(d, mask=dm, copy=copy, fill_value=value)\n\ndef arrayrange(start, stop=None, step=1, dtype=None):\n \"\"\"Just like range() except it returns a array whose type can be specified\n by the keyword argument dtypechar.\n \"\"\"\n return array(numeric.arrayrange(start, stop, step, dtype))\n\narange = arrayrange\n\ndef fromstring (s, t):\n \"Construct a masked array from a string. Result will have no mask.\"\n return masked_array(numeric.fromstring(s, t))\n\ndef left_shift (a, n):\n \"Left shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.left_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.left_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef right_shift (a, n):\n \"Right shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.right_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.right_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef resize (a, new_shape):\n \"\"\"resize(a, new_shape) returns a new array with the specified shape.\n The original array's total size can be any size.\"\"\"\n m = getmask(a)\n if m is not None:\n m = oldnumeric.resize(m, new_shape)\n result = array(oldnumeric.resize(filled(a), new_shape), mask=m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef repeat(a, repeats, axis=0):\n \"\"\"repeat elements of a repeats times along axis\n repeats is a sequence of length a.shape[axis]\n telling how many times to repeat each element.\n \"\"\"\n af = filled(a)\n if isinstance(repeats, types.IntType):\n repeats = tuple([repeats]*(shape(af)[axis]))\n\n m = getmask(a)\n if m is not None:\n m = oldnumeric.repeat(m, repeats, axis)\n d = oldnumeric.repeat(af, repeats, axis)\n result = masked_array(d, m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef identity(n):\n \"\"\"identity(n) returns the identity matrix of shape n x n.\n \"\"\"\n return array(numeric.identity(n))\n\ndef indices (dimensions, dtype=None):\n \"\"\"indices(dimensions,dtype=None) returns an array representing a grid\n of indices with row-only, and column-only variation.\n \"\"\"\n return array(numeric.indices(dimensions, dtype))\n\ndef zeros (shape, dtype=int):\n \"\"\"zeros(n, dtype=int) =\n an array of all zeros of the given length or shape.\"\"\"\n return array(numeric.zeros(shape, dtype))\n\ndef ones (shape, dtype=int):\n \"\"\"ones(n, dtype=int) =\n an array of all ones of the given length or shape.\"\"\"\n return array(numeric.ones(shape, dtype))\n\n\ndef count (a, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n a = masked_array(a)\n return a.count(axis)\n\ndef power (a, b, third=None):\n \"a**b\"\n if third is not None:\n raise MAError, \"3-argument power not supported.\"\n ma = getmask(a)\n mb = getmask(b)\n m = mask_or(ma, mb)\n fa = filled(a, 1)\n fb = filled(b, 1)\n if fb.dtypechar in typecodes[\"Integer\"]:\n return masked_array(umath.power(fa, fb), m)\n md = make_mask(umath.less_equal (fa, 0), flag=1)\n m = mask_or(m, md)\n if m is None:\n return masked_array(umath.power(fa, fb))\n else:\n fa = numeric.where(m, 1, fa)\n return masked_array(umath.power(fa, fb), m)\n\ndef masked_array (a, mask=None, fill_value=None):\n \"\"\"masked_array(a, mask=None) =\n array(a, mask=mask, copy=0, fill_value=fill_value)\n \"\"\"\n return array(a, mask=mask, copy=0, fill_value=fill_value)\n\nsum = add.reduce\nproduct = multiply.reduce\n\ndef average (a, axis=0, weights=None, returned = 0):\n \"\"\"average(a, axis=0, weights=None)\n Computes average along indicated axis.\n If axis is None, average over the entire array\n Inputs can be integer or floating types; result is of type float.\n\n If weights are given, result is sum(a*weights)/(sum(weights)*1.0)\n weights must have a's shape or be the 1-d with length the size\n of a in the given axis.\n\n If returned, return a tuple: the result and the sum of the weights\n or count of values. Results will have the same shape.\n\n masked values in the weights will be set to 0.0\n \"\"\"\n a = masked_array(a)\n mask = a.mask\n ash = a.shape\n if ash == ():\n ash = (1,)\n if axis is None:\n if mask is None:\n if weights is None:\n n = add.reduce(a.raw_data().ravel())\n d = reduce(lambda x, y: x * y, ash, 1.0)\n else:\n w = filled(weights, 0.0).ravel()\n n = umath.add.reduce(a.raw_data().ravel() * w)\n d = umath.add.reduce(w)\n del w\n else:\n if weights is None:\n n = add.reduce(a.ravel())\n w = oldnumeric.choose(mask, (1.0,0.0)).ravel()\n d = umath.add.reduce(w)\n del w\n else:\n w = array(filled(weights, 0.0), float, mask=mask).ravel()\n n = add.reduce(a.ravel() * w)\n d = add.reduce(w)\n del w\n else:\n if mask is None:\n if weights is None:\n d = ash[axis] * 1.0\n n = umath.add.reduce(a.raw_data(), axis)\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = numeric.array(w, float, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * ones(ash, float)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w, r\n else:\n raise ValueError, 'average: weights wrong shape.'\n else:\n if weights is None:\n n = add.reduce(a, axis)\n w = numeric.choose(mask, (1.0, 0.0))\n d = umath.add.reduce(w, axis)\n del w\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = array(w, float, mask=mask, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * masked_array(ones(ash, float), mask)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n else:\n raise ValueError, 'average: weights wrong shape.'\n del w\n #print n, d, repr(mask), repr(weights)\n if n is masked or d is masked: return masked\n result = divide (n, d)\n del n\n\n if isinstance(result, MaskedArray):\n result.unmask()\n if returned:\n if not isinstance(d, MaskedArray):\n d = masked_array(d)\n if not d.shape == result.shape:\n d = ones(result.shape, float) * d\n d.unmask()\n if returned:\n return result, d\n else:\n return result\n\ndef where (condition, x, y):\n \"\"\"where(condition, x, y) is x where condition is nonzero, y otherwise.\n condition must be convertible to an integer array.\n Answer is always the shape of condition.\n The type depends on x and y. It is integer if both x and y are\n the value masked.\n \"\"\"\n fc = filled(not_equal(condition,0), 0)\n if x is masked:\n xv = 0\n xm = 1\n else:\n xv = filled(x)\n xm = getmask(x)\n if xm is None: xm = 0\n if y is masked:\n yv = 0\n ym = 1\n else:\n yv = filled(y)\n ym = getmask(y)\n if ym is None: ym = 0\n d = numeric.choose(fc, (yv, xv))\n md = numeric.choose(fc, (ym, xm))\n m = getmask(condition)\n m = make_mask(mask_or(m, md), copy=0, flag=1)\n return masked_array(d, m)\n\ndef choose (indices, t):\n \"Returns array shaped like indices with elements chosen from t\"\n def fmask (x):\n if x is masked: return 1\n return filled(x)\n def nmask (x):\n if x is masked: return 1\n m = getmask(x)\n if m is None: return 0\n return m\n c = filled(indices,0)\n masks = [nmask(x) for x in t]\n a = [fmask(x) for x in t]\n d = numeric.choose(c, a)\n m = numeric.choose(c, masks)\n m = make_mask(mask_or(m, getmask(indices)), copy=0, flag=1)\n return masked_array(d, m)\n\ndef masked_where(condition, x, copy=1):\n \"\"\"Return x as an array masked where condition is true.\n Also masked where x or condition masked.\n \"\"\"\n cm = filled(condition,1)\n m = mask_or(getmask(x), cm)\n return array(filled(x), copy=copy, mask=m)\n\ndef masked_greater(x, value, copy=1):\n \"masked_greater(x, value) = x masked where x > value\"\n return masked_where(greater(x, value), x, copy)\n\ndef masked_greater_equal(x, value, copy=1):\n \"masked_greater_equal(x, value) = x masked where x >= value\"\n return masked_where(greater_equal(x, value), x, copy)\n\ndef masked_less(x, value, copy=1):\n \"masked_less(x, value) = x masked where x < value\"\n return masked_where(less(x, value), x, copy)\n\ndef masked_less_equal(x, value, copy=1):\n \"masked_less_equal(x, value) = x masked where x <= value\"\n return masked_where(less_equal(x, value), x, copy)\n\ndef masked_not_equal(x, value, copy=1):\n \"masked_not_equal(x, value) = x masked where x != value\"\n d = filled(x,0)\n c = umath.not_equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_equal(x, value, copy=1):\n \"\"\"masked_equal(x, value) = x masked where x == value\n For floating point consider masked_values(x, value) instead.\n \"\"\"\n d = filled(x,0)\n c = umath.equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_inside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are inside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d=filled(x, 0)\n c = umath.logical_and(umath.less_equal(d, v2), umath.greater_equal(d, v1))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef masked_outside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are outside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d = filled(x,0)\n c = umath.logical_or(umath.less(d, v1), umath.greater(d, v2))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef reshape (a, *newshape):\n \"Copy of a with a new shape.\"\n m = getmask(a)\n d = filled(a).reshape(*newshape)\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.reshape(m, *newshape))\n\ndef ravel (a):\n \"a as one-dimensional, may share data and mask\"\n m = getmask(a)\n d = oldnumeric.ravel(filled(a))\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.ravel(m))\n\ndef concatenate (arrays, axis=0):\n \"Concatenate the arrays along the given axis\"\n d = []\n for x in arrays:\n d.append(filled(x))\n d = numeric.concatenate(d, axis)\n for x in arrays:\n if getmask(x) is not None: break\n else:\n return masked_array(d)\n dm = []\n for x in arrays:\n dm.append(getmaskarray(x))\n dm = numeric.concatenate(dm, axis)\n return masked_array(d, mask=dm)\n\ndef take (a, indices, axis=0):\n \"take(a, indices, axis=0) returns selection of items from a.\"\n m = getmask(a)\n d = masked_array(a).raw_data()\n if m is None:\n return masked_array(numeric.take(d, indices, axis))\n else:\n return masked_array(numeric.take(d, indices, axis),\n mask = numeric.take(m, indices, axis))\n\ndef transpose(a, axes=None):\n \"transpose(a, axes=None) reorder dimensions per tuple axes\"\n m = getmask(a)\n d = filled(a)\n if m is None:\n return masked_array(numeric.transpose(d, axes))\n else:\n return masked_array(numeric.transpose(d, axes),\n mask = numeric.transpose(m, axes))\n\n\ndef put(a, indices, values):\n \"\"\"put(a, indices, values) sets storage-indexed locations to corresponding values.\n\n Values and indices are filled if necessary.\n\n \"\"\"\n d = a.raw_data()\n ind = filled(indices)\n v = filled(values)\n numeric.put (d, ind, v)\n m = getmask(a)\n if m is not None:\n a.unshare_mask()\n numeric.put(a.raw_mask(), ind, 0)\n\ndef putmask(a, mask, values):\n \"putmask(a, mask, values) sets a where mask is true.\"\n if mask is None:\n return\n numeric.putmask(a.raw_data(), mask, values)\n m = getmask(a)\n if m is None: return\n a.unshare_mask()\n numeric.putmask(a.raw_mask(), mask, 0)\n\ndef innerproduct(a,b):\n \"\"\"innerproduct(a,b) returns the dot product of two arrays, which has\n shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the\n product of the elements from the last dimensions of a and b.\n Masked elements are replace by zeros.\n \"\"\"\n fa = filled(a, 0)\n fb = filled(b, 0)\n if len(fa.shape) == 0: fa.shape = (1,)\n if len(fb.shape) == 0: fb.shape = (1,)\n return masked_array(numeric.innerproduct(fa, fb))\n\ndef outerproduct(a, b):\n \"\"\"outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))\"\"\"\n fa = filled(a,0).ravel()\n fb = filled(b,0).ravel()\n d = numeric.outerproduct(fa, fb)\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n return masked_array(d)\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = make_mask(1-numeric.outerproduct(1-ma,1-mb), copy=0)\n return masked_array(d, m)\n\ndef dot(a, b):\n \"\"\"dot(a,b) returns matrix-multiplication between a and b. The product-sum\n is over the last dimension of a and the second-to-last dimension of b.\n Masked values are replaced by zeros. See also innerproduct.\n \"\"\"\n return innerproduct(filled(a,0), numeric.swapaxes(filled(b,0), -1, -2))\n\ndef compress(condition, x, dimension=-1):\n \"\"\"Select those parts of x for which condition is true.\n Masked values in condition are considered false.\n \"\"\"\n c = filled(condition, 0)\n m = getmask(x)\n if m is not None:\n m=numeric.compress(c, m, dimension)\n d = numeric.compress(c, filled(x), dimension)\n return masked_array(d, m)\n\nclass _minimum_operation:\n \"Object to calculate minima\"\n def __init__ (self):\n \"\"\"minimum(a, b) or minimum(a)\n In one argument case returns the scalar minimum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amin(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amin(ac.raw_data())\n else:\n return where(less(a, b), a, b)[...]\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.minimum.reduce (t, axis))\n else:\n t = umath.minimum.reduce(filled(target, minimum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.minimum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nminimum = _minimum_operation ()\n\nclass _maximum_operation:\n \"Object to calculate maxima\"\n def __init__ (self):\n \"\"\"maximum(a, b) or maximum(a)\n In one argument case returns the scalar maximum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amax(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amax(ac.raw_data())\n else:\n return where(greater(a, b), a, b)[...]\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.maximum.reduce (t, axis))\n else:\n t = umath.maximum.reduce(filled(target, maximum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.maximum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nmaximum = _maximum_operation ()\n\ndef sort (x, axis = -1, fill_value=None):\n \"\"\"If x does not have a mask, return a masked array formed from the\n result of numeric.sort(x, axis).\n Otherwise, fill x with fill_value. Sort it.\n Set a mask where the result is equal to fill_value.\n Note that this may have unintended consequences if the data contains the\n fill value at a non-masked site.\n\n If fill_value is not given the default fill value for x's type will be\n used.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n d = filled(x, fill_value)\n s = oldnumeric.sort(d, axis)\n if getmask(x) is None:\n return masked_array(s)\n return masked_values(s, fill_value, copy=0)\n\ndef diagonal(a, k = 0, axis1=0, axis2=1):\n \"\"\"diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a\"\"\"\n d = oldnumeric.diagonal(filled(a), k, axis1, axis2)\n m = getmask(a)\n if m is None:\n return masked_array(d, m)\n else:\n return masked_array(d, oldnumeric.diagonal(m, k, axis1, axis2))\n\ndef argsort (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for sorting along given axis.\n if fill_value is None, use get_fill_value(x)\n Returns a numpy array.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argsort(d, axis)\n\ndef argmin (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return indices for minimum values along given axis.\n if fill_value is None, use get_fill_value(x).\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argmin(d, axis)\n\ndef argmax (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for maximum along given axis.\n if fill_value is None, use -get_fill_value(x) if it exists.\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n try:\n fill_value = - fill_value\n except:\n pass\n d = filled(x, fill_value)\n return oldnumeric.argmax(d, axis)\n\ndef fromfunction (f, s):\n \"\"\"apply f to s to create array as in umath.\"\"\"\n return masked_array(numeric.fromfunction(f,s))\n\ndef asarray(data, dtype=None):\n \"\"\"asarray(data, dtype) = array(data, dtype, copy=0)\n \"\"\"\n if isinstance(data, MaskedArray) and \\\n (dtype is None or dtype == data.dtype):\n return data\n return array(data, dtype=dtype, copy=0)\n\nmasked = MaskedArray([0], int, mask=[1])[0:0]\nmasked = masked[0:0]\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self , args = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "args" + ], + "start_line": 24, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , display )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "display" + ], + "start_line": 34, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "display", + "long_name": "display( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "set_display", + "long_name": "set_display( self , s )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "s" + ], + "start_line": 43, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enabled", + "long_name": "enabled( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enable", + "long_name": "enable( self , flag = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "flag" + ], + "start_line": 51, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "default_fill_value", + "long_name": "default_fill_value( obj )", + "filename": "ma.py", + "nloc": 25, + "complexity": 13, + "token_count": 144, + "parameters": [ + "obj" + ], + "start_line": 68, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "minimum_fill_value", + "long_name": "minimum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 105, + "parameters": [ + "obj" + ], + "start_line": 94, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "maximum_fill_value", + "long_name": "maximum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 103, + "parameters": [ + "obj" + ], + "start_line": 111, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( a , fill_value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 2, + "token_count": 20, + "parameters": [ + "a", + "fill_value" + ], + "start_line": 128, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getmask", + "long_name": "getmask( a )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 24, + "parameters": [ + "a" + ], + "start_line": 133, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "getmaskarray", + "long_name": "getmaskarray( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 142, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "is_mask", + "long_name": "is_mask( m )", + "filename": "ma.py", + "nloc": 6, + "complexity": 4, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 153, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "make_mask", + "long_name": "make_mask( m , copy = 0 , flag = 0 )", + "filename": "ma.py", + "nloc": 17, + "complexity": 7, + "token_count": 107, + "parameters": [ + "m", + "copy", + "flag" + ], + "start_line": 162, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "make_mask_none", + "long_name": "make_mask_none( s )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "s" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "mask_or", + "long_name": "mask_or( m1 , m2 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 5, + "token_count": 52, + "parameters": [ + "m1", + "m2" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "filled", + "long_name": "filled( a , value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 5, + "token_count": 70, + "parameters": [ + "a", + "value" + ], + "start_line": 202, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "get_fill_value", + "long_name": "get_fill_value( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 222, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "common_fill_value", + "long_name": "common_fill_value( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a", + "b" + ], + "start_line": 233, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , y1 , y2 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "y1", + "y2" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "x" + ], + "start_line": 248, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , eps )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "eps" + ], + "start_line": 256, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "x" + ], + "start_line": 260, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , aufunc , fill = 0 , domain = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "aufunc", + "fill", + "domain" + ], + "start_line": 285, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 16, + "complexity": 5, + "token_count": 112, + "parameters": [ + "self", + "a", + "args", + "kwargs" + ], + "start_line": 296, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 314, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , tolerance = divide_tolerance )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "tolerance" + ], + "start_line": 319, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 321, + "end_line": 322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , domain , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self", + "abfunc", + "domain", + "fillx", + "filly" + ], + "start_line": 328, + "end_line": 336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 147, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 338, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 361, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "abfunc", + "fillx", + "filly" + ], + "start_line": 365, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 113, + "parameters": [ + "self", + "a", + "b", + "args", + "kwargs" + ], + "start_line": 374, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 20, + "complexity": 6, + "token_count": 157, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 390, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 412, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "accumulate", + "long_name": "accumulate( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 425, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 430, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "rank", + "long_name": "rank( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 492, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "shape", + "long_name": "shape( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 495, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "size", + "long_name": "size( object , axis = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "object", + "axis" + ], + "start_line": 498, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , data , dtype = None , copy = True , fortran = False , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 56, + "complexity": 18, + "token_count": 379, + "parameters": [ + "self", + "data", + "dtype", + "copy", + "fortran", + "mask", + "fill_value" + ], + "start_line": 529, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 67, + "parameters": [ + "self", + "t" + ], + "start_line": 593, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "_get_shape", + "long_name": "_get_shape( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 610, + "end_line": 612, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_set_shape", + "long_name": "_set_shape( self , newshape )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "newshape" + ], + "start_line": 614, + "end_line": 619, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "_get_flat", + "long_name": "_get_flat( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 621, + "end_line": 630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "_set_flat", + "long_name": "_set_flat( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "value" + ], + "start_line": 632, + "end_line": 635, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_real", + "long_name": "_get_real( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 637, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_real", + "long_name": "_set_real( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 646, + "end_line": 649, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_imaginary", + "long_name": "_get_imaginary( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 651, + "end_line": 658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_imaginary", + "long_name": "_set_imaginary( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 660, + "end_line": 663, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 665, + "end_line": 674, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "ma.py", + "nloc": 42, + "complexity": 5, + "token_count": 207, + "parameters": [ + "self" + ], + "start_line": 676, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "__float__", + "long_name": "__float__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 723, + "end_line": 728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__int__", + "long_name": "__int__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 730, + "end_line": 735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , i )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 70, + "parameters": [ + "self", + "i" + ], + "start_line": 737, + "end_line": 751, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 68, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 753, + "end_line": 761, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , index , value )", + "filename": "ma.py", + "nloc": 27, + "complexity": 7, + "token_count": 157, + "parameters": [ + "self", + "index", + "value" + ], + "start_line": 768, + "end_line": 794, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__setslice__", + "long_name": "__setslice__( self , i , j , value )", + "filename": "ma.py", + "nloc": 23, + "complexity": 7, + "token_count": 155, + "parameters": [ + "self", + "i", + "j", + "value" + ], + "start_line": 796, + "end_line": 818, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "__nonzero__", + "long_name": "__nonzero__( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 820, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 832, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__and__", + "long_name": "__and__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 837, + "end_line": 839, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__or__", + "long_name": "__or__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 841, + "end_line": 843, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__xor__", + "long_name": "__xor__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 845, + "end_line": 847, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__abs__", + "long_name": "__abs__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 853, + "end_line": 855, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__neg__", + "long_name": "__neg__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 857, + "end_line": 859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pos__", + "long_name": "__pos__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 861, + "end_line": 863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 865, + "end_line": 867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mod__", + "long_name": "__mod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 871, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rmod__", + "long_name": "__rmod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__lshift__", + "long_name": "__lshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 879, + "end_line": 880, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__rshift__", + "long_name": "__rshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 882, + "end_line": 883, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 885, + "end_line": 887, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 889, + "end_line": 891, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 893, + "end_line": 895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 899, + "end_line": 901, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 903, + "end_line": 905, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__truediv__", + "long_name": "__truediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 907, + "end_line": 909, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rtruediv__", + "long_name": "__rtruediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 911, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__floordiv__", + "long_name": "__floordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 915, + "end_line": 917, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rfloordiv__", + "long_name": "__rfloordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 919, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other , third = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "other", + "third" + ], + "start_line": 923, + "end_line": 925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__sqrt__", + "long_name": "__sqrt__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 927, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__iadd__", + "long_name": "__iadd__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 931, + "end_line": 972, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 251, + "parameters": [ + "self", + "other" + ], + "start_line": 974, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__isub__", + "long_name": "__isub__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 1017, + "end_line": 1058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__idiv__", + "long_name": "__idiv__( self , other )", + "filename": "ma.py", + "nloc": 38, + "complexity": 12, + "token_count": 233, + "parameters": [ + "self", + "other" + ], + "start_line": 1062, + "end_line": 1099, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "__eq__", + "long_name": "__eq__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1101, + "end_line": 1102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ne__", + "long_name": "__ne__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1104, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__lt__", + "long_name": "__lt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1107, + "end_line": 1108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__le__", + "long_name": "__le__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1110, + "end_line": 1111, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__gt__", + "long_name": "__gt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1113, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ge__", + "long_name": "__ge__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1116, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "astype", + "long_name": "astype( self , tc )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "tc" + ], + "start_line": 1119, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "byte_swapped", + "long_name": "byte_swapped( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 1124, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "compressed", + "long_name": "compressed( self )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 1130, + "end_line": 1138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "count", + "long_name": "count( self , axis = None )", + "filename": "ma.py", + "nloc": 29, + "complexity": 7, + "token_count": 173, + "parameters": [ + "self", + "axis" + ], + "start_line": 1140, + "end_line": 1168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "dot", + "long_name": "dot( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1170, + "end_line": 1172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "fill_value", + "long_name": "fill_value( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1174, + "end_line": 1176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "filled", + "long_name": "filled( self , fill_value = None )", + "filename": "ma.py", + "nloc": 24, + "complexity": 6, + "token_count": 147, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1178, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "ids", + "long_name": "ids( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 1212, + "end_line": 1214, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "iscontiguous", + "long_name": "iscontiguous( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 1216, + "end_line": 1218, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "itemsize", + "long_name": "itemsize( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 1220, + "end_line": 1222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1225, + "end_line": 1227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "put", + "long_name": "put( self , values )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self", + "values" + ], + "start_line": 1229, + "end_line": 1239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "putmask", + "long_name": "putmask( self , values )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "values" + ], + "start_line": 1241, + "end_line": 1249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "ravel", + "long_name": "ravel( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 1251, + "end_line": 1256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "raw_data", + "long_name": "raw_data( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1258, + "end_line": 1262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "raw_mask", + "long_name": "raw_mask( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1266, + "end_line": 1270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "reshape", + "long_name": "reshape( self , * s )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self", + "s" + ], + "start_line": 1274, + "end_line": 1281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( self , v = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "v" + ], + "start_line": 1283, + "end_line": 1287, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "_get_size", + "long_name": "_get_size( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1289, + "end_line": 1290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtypechar", + "long_name": "_get_dtypechar( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1294, + "end_line": 1295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtype", + "long_name": "_get_dtype( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1298, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "item", + "long_name": "item( self )", + "filename": "ma.py", + "nloc": 10, + "complexity": 4, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 1302, + "end_line": 1311, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1313, + "end_line": 1315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "tostring", + "long_name": "tostring( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1317, + "end_line": 1319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unmask", + "long_name": "unmask( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 1321, + "end_line": 1327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "unshare_mask", + "long_name": "unshare_mask( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 1329, + "end_line": 1333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "isMaskedArray", + "long_name": "isMaskedArray( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "x" + ], + "start_line": 1353, + "end_line": 1355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "allclose", + "long_name": "allclose( a , b , fill_value = 1 , rtol = 1 . e - 5 , atol = 1 . e - 8 )", + "filename": "ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 140, + "parameters": [ + "a", + "b", + "fill_value", + "rtol", + "atol" + ], + "start_line": 1360, + "end_line": 1375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "allequal", + "long_name": "allequal( a , b , fill_value = 1 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 3, + "token_count": 125, + "parameters": [ + "a", + "b", + "fill_value" + ], + "start_line": 1377, + "end_line": 1395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "masked_values", + "long_name": "masked_values( data , value , rtol = 1 . e - 5 , atol = 1 . e - 8 , copy = 1 )", + "filename": "ma.py", + "nloc": 10, + "complexity": 2, + "token_count": 115, + "parameters": [ + "data", + "value", + "rtol", + "atol", + "copy" + ], + "start_line": 1397, + "end_line": 1416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "masked_object", + "long_name": "masked_object( data , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "data", + "value", + "copy" + ], + "start_line": 1418, + "end_line": 1422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arrayrange", + "long_name": "arrayrange( start , stop = None , step = 1 , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 1424, + "end_line": 1428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fromstring", + "long_name": "fromstring( s , t )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "s", + "t" + ], + "start_line": 1432, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "left_shift", + "long_name": "left_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1436, + "end_line": 1444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "right_shift", + "long_name": "right_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1446, + "end_line": 1454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "resize", + "long_name": "resize( a , new_shape )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "new_shape" + ], + "start_line": 1456, + "end_line": 1464, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "repeat", + "long_name": "repeat( a , repeats , axis = 0 )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 101, + "parameters": [ + "a", + "repeats", + "axis" + ], + "start_line": 1466, + "end_line": 1481, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "identity", + "long_name": "identity( n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "n" + ], + "start_line": 1483, + "end_line": 1486, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "indices", + "long_name": "indices( dimensions , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "dimensions", + "dtype" + ], + "start_line": 1488, + "end_line": 1492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "zeros", + "long_name": "zeros( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1494, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "ones", + "long_name": "ones( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1499, + "end_line": 1502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "count", + "long_name": "count( a , axis = None )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a", + "axis" + ], + "start_line": 1505, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( a , b , third = None )", + "filename": "ma.py", + "nloc": 18, + "complexity": 4, + "token_count": 152, + "parameters": [ + "a", + "b", + "third" + ], + "start_line": 1510, + "end_line": 1527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "masked_array", + "long_name": "masked_array( a , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "mask", + "fill_value" + ], + "start_line": 1529, + "end_line": 1533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = 0 )", + "filename": "ma.py", + "nloc": 92, + "complexity": 22, + "token_count": 741, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 1538, + "end_line": 1645, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "where", + "long_name": "where( condition , x , y )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 149, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 1647, + "end_line": 1673, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "choose.fmask", + "long_name": "choose.fmask( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "x" + ], + "start_line": 1677, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "choose.nmask", + "long_name": "choose.nmask( x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 3, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 1680, + "end_line": 1684, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "choose", + "long_name": "choose( indices , t )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 93, + "parameters": [ + "indices", + "t" + ], + "start_line": 1675, + "end_line": 1691, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "masked_where", + "long_name": "masked_where( condition , x , copy = 1 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 47, + "parameters": [ + "condition", + "x", + "copy" + ], + "start_line": 1693, + "end_line": 1699, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "masked_greater", + "long_name": "masked_greater( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1701, + "end_line": 1703, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_greater_equal", + "long_name": "masked_greater_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1705, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less", + "long_name": "masked_less( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1709, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less_equal", + "long_name": "masked_less_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1713, + "end_line": 1715, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_not_equal", + "long_name": "masked_not_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1717, + "end_line": 1722, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "masked_equal", + "long_name": "masked_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1724, + "end_line": 1731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "masked_inside", + "long_name": "masked_inside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1733, + "end_line": 1744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "masked_outside", + "long_name": "masked_outside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1746, + "end_line": 1757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "reshape", + "long_name": "reshape( a , * newshape )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "newshape" + ], + "start_line": 1759, + "end_line": 1766, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "ravel", + "long_name": "ravel( a )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a" + ], + "start_line": 1768, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "concatenate", + "long_name": "concatenate( arrays , axis = 0 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 5, + "token_count": 97, + "parameters": [ + "arrays", + "axis" + ], + "start_line": 1777, + "end_line": 1791, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "take", + "long_name": "take( a , indices , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "indices", + "axis" + ], + "start_line": 1793, + "end_line": 1801, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "transpose", + "long_name": "transpose( a , axes = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 64, + "parameters": [ + "a", + "axes" + ], + "start_line": 1803, + "end_line": 1811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "put", + "long_name": "put( a , indices , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 70, + "parameters": [ + "a", + "indices", + "values" + ], + "start_line": 1814, + "end_line": 1827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "putmask", + "long_name": "putmask( a , mask , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 61, + "parameters": [ + "a", + "mask", + "values" + ], + "start_line": 1829, + "end_line": 1837, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "innerproduct", + "long_name": "innerproduct( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 3, + "token_count": 72, + "parameters": [ + "a", + "b" + ], + "start_line": 1839, + "end_line": 1849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "outerproduct", + "long_name": "outerproduct( a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 110, + "parameters": [ + "a", + "b" + ], + "start_line": 1851, + "end_line": 1863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dot", + "long_name": "dot( a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 36, + "parameters": [ + "a", + "b" + ], + "start_line": 1865, + "end_line": 1870, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "compress", + "long_name": "compress( condition , x , dimension = - 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 67, + "parameters": [ + "condition", + "x", + "dimension" + ], + "start_line": 1872, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1885, + "end_line": 1889, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1891, + "end_line": 1904, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1906, + "end_line": 1915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1917, + "end_line": 1928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1934, + "end_line": 1938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1940, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1955, + "end_line": 1964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1966, + "end_line": 1977, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "sort", + "long_name": "sort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 8, + "complexity": 3, + "token_count": 68, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 1981, + "end_line": 1998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "diagonal", + "long_name": "diagonal( a , k = 0 , axis1 = 0 , axis2 = 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 73, + "parameters": [ + "a", + "k", + "axis1", + "axis2" + ], + "start_line": 2000, + "end_line": 2007, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argsort", + "long_name": "argsort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2009, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argmin", + "long_name": "argmin( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2018, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "argmax", + "long_name": "argmax( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2028, + "end_line": 2042, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "fromfunction", + "long_name": "fromfunction( f , s )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "f", + "s" + ], + "start_line": 2044, + "end_line": 2046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "asarray", + "long_name": "asarray( data , dtype = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 46, + "parameters": [ + "data", + "dtype" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self , args = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "args" + ], + "start_line": 24, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , display )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "display" + ], + "start_line": 34, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "display", + "long_name": "display( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "set_display", + "long_name": "set_display( self , s )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "s" + ], + "start_line": 43, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enabled", + "long_name": "enabled( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enable", + "long_name": "enable( self , flag = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "flag" + ], + "start_line": 51, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "default_fill_value", + "long_name": "default_fill_value( obj )", + "filename": "ma.py", + "nloc": 25, + "complexity": 13, + "token_count": 144, + "parameters": [ + "obj" + ], + "start_line": 68, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "minimum_fill_value", + "long_name": "minimum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 105, + "parameters": [ + "obj" + ], + "start_line": 94, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "maximum_fill_value", + "long_name": "maximum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 103, + "parameters": [ + "obj" + ], + "start_line": 111, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( a , fill_value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 2, + "token_count": 20, + "parameters": [ + "a", + "fill_value" + ], + "start_line": 128, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getmask", + "long_name": "getmask( a )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 24, + "parameters": [ + "a" + ], + "start_line": 133, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "getmaskarray", + "long_name": "getmaskarray( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 142, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "is_mask", + "long_name": "is_mask( m )", + "filename": "ma.py", + "nloc": 6, + "complexity": 4, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 153, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "make_mask", + "long_name": "make_mask( m , copy = 0 , flag = 0 )", + "filename": "ma.py", + "nloc": 17, + "complexity": 7, + "token_count": 107, + "parameters": [ + "m", + "copy", + "flag" + ], + "start_line": 162, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "make_mask_none", + "long_name": "make_mask_none( s )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "s" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "mask_or", + "long_name": "mask_or( m1 , m2 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 5, + "token_count": 52, + "parameters": [ + "m1", + "m2" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "filled", + "long_name": "filled( a , value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 5, + "token_count": 70, + "parameters": [ + "a", + "value" + ], + "start_line": 202, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "get_fill_value", + "long_name": "get_fill_value( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 222, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "common_fill_value", + "long_name": "common_fill_value( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a", + "b" + ], + "start_line": 233, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , y1 , y2 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "y1", + "y2" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "x" + ], + "start_line": 248, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , eps )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "eps" + ], + "start_line": 256, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "x" + ], + "start_line": 260, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , aufunc , fill = 0 , domain = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "aufunc", + "fill", + "domain" + ], + "start_line": 285, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 21, + "complexity": 6, + "token_count": 145, + "parameters": [ + "self", + "a", + "args", + "kwargs" + ], + "start_line": 296, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 319, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , tolerance = divide_tolerance )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "tolerance" + ], + "start_line": 324, + "end_line": 325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 326, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , domain , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self", + "abfunc", + "domain", + "fillx", + "filly" + ], + "start_line": 333, + "end_line": 341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 26, + "complexity": 7, + "token_count": 182, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 343, + "end_line": 369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 370, + "end_line": 371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "abfunc", + "fillx", + "filly" + ], + "start_line": 374, + "end_line": 381, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 22, + "complexity": 6, + "token_count": 174, + "parameters": [ + "self", + "a", + "b", + "args", + "kwargs" + ], + "start_line": 383, + "end_line": 404, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 20, + "complexity": 6, + "token_count": 157, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 406, + "end_line": 426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 428, + "end_line": 439, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "accumulate", + "long_name": "accumulate( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 441, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 445, + "end_line": 446, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "rank", + "long_name": "rank( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 508, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "shape", + "long_name": "shape( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 511, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "size", + "long_name": "size( object , axis = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "object", + "axis" + ], + "start_line": 514, + "end_line": 515, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , data , dtype = None , copy = True , fortran = False , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 56, + "complexity": 18, + "token_count": 379, + "parameters": [ + "self", + "data", + "dtype", + "copy", + "fortran", + "mask", + "fill_value" + ], + "start_line": 545, + "end_line": 607, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 67, + "parameters": [ + "self", + "t" + ], + "start_line": 609, + "end_line": 624, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "_get_shape", + "long_name": "_get_shape( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 626, + "end_line": 628, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_set_shape", + "long_name": "_set_shape( self , newshape )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "newshape" + ], + "start_line": 630, + "end_line": 635, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "_get_flat", + "long_name": "_get_flat( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 637, + "end_line": 646, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "_set_flat", + "long_name": "_set_flat( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "value" + ], + "start_line": 648, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_real", + "long_name": "_get_real( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 653, + "end_line": 660, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_real", + "long_name": "_set_real( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 662, + "end_line": 665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_imaginary", + "long_name": "_get_imaginary( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 667, + "end_line": 674, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_imaginary", + "long_name": "_set_imaginary( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 676, + "end_line": 679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 681, + "end_line": 690, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "ma.py", + "nloc": 42, + "complexity": 5, + "token_count": 207, + "parameters": [ + "self" + ], + "start_line": 692, + "end_line": 737, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "__float__", + "long_name": "__float__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 739, + "end_line": 744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__int__", + "long_name": "__int__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 746, + "end_line": 751, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , i )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 70, + "parameters": [ + "self", + "i" + ], + "start_line": 753, + "end_line": 767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 68, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 769, + "end_line": 777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , index , value )", + "filename": "ma.py", + "nloc": 27, + "complexity": 7, + "token_count": 157, + "parameters": [ + "self", + "index", + "value" + ], + "start_line": 784, + "end_line": 810, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__setslice__", + "long_name": "__setslice__( self , i , j , value )", + "filename": "ma.py", + "nloc": 23, + "complexity": 7, + "token_count": 155, + "parameters": [ + "self", + "i", + "j", + "value" + ], + "start_line": 812, + "end_line": 834, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 836, + "end_line": 839, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__and__", + "long_name": "__and__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 841, + "end_line": 843, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__or__", + "long_name": "__or__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 845, + "end_line": 847, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__xor__", + "long_name": "__xor__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 849, + "end_line": 851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__abs__", + "long_name": "__abs__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 857, + "end_line": 859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__neg__", + "long_name": "__neg__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 861, + "end_line": 863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pos__", + "long_name": "__pos__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 865, + "end_line": 867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 869, + "end_line": 871, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mod__", + "long_name": "__mod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rmod__", + "long_name": "__rmod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 879, + "end_line": 881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__lshift__", + "long_name": "__lshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 883, + "end_line": 884, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__rshift__", + "long_name": "__rshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 886, + "end_line": 887, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 889, + "end_line": 891, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 893, + "end_line": 895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 897, + "end_line": 899, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 903, + "end_line": 905, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 907, + "end_line": 909, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__truediv__", + "long_name": "__truediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 911, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rtruediv__", + "long_name": "__rtruediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 915, + "end_line": 917, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__floordiv__", + "long_name": "__floordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 919, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rfloordiv__", + "long_name": "__rfloordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 923, + "end_line": 925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other , third = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "other", + "third" + ], + "start_line": 927, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__sqrt__", + "long_name": "__sqrt__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 931, + "end_line": 933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__iadd__", + "long_name": "__iadd__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 935, + "end_line": 976, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 251, + "parameters": [ + "self", + "other" + ], + "start_line": 978, + "end_line": 1019, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__isub__", + "long_name": "__isub__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 1021, + "end_line": 1062, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__idiv__", + "long_name": "__idiv__( self , other )", + "filename": "ma.py", + "nloc": 38, + "complexity": 12, + "token_count": 233, + "parameters": [ + "self", + "other" + ], + "start_line": 1066, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "__eq__", + "long_name": "__eq__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1105, + "end_line": 1106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ne__", + "long_name": "__ne__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1108, + "end_line": 1109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__lt__", + "long_name": "__lt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1111, + "end_line": 1112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__le__", + "long_name": "__le__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1114, + "end_line": 1115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__gt__", + "long_name": "__gt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1117, + "end_line": 1118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ge__", + "long_name": "__ge__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1120, + "end_line": 1121, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "astype", + "long_name": "astype( self , tc )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "tc" + ], + "start_line": 1123, + "end_line": 1126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "byte_swapped", + "long_name": "byte_swapped( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 1128, + "end_line": 1132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "compressed", + "long_name": "compressed( self )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 1134, + "end_line": 1142, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "count", + "long_name": "count( self , axis = None )", + "filename": "ma.py", + "nloc": 29, + "complexity": 7, + "token_count": 173, + "parameters": [ + "self", + "axis" + ], + "start_line": 1144, + "end_line": 1172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "dot", + "long_name": "dot( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1174, + "end_line": 1176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "fill_value", + "long_name": "fill_value( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1178, + "end_line": 1180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "filled", + "long_name": "filled( self , fill_value = None )", + "filename": "ma.py", + "nloc": 24, + "complexity": 6, + "token_count": 147, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1182, + "end_line": 1214, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "ids", + "long_name": "ids( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 1216, + "end_line": 1218, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "iscontiguous", + "long_name": "iscontiguous( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 1220, + "end_line": 1222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "itemsize", + "long_name": "itemsize( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 1224, + "end_line": 1226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1229, + "end_line": 1231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "put", + "long_name": "put( self , values )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self", + "values" + ], + "start_line": 1233, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "putmask", + "long_name": "putmask( self , values )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "values" + ], + "start_line": 1245, + "end_line": 1253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "ravel", + "long_name": "ravel( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 1255, + "end_line": 1260, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "raw_data", + "long_name": "raw_data( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1262, + "end_line": 1266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "raw_mask", + "long_name": "raw_mask( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1270, + "end_line": 1274, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "reshape", + "long_name": "reshape( self , * s )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self", + "s" + ], + "start_line": 1278, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( self , v = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "v" + ], + "start_line": 1287, + "end_line": 1291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "_get_size", + "long_name": "_get_size( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1293, + "end_line": 1294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtypechar", + "long_name": "_get_dtypechar( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1298, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtype", + "long_name": "_get_dtype( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1302, + "end_line": 1303, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "item", + "long_name": "item( self )", + "filename": "ma.py", + "nloc": 10, + "complexity": 4, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 1306, + "end_line": 1315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1317, + "end_line": 1319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "tostring", + "long_name": "tostring( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1321, + "end_line": 1323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unmask", + "long_name": "unmask( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 1325, + "end_line": 1331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "unshare_mask", + "long_name": "unshare_mask( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 1333, + "end_line": 1337, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "isMaskedArray", + "long_name": "isMaskedArray( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "x" + ], + "start_line": 1357, + "end_line": 1359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "allclose", + "long_name": "allclose( a , b , fill_value = 1 , rtol = 1 . e - 5 , atol = 1 . e - 8 )", + "filename": "ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 140, + "parameters": [ + "a", + "b", + "fill_value", + "rtol", + "atol" + ], + "start_line": 1364, + "end_line": 1379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "allequal", + "long_name": "allequal( a , b , fill_value = 1 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 3, + "token_count": 125, + "parameters": [ + "a", + "b", + "fill_value" + ], + "start_line": 1381, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "masked_values", + "long_name": "masked_values( data , value , rtol = 1 . e - 5 , atol = 1 . e - 8 , copy = 1 )", + "filename": "ma.py", + "nloc": 10, + "complexity": 2, + "token_count": 115, + "parameters": [ + "data", + "value", + "rtol", + "atol", + "copy" + ], + "start_line": 1401, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "masked_object", + "long_name": "masked_object( data , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "data", + "value", + "copy" + ], + "start_line": 1422, + "end_line": 1426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arrayrange", + "long_name": "arrayrange( start , stop = None , step = 1 , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 1428, + "end_line": 1432, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fromstring", + "long_name": "fromstring( s , t )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "s", + "t" + ], + "start_line": 1436, + "end_line": 1438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "left_shift", + "long_name": "left_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1440, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "right_shift", + "long_name": "right_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1450, + "end_line": 1458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "resize", + "long_name": "resize( a , new_shape )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "new_shape" + ], + "start_line": 1460, + "end_line": 1468, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "repeat", + "long_name": "repeat( a , repeats , axis = 0 )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 101, + "parameters": [ + "a", + "repeats", + "axis" + ], + "start_line": 1470, + "end_line": 1485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "identity", + "long_name": "identity( n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "n" + ], + "start_line": 1487, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "indices", + "long_name": "indices( dimensions , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "dimensions", + "dtype" + ], + "start_line": 1492, + "end_line": 1496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "zeros", + "long_name": "zeros( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1498, + "end_line": 1501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "ones", + "long_name": "ones( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1503, + "end_line": 1506, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "count", + "long_name": "count( a , axis = None )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a", + "axis" + ], + "start_line": 1509, + "end_line": 1512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( a , b , third = None )", + "filename": "ma.py", + "nloc": 18, + "complexity": 4, + "token_count": 152, + "parameters": [ + "a", + "b", + "third" + ], + "start_line": 1514, + "end_line": 1531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "masked_array", + "long_name": "masked_array( a , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "mask", + "fill_value" + ], + "start_line": 1533, + "end_line": 1537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = 0 )", + "filename": "ma.py", + "nloc": 92, + "complexity": 22, + "token_count": 741, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 1542, + "end_line": 1649, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "where", + "long_name": "where( condition , x , y )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 149, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 1651, + "end_line": 1677, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "choose.fmask", + "long_name": "choose.fmask( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "x" + ], + "start_line": 1681, + "end_line": 1683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "choose.nmask", + "long_name": "choose.nmask( x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 3, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 1684, + "end_line": 1688, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "choose", + "long_name": "choose( indices , t )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 93, + "parameters": [ + "indices", + "t" + ], + "start_line": 1679, + "end_line": 1695, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "masked_where", + "long_name": "masked_where( condition , x , copy = 1 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 47, + "parameters": [ + "condition", + "x", + "copy" + ], + "start_line": 1697, + "end_line": 1703, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "masked_greater", + "long_name": "masked_greater( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1705, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_greater_equal", + "long_name": "masked_greater_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1709, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less", + "long_name": "masked_less( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1713, + "end_line": 1715, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less_equal", + "long_name": "masked_less_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1717, + "end_line": 1719, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_not_equal", + "long_name": "masked_not_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1721, + "end_line": 1726, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "masked_equal", + "long_name": "masked_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1728, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "masked_inside", + "long_name": "masked_inside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1737, + "end_line": 1748, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "masked_outside", + "long_name": "masked_outside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1750, + "end_line": 1761, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "reshape", + "long_name": "reshape( a , * newshape )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "newshape" + ], + "start_line": 1763, + "end_line": 1770, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "ravel", + "long_name": "ravel( a )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a" + ], + "start_line": 1772, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "concatenate", + "long_name": "concatenate( arrays , axis = 0 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 5, + "token_count": 97, + "parameters": [ + "arrays", + "axis" + ], + "start_line": 1781, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "take", + "long_name": "take( a , indices , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "indices", + "axis" + ], + "start_line": 1797, + "end_line": 1805, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "transpose", + "long_name": "transpose( a , axes = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 64, + "parameters": [ + "a", + "axes" + ], + "start_line": 1807, + "end_line": 1815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "put", + "long_name": "put( a , indices , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 70, + "parameters": [ + "a", + "indices", + "values" + ], + "start_line": 1818, + "end_line": 1831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "putmask", + "long_name": "putmask( a , mask , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 61, + "parameters": [ + "a", + "mask", + "values" + ], + "start_line": 1833, + "end_line": 1841, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "innerproduct", + "long_name": "innerproduct( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 3, + "token_count": 72, + "parameters": [ + "a", + "b" + ], + "start_line": 1843, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "outerproduct", + "long_name": "outerproduct( a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 110, + "parameters": [ + "a", + "b" + ], + "start_line": 1855, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dot", + "long_name": "dot( a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 36, + "parameters": [ + "a", + "b" + ], + "start_line": 1869, + "end_line": 1874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "compress", + "long_name": "compress( condition , x , dimension = - 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 67, + "parameters": [ + "condition", + "x", + "dimension" + ], + "start_line": 1876, + "end_line": 1885, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1889, + "end_line": 1893, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 90, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1895, + "end_line": 1908, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1910, + "end_line": 1919, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1921, + "end_line": 1932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1938, + "end_line": 1942, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 90, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1944, + "end_line": 1957, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1959, + "end_line": 1968, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1970, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "sort", + "long_name": "sort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 8, + "complexity": 3, + "token_count": 68, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 1985, + "end_line": 2002, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "diagonal", + "long_name": "diagonal( a , k = 0 , axis1 = 0 , axis2 = 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 73, + "parameters": [ + "a", + "k", + "axis1", + "axis2" + ], + "start_line": 2004, + "end_line": 2011, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argsort", + "long_name": "argsort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2013, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argmin", + "long_name": "argmin( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2022, + "end_line": 2030, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "argmax", + "long_name": "argmax( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2032, + "end_line": 2046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "fromfunction", + "long_name": "fromfunction( f , s )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "f", + "s" + ], + "start_line": 2048, + "end_line": 2050, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "asarray", + "long_name": "asarray( data , dtype = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 46, + "parameters": [ + "data", + "dtype" + ], + "start_line": 2052, + "end_line": 2058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 147, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 338, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1891, + "end_line": 1904, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 16, + "complexity": 5, + "token_count": 112, + "parameters": [ + "self", + "a", + "args", + "kwargs" + ], + "start_line": 296, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 113, + "parameters": [ + "self", + "a", + "b", + "args", + "kwargs" + ], + "start_line": 374, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__nonzero__", + "long_name": "__nonzero__( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 820, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "nloc": 1602, + "complexity": 446, + "token_count": 11100, + "diff_parsed": { + "added": [ + " result = self.f(d1, *args, **kwargs)", + " if m is not None:", + " try:", + " shape = result.shape", + " except AttributeError:", + " pass", + " if m.shape != shape:", + " m = mask_or(getmaskarray(a), getmaskarray(b))", + " return masked_array(result, m)", + " result = self.f(d1, d2)", + " if m is not None:", + " try:", + " shape = result.shape", + " except AttributeError:", + " pass", + " if m.shape != shape:", + " m = mask_or(getmaskarray(a), getmaskarray(b))", + " return masked_array(result, m)", + "", + " if m is not None:", + " try:", + " shape = result.shape", + " except AttributeError:", + " pass", + " else:", + " if m.shape != shape:", + " m = mask_or(getmaskarray(a), getmaskarray(b))", + " return masked_array(result, m)", + " def __nonzero__(self):", + " \"\"\"returns true if any element is non-zero or masked", + "", + " \"\"\"", + " # XXX: This changes bool conversion logic from MA.", + " # XXX: In MA bool(a) == len(a) != 0, but in scipy", + " # XXX: scalars do not have len", + " m = self._mask", + " d = self._data", + " return bool(m is not None and m.any()", + " or d is not None and d.any())", + "", + " return where(less(a, b), a, b)", + " return where(greater(a, b), a, b)" + ], + "deleted": [ + " if m is None:", + " result = self.f(d1, *args, **kwargs)", + " if type(result) is ndarray:", + " return masked_array (result)", + " else:", + " return result", + " else:", + " dx = masked_array(d1, m)", + " result = self.f(filled(dx, self.fill), *args, **kwargs)", + " if type(result) is ndarray:", + " return masked_array(result, m)", + " elif m[...]:", + " return masked", + " return result", + " if m is None:", + " result = self.f(d1, d2)", + " if type(result) is ndarray:", + " return masked_array(result)", + " return result", + " result = self.f(d1, d2)", + " if type(result) is ndarray:", + " if m.shape != result.shape:", + " m = mask_or(getmaskarray(a), getmaskarray(b))", + " return masked_array(result, m)", + " elif m[...]:", + " return masked", + " else:", + " return result", + " if m is None:", + " d1 = filled(a, self.fillx)", + " d2 = filled(b, self.filly)", + " result = self.f(d1, d2, *args, **kwargs)", + " if type(result) is ndarray:", + " return masked_array(result)", + " else:", + " return result", + " if type(result) is ndarray:", + " if m.shape != result.shape:", + " m = mask_or(getmaskarray(a), getmaskarray(b))", + " return masked_array(result, m)", + " elif m[...]:", + " return masked", + " else:", + " return result", + " return where(less(a, b), a, b)[...]", + " return where(greater(a, b), a, b)[...]" + ] + } + }, + { + "old_path": "numpy/core/tests/test_ma.py", + "new_path": "numpy/core/tests/test_ma.py", + "filename": "test_ma.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -581,7 +581,20 @@ def check_testToPython(self):\n self.assertEqual(1.0, float(array([[1]])))\n self.failUnlessRaises(ValueError, float, array([1,1]))\n self.failUnlessRaises(MAError, float, array([1],mask=[1]))\n- \n+ self.failUnless(bool(array([0,1])))\n+ self.failUnless(bool(array([0,0],mask=[0,1])))\n+ self.failIf(bool(array([0,0])))\n+ self.failIf(bool(array([0,0],mask=[0,0])))\n+\n+ def check_testScalarArithmetic(self):\n+ xm = array(0, mask=1)\n+ self.failUnless((1/array(0)).mask)\n+ self.failUnless((1 + xm).mask)\n+ self.failUnless((-xm).mask)\n+ self.failUnless((-xm).mask)\n+ self.failUnless(maximum(xm, xm).mask)\n+ self.failUnless(minimum(xm, xm).mask)\n+ \n def timingTest():\n for f in [testf, testinplace]:\n for n in [1000,10000,50000]:\n", + "added_lines": 14, + "deleted_lines": 1, + "source_code": "import numpy \nimport types, time\nfrom numpy.core.ma import *\nfrom numpy.testing import ScipyTestCase, ScipyTest\ndef eq(v,w):\n result = allclose(v,w)\n if not result:\n print \"\"\"Not eq:\n%s\n----\n%s\"\"\"% (str(v), str(w))\n return result\n\nclass test_ma(ScipyTestCase):\n def __init__(self, *args, **kwds):\n ScipyTestCase.__init__(self, *args, **kwds)\n self.setUp()\n \n def setUp (self):\n x=numpy.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])\n y=numpy.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])\n a10 = 10.\n m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]\n m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 ,0, 1]\n xm = array(x, mask=m1)\n ym = array(y, mask=m2)\n z = numpy.array([-.5, 0., .5, .8])\n zm = array(z, mask=[0,1,0,0])\n xf = numpy.where(m1, 1.e+20, x)\n s = x.shape\n xm.set_fill_value(1.e+20)\n self.d = (x, y, a10, m1, m2, xm, ym, z, zm, xf, s)\n\n def check_testBasic1d(self):\n \"Test of basic array creation and properties in 1 dimension.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failIf(isMaskedArray(x))\n self.failUnless(isMaskedArray(xm))\n self.assertEqual(shape(xm), s)\n self.assertEqual(xm.shape, s)\n self.assertEqual(xm.dtype, x.dtype)\n self.assertEqual(xm.dtypechar, x.dtypechar)\n self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))\n self.assertEqual(count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))\n self.failUnless(eq(xm, xf))\n self.failUnless(eq(filled(xm, 1.e20), xf))\n self.failUnless(eq(x, xm))\n\n def check_testBasic2d(self):\n \"Test of basic array creation and properties in 2 dimensions.\"\n for s in [(4,3), (6,2)]: \n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n x.shape = s\n y.shape = s\n xm.shape = s\n ym.shape = s\n xf.shape = s\n \n self.failIf(isMaskedArray(x))\n self.failUnless(isMaskedArray(xm))\n self.assertEqual(shape(xm), s)\n self.assertEqual(xm.shape, s)\n self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))\n self.assertEqual( count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))\n self.failUnless(eq(xm, xf))\n self.failUnless(eq(filled(xm, 1.e20), xf))\n self.failUnless(eq(x, xm))\n self.setUp()\n\n def check_testArithmetic (self):\n \"Test of basic arithmetic.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n a2d = array([[1,2],[0,4]])\n a2dm = masked_array(a2d, [[0,0],[1,0]])\n self.failUnless(eq (a2d * a2d, a2d * a2dm))\n self.failUnless(eq (a2d + a2d, a2d + a2dm))\n self.failUnless(eq (a2d - a2d, a2d - a2dm))\n for s in [(12,), (4,3), (2,6)]: \n x = x.reshape(s)\n y = y.reshape(s)\n xm = xm.reshape(s)\n ym = ym.reshape(s)\n xf = xf.reshape(s)\n self.failUnless(eq(-x, -xm))\n self.failUnless(eq(x + y, xm + ym))\n self.failUnless(eq(x - y, xm - ym))\n self.failUnless(eq(x * y, xm * ym))\n self.failUnless(eq(x / y, xm / ym))\n self.failUnless(eq(a10 + y, a10 + ym))\n self.failUnless(eq(a10 - y, a10 - ym))\n self.failUnless(eq(a10 * y, a10 * ym))\n self.failUnless(eq(a10 / y, a10 / ym))\n self.failUnless(eq(x + a10, xm + a10))\n self.failUnless(eq(x - a10, xm - a10))\n self.failUnless(eq(x * a10, xm * a10))\n self.failUnless(eq(x / a10, xm / a10))\n self.failUnless(eq(x**2, xm**2))\n self.failUnless(eq(abs(x)**2.5, abs(xm) **2.5))\n self.failUnless(eq(x**y, xm**ym))\n self.failUnless(eq(numpy.add(x,y), add(xm, ym)))\n self.failUnless(eq(numpy.subtract(x,y), subtract(xm, ym)))\n self.failUnless(eq(numpy.multiply(x,y), multiply(xm, ym)))\n self.failUnless(eq(numpy.divide(x,y), divide(xm, ym)))\n\n\n def check_testUfuncs1 (self):\n \"Test various functions such as sin, cos.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failUnless (eq(numpy.cos(x), cos(xm)))\n self.failUnless (eq(numpy.cosh(x), cosh(xm)))\n self.failUnless (eq(numpy.sin(x), sin(xm)))\n self.failUnless (eq(numpy.sinh(x), sinh(xm)))\n self.failUnless (eq(numpy.tan(x), tan(xm)))\n self.failUnless (eq(numpy.tanh(x), tanh(xm)))\n self.failUnless (eq(numpy.sqrt(abs(x)), sqrt(xm)))\n self.failUnless (eq(numpy.log(abs(x)), log(xm)))\n self.failUnless (eq(numpy.log10(abs(x)), log10(xm)))\n self.failUnless (eq(numpy.exp(x), exp(xm)))\n self.failUnless (eq(numpy.arcsin(z), arcsin(zm)))\n self.failUnless (eq(numpy.arccos(z), arccos(zm)))\n self.failUnless (eq(numpy.arctan(z), arctan(zm)))\n self.failUnless (eq(numpy.arctan2(x, y), arctan2(xm, ym)))\n self.failUnless (eq(numpy.absolute(x), absolute(xm)))\n self.failUnless (eq(numpy.equal(x,y), equal(xm, ym)))\n self.failUnless (eq(numpy.not_equal(x,y), not_equal(xm, ym)))\n self.failUnless (eq(numpy.less(x,y), less(xm, ym)))\n self.failUnless (eq(numpy.greater(x,y), greater(xm, ym)))\n self.failUnless (eq(numpy.less_equal(x,y), less_equal(xm, ym)))\n self.failUnless (eq(numpy.greater_equal(x,y), greater_equal(xm, ym)))\n self.failUnless (eq(numpy.conjugate(x), conjugate(xm)))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,ym))))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((x,y))))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,y))))\n self.failUnless (eq(numpy.concatenate((x,y,x)), concatenate((x,ym,x))))\n \n def check_xtestCount (self):\n \"Test count\"\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n self.failUnless( isinstance(count(ott), types.IntType))\n self.assertEqual(3, count(ott))\n self.assertEqual(1, count(1))\n self.failUnless (eq(0, array(1,mask=[1])))\n ott=ott.reshape((2,2))\n assert isMaskedArray(count(ott,0))\n assert isinstance(count(ott), types.IntType)\n self.failUnless (eq(3, count(ott)))\n assert getmask(count(ott,0)) is None\n self.failUnless (eq([1,2],count(ott,0)))\n \n def check_testMinMax (self):\n \"Test minimum and maximum.\" \n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n xr = numpy.ravel(x) #max doesn't work if shaped\n xmr = ravel(xm)\n self.failUnless (eq(max(xr), maximum(xmr))) #true because of careful selection of data\n self.failUnless (eq(min(xr), minimum(xmr))) #true because of careful selection of data\n\n def check_testAddSumProd (self):\n \"Test add, sum, product.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failUnless (eq(numpy.add.reduce(x), add.reduce(x)))\n self.failUnless (eq(numpy.add.accumulate(x), add.accumulate(x)))\n self.failUnless (eq(4, sum(array(4))))\n self.failUnless (eq(4, sum(array(4), axis=0)))\n self.failUnless (eq(numpy.sum(x), sum(x)))\n self.failUnless (eq(numpy.sum(filled(xm,0)), sum(xm)))\n self.failUnless (eq(numpy.sum(x,0), sum(x,0)))\n self.failUnless (eq(numpy.product(x), product(x)))\n self.failUnless (eq(numpy.product(x,0), product(x,0)))\n self.failUnless (eq(numpy.product(filled(xm,1)), product(xm)))\n if len(s) > 1:\n self.failUnless (eq(numpy.concatenate((x,y),1), concatenate((xm,ym),1)))\n self.failUnless (eq(numpy.add.reduce(x,1), add.reduce(x,1)))\n self.failUnless (eq(numpy.sum(x,1), sum(x,1)))\n self.failUnless (eq(numpy.product(x,1), product(x,1)))\n \n \n def check_testCI(self):\n \"Test of conversions and indexing\"\n x1 = numpy.array([1,2,4,3])\n x2 = array(x1, mask = [1,0,0,0])\n x3 = array(x1, mask = [0,1,0,1])\n x4 = array(x1)\n # test conversion to strings\n junk, garbage = str(x2), repr(x2)\n assert eq(numpy.sort(x1),sort(x2, fill_value=0))\n # tests of indexing\n assert type(x2[1]) is type(x1[1])\n assert x1[1] == x2[1]\n assert x2[0] is masked\n assert eq(x1[2],x2[2])\n assert eq(x1[2:5],x2[2:5])\n assert eq(x1[:],x2[:])\n assert eq(x1[1:], x3[1:])\n x1[2]=9\n x2[2]=9\n assert eq(x1,x2)\n x1[1:3] = 99\n x2[1:3] = 99\n assert eq(x1,x2)\n x2[1] = masked\n assert eq(x1,x2)\n x2[1:3]=masked\n assert eq(x1,x2)\n x2[:] = x1\n x2[1] = masked\n assert allequal(getmask(x2),array([0,1,0,0]))\n x3[:] = masked_array([1,2,3,4],[0,1,1,0])\n assert allequal(getmask(x3), array([0,1,1,0]))\n x4[:] = masked_array([1,2,3,4],[0,1,1,0])\n assert allequal(getmask(x4), array([0,1,1,0]))\n assert allequal(x4, array([1,2,3,4]))\n x1 = numpy.arange(5)*1.0\n x2 = masked_values(x1, 3.0)\n assert eq(x1,x2)\n assert allequal(array([0,0,0,1,0],MaskType), x2.mask)\n assert eq(3.0, x2.fill_value())\n x1 = array([1,'hello',2,3],object)\n x2 = numpy.array([1,'hello',2,3],object)\n s1 = x1[1].item()\n s2 = x2[1].item()\n self.assertEqual(type(s2), str)\n self.assertEqual(type(s1), str)\n self.assertEqual(s1, s2)\n assert x1[1:1].shape == (0,)\n \n def check_testCopySize(self):\n \"Tests of some subtle points of copying and sizing.\"\n n = [0,0,1,0,0]\n m = make_mask(n)\n m2 = make_mask(m)\n self.failUnless(m is m2)\n m3 = make_mask(m, copy=1)\n self.failUnless(m is not m3)\n \n x1 = numpy.arange(5)\n y1 = array(x1, mask=m)\n self.failUnless( y1.raw_data() is not x1)\n self.failUnless( allequal(x1,y1.raw_data()))\n self.failUnless( y1.mask is m)\n \n y1a = array(y1, copy=0)\n self.failUnless( y1a.raw_data() is y1.raw_data())\n self.failUnless( y1a.mask is y1.mask)\n \n y2 = array(x1, mask=m, copy=0)\n self.failUnless( y2.raw_data() is x1)\n self.failUnless( y2.mask is m)\n self.failUnless( y2[2] is masked)\n y2[2]=9\n self.failUnless( y2[2] is not masked)\n self.failUnless( y2.mask is not m)\n self.failUnless( allequal(y2.mask, 0))\n \n y3 = array(x1*1.0, mask=m)\n self.failUnless(filled(y3).dtype is (x1*1.0).dtype)\n \n x4 = arange(4)\n x4[2] = masked\n y4 = resize(x4, (8,))\n self.failUnless( eq(concatenate([x4,x4]), y4))\n self.failUnless( eq(getmask(y4),[0,0,1,0,0,0,1,0]))\n y5 = repeat(x4, (2,2,2,2))\n self.failUnless( eq(y5, [0,0,1,1,2,2,3,3]))\n y6 = repeat(x4, 2)\n self.failUnless( eq(y5, y6))\n \n def check_testPut(self):\n \"Test of put\"\n d = arange(5)\n n = [0,0,0,1,1]\n m = make_mask(n)\n x = array(d, mask = m)\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is masked)\n x[[1,4]] = [10,40]\n self.failUnless( x.mask is not m)\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is not masked)\n self.failUnless( eq(x, [0,10,2,-1,40]))\n \n x = array(d, mask = m) \n x.put([-1,100,200])\n self.failUnless( eq(x, [-1,100,200,0,0]))\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is masked)\n \n x = array(d, mask = m) \n x.putmask([30,40])\n self.failUnless( eq(x, [0,1,2,30,40]))\n self.failUnless( x.mask is None)\n \n x = array(d, mask = m) \n y = x.compressed()\n z = array(x, mask = m)\n z.put(y)\n assert eq (x, z)\n \n def check_testMaPut(self):\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]\n i = numpy.nonzero(m)\n putmask(xm, m, z)\n assert take(xm, i) == z\n put(ym, i, zm)\n assert take(ym, i) == zm\n \n def check_testOddFeatures(self):\n \"Test of other odd features\"\n x = arange(20); x=x.reshape(4,5)\n x.flat[5] = 12\n assert x[1,0] == 12\n z = x + 10j * x\n assert eq(z.real, x)\n assert eq(z.imag, 10*x)\n assert eq((z*conjugate(z)).real, 101*x*x)\n z.imag[...] = 0.0\n \n x = arange(10)\n x[3] = masked\n assert str(x[3]) == str(masked)\n c = x >= 8\n assert count(where(c,masked,masked)) == 0\n assert shape(where(c,masked,masked)) == c.shape\n z = where(c , x, masked)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is masked\n assert z[7] is masked\n assert z[8] is not masked\n assert z[9] is not masked\n assert eq(x,z)\n z = where(c , masked, x)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is not masked\n assert z[7] is not masked\n assert z[8] is masked\n assert z[9] is masked\n z = masked_where(c, x)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is not masked\n assert z[7] is not masked\n assert z[8] is masked\n assert z[9] is masked\n assert eq(x,z)\n x = array([1.,2.,3.,4.,5.])\n c = array([1,1,1,0,0])\n x[2] = masked\n z = where(c, x, -x)\n assert eq(z, [1.,2.,0., -4., -5])\n c[0] = masked\n z = where(c, x, -x)\n assert eq(z, [1.,2.,0., -4., -5])\n assert z[0] is masked\n assert z[1] is not masked\n assert z[2] is masked\n assert eq(masked_where(greater(x, 2), x), masked_greater(x,2))\n assert eq(masked_where(greater_equal(x, 2), x), masked_greater_equal(x,2))\n assert eq(masked_where(less(x, 2), x), masked_less(x,2))\n assert eq(masked_where(less_equal(x, 2), x), masked_less_equal(x,2))\n assert eq(masked_where(not_equal(x, 2), x), masked_not_equal(x,2))\n assert eq(masked_where(equal(x, 2), x), masked_equal(x,2))\n assert eq(masked_where(not_equal(x,2), x), masked_not_equal(x,2))\n assert eq(masked_inside(range(5), 1, 3), [0, 199, 199, 199, 4])\n assert eq(masked_outside(range(5), 1, 3),[199,1,2,3,199])\n assert eq(masked_inside(array(range(5), mask=[1,0,0,0,0]), 1, 3).mask, [1,1,1,1,0])\n assert eq(masked_outside(array(range(5), mask=[0,1,0,0,0]), 1, 3).mask, [1,1,0,0,1])\n assert eq(masked_equal(array(range(5), mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,0])\n assert eq(masked_not_equal(array([2,2,1,2,1], mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,1])\n assert eq(masked_where([1,1,0,0,0], [1,2,3,4,5]), [99,99,3,4,5])\n atest = ones((10,10,10), dtype=float32)\n btest = zeros(atest.shape, MaskType)\n ctest = masked_where(btest,atest)\n assert eq(atest,ctest)\n z = choose(c, (-x, x))\n assert eq(z, [1.,2.,0., -4., -5])\n assert z[0] is masked\n assert z[1] is not masked\n assert z[2] is masked\n x = arange(6)\n x[5] = masked\n y = arange(6)*10\n y[2]= masked\n c = array([1,1,1,0,0,0], mask=[1,0,0,0,0,0])\n cm = c.filled(1)\n z = where(c,x,y)\n zm = where(cm,x,y)\n assert eq(z, zm)\n assert getmask(zm) is None\n assert eq(zm, [0,1,2,30,40,50])\n z = where(c, masked, 1)\n assert eq(z, [99,99,99,1,1,1])\n z = where(c, 1, masked)\n assert eq(z, [99, 1, 1, 99, 99, 99])\n \n def check_testMinMax(self):\n \"Test of minumum, maximum.\" \n assert eq(minimum([1,2,3],[4,0,9]), [1,0,3])\n assert eq(maximum([1,2,3],[4,0,9]), [4,2,9])\n x = arange(5)\n y = arange(5) - 2\n x[3] = masked\n y[0] = masked\n assert eq(minimum(x,y), where(less(x,y), x, y))\n assert eq(maximum(x,y), where(greater(x,y), x, y))\n assert minimum(x) == 0\n assert maximum(x) == 4\n \n def check_testTakeTransposeInnerOuter(self):\n \"Test of take, transpose, inner, outer products\"\n x = arange(24)\n y = numpy.arange(24)\n x[5:6] = masked\n x=x.reshape(2,3,4)\n y=y.reshape(2,3,4)\n assert eq(numpy.transpose(y,(2,0,1)), transpose(x,(2,0,1)))\n assert eq(numpy.take(y, (2,0,1), 1), take(x, (2,0,1), 1))\n assert eq(numpy.innerproduct(filled(x,0),filled(y,0)),\n innerproduct(x, y))\n assert eq(numpy.outerproduct(filled(x,0),filled(y,0)),\n outerproduct(x, y))\n y = array(['abc', 1, 'def', 2, 3], object)\n y[2] = masked\n t = take(y,[0,3,4])\n assert t[0].item() == 'abc'\n assert t[1].item() == 2\n assert t[2].item() == 3\n \n def check_testInplace(self):\n \"\"\"Test of inplace operations and rich comparisons\"\"\"\n y = arange(10)\n \n x = arange(10)\n xm = arange(10)\n xm[2] = masked\n x += 1\n assert eq(x, y+1)\n xm += 1\n assert eq(x, y+1)\n \n x = arange(10)\n xm = arange(10)\n xm[2] = masked\n x -= 1\n assert eq(x, y-1)\n xm -= 1\n assert eq(xm, y-1)\n \n x = arange(10)*1.0\n xm = arange(10)*1.0\n xm[2] = masked\n x *= 2.0\n assert eq(x, y*2)\n xm *= 2.0\n assert eq(xm, y*2)\n \n x = arange(10)*2\n xm = arange(10)\n xm[2] = masked\n x /= 2\n assert eq(x, y)\n xm /= 2\n assert eq(x, y)\n \n x = arange(10)*1.0\n xm = arange(10)*1.0\n xm[2] = masked\n x /= 2.0\n assert eq(x, y/2.0)\n xm /= arange(10)\n assert eq(xm, ones((10,)))\n \n x = arange(10).astype(float32)\n xm = arange(10)\n xm[2] = masked\n id1 = id(x.raw_data())\n x += 1.\n assert id1 == id(x.raw_data())\n assert eq(x, y+1.)\n \n def check_testPickle(self):\n \"Test of pickling\"\n x = arange(12)\n x[4:10:2] = masked\n x=x.reshape(4,3)\n f = open('test9.pik','wb')\n import pickle\n pickle.dump(x, f)\n f.close()\n f = open('test9.pik', 'rb')\n y = pickle.load(f)\n assert eq(x,y) \n \n def check_testMasked(self):\n \"Test of masked element\"\n xx=arange(6)\n xx[1] = masked\n self.failUnless(xx[1] is masked)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, masked)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, 2)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, xx)\n self.failUnlessRaises(Exception, lambda x,y: x+y, xx, masked)\n \n def check_testAverage1(self):\n \"Test of average.\"\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n self.failUnless(eq(2.0, average(ott)))\n self.failUnless(eq(2.0, average(ott, weights=[1., 1., 2., 1.])))\n result, wts = average(ott, weights=[1.,1.,2.,1.], returned=1)\n self.failUnless(eq(2.0, result))\n self.failUnless(wts == 4.0)\n ott[:] = masked\n self.failUnless(average(ott) is masked)\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n ott=ott.reshape(2,2)\n ott[:,1] = masked\n self.failUnless(eq(average(ott), [2.0, 0.0]))\n self.failUnless(average(ott,axis=1)[0] is masked)\n self.failUnless(eq([2.,0.], average(ott)))\n result, wts = average(ott, returned=1)\n self.failUnless(eq(wts, [1., 0.]))\n\n def check_testAverage2(self):\n \"More tests of average.\"\n w1 = [0,1,1,1,1,0]\n w2 = [[0,1,1,1,1,0],[1,0,0,0,0,1]]\n x=arange(6)\n self.failUnless(allclose(average(x), 2.5))\n self.failUnless(allclose(average(x, weights=w1), 2.5))\n y=array([arange(6), 2.0*arange(6)])\n self.failUnless(allclose(average(y, None), numpy.add.reduce(numpy.arange(6))*3./12.))\n self.failUnless(allclose(average(y, axis=0), numpy.arange(6) * 3./2.))\n self.failUnless(allclose(average(y, axis=1), [average(x), average(x) * 2.0]))\n self.failUnless(allclose(average(y, None, weights=w2), 20./6.))\n self.failUnless(allclose(average(y, axis=0, weights=w2), [0.,1.,2.,3.,4.,10.]))\n self.failUnless(allclose(average(y, axis=1), [average(x), average(x) * 2.0]))\n m1 = zeros(6)\n m2 = [0,0,1,1,0,0]\n m3 = [[0,0,1,1,0,0],[0,1,1,1,1,0]]\n m4 = ones(6)\n m5 = [0, 1, 1, 1, 1, 1]\n self.failUnless(allclose(average(masked_array(x, m1)), 2.5))\n self.failUnless(allclose(average(masked_array(x, m2)), 2.5))\n self.failUnless(average(masked_array(x, m4)) is masked)\n self.assertEqual(average(masked_array(x, m5)), 0.0)\n self.assertEqual(count(average(masked_array(x, m4))), 0)\n z = masked_array(y, m3)\n self.failUnless(allclose(average(z, None), 20./6.))\n self.failUnless(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5]))\n self.failUnless(allclose(average(z, axis=1), [2.5, 5.0]))\n self.failUnless(allclose( average(z,weights=w2), [0.,1., 99., 99., 4.0, 10.0]))\n \n a = arange(6)\n b = arange(6) * 3\n r1, w1 = average([[a,b],[b,a]], axis=1, returned=1)\n self.assertEqual(shape(r1) , shape(w1))\n self.assertEqual(r1.shape , w1.shape)\n r2, w2 = average(ones((2,2,3)), axis=0, weights=[3,1], returned=1)\n self.assertEqual(shape(w2) , shape(r2))\n r2, w2 = average(ones((2,2,3)), returned=1)\n self.assertEqual(shape(w2) , shape(r2))\n r2, w2 = average(ones((2,2,3)), weights=ones((2,2,3)), returned=1)\n self.failUnless(shape(w2) == shape(r2))\n a2d = array([[1,2],[0,4]], float)\n a2dm = masked_array(a2d, [[0,0],[1,0]])\n a2da = average(a2d)\n self.failUnless(eq (a2da, [0.5, 3.0]))\n a2dma = average(a2dm)\n self.failUnless(eq( a2dma, [1.0, 3.0]))\n a2dma = average(a2dm, axis=None)\n self.failUnless(eq(a2dma, 7./3.))\n a2dma = average(a2dm, axis=1)\n self.failUnless(eq(a2dma, [1.5, 4.0]))\n\n def check_testToPython(self):\n self.assertEqual(1, int(array(1)))\n self.assertEqual(1.0, float(array(1)))\n self.assertEqual(1, int(array([[[1]]])))\n self.assertEqual(1.0, float(array([[1]])))\n self.failUnlessRaises(ValueError, float, array([1,1]))\n self.failUnlessRaises(MAError, float, array([1],mask=[1]))\n self.failUnless(bool(array([0,1])))\n self.failUnless(bool(array([0,0],mask=[0,1])))\n self.failIf(bool(array([0,0])))\n self.failIf(bool(array([0,0],mask=[0,0])))\n\n def check_testScalarArithmetic(self):\n xm = array(0, mask=1)\n self.failUnless((1/array(0)).mask)\n self.failUnless((1 + xm).mask)\n self.failUnless((-xm).mask)\n self.failUnless((-xm).mask)\n self.failUnless(maximum(xm, xm).mask)\n self.failUnless(minimum(xm, xm).mask)\n \ndef timingTest():\n for f in [testf, testinplace]:\n for n in [1000,10000,50000]:\n t = testta(n, f)\n t1 = testtb(n, f)\n t2 = testtc(n, f)\n print f.test_name\n print \"\"\"\\\nn = %7d \nnumpy time (ms) %6.1f \nMA maskless ratio %6.1f\nMA masked ratio %6.1f\n\"\"\" % (n, t*1000.0, t1/t, t2/t)\n\ndef testta(n, f):\n x=numpy.arange(n) + 1.0\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testtb(n, f):\n x=arange(n) + 1.0\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testtc(n, f):\n x=arange(n) + 1.0\n x[0] = masked\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testf(x):\n for i in range(25):\n y = x **2 + 2.0 * x - 1.0\n w = x **2 + 1.0\n z = (y / w) ** 2\n return z\ntestf.test_name = 'Simple arithmetic'\n\ndef testinplace(x):\n for i in range(25):\n y = x**2\n y += 2.0*x\n y -= 1.0\n y /= x\n return y\ntestinplace.test_name = 'Inplace operations'\n\nif __name__ == \"__main__\":\n ScipyTest('numpy.core.ma').run() \n #timingTest()\n", + "source_code_before": "import numpy \nimport types, time\nfrom numpy.core.ma import *\nfrom numpy.testing import ScipyTestCase, ScipyTest\ndef eq(v,w):\n result = allclose(v,w)\n if not result:\n print \"\"\"Not eq:\n%s\n----\n%s\"\"\"% (str(v), str(w))\n return result\n\nclass test_ma(ScipyTestCase):\n def __init__(self, *args, **kwds):\n ScipyTestCase.__init__(self, *args, **kwds)\n self.setUp()\n \n def setUp (self):\n x=numpy.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])\n y=numpy.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])\n a10 = 10.\n m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]\n m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 ,0, 1]\n xm = array(x, mask=m1)\n ym = array(y, mask=m2)\n z = numpy.array([-.5, 0., .5, .8])\n zm = array(z, mask=[0,1,0,0])\n xf = numpy.where(m1, 1.e+20, x)\n s = x.shape\n xm.set_fill_value(1.e+20)\n self.d = (x, y, a10, m1, m2, xm, ym, z, zm, xf, s)\n\n def check_testBasic1d(self):\n \"Test of basic array creation and properties in 1 dimension.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failIf(isMaskedArray(x))\n self.failUnless(isMaskedArray(xm))\n self.assertEqual(shape(xm), s)\n self.assertEqual(xm.shape, s)\n self.assertEqual(xm.dtype, x.dtype)\n self.assertEqual(xm.dtypechar, x.dtypechar)\n self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))\n self.assertEqual(count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))\n self.failUnless(eq(xm, xf))\n self.failUnless(eq(filled(xm, 1.e20), xf))\n self.failUnless(eq(x, xm))\n\n def check_testBasic2d(self):\n \"Test of basic array creation and properties in 2 dimensions.\"\n for s in [(4,3), (6,2)]: \n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n x.shape = s\n y.shape = s\n xm.shape = s\n ym.shape = s\n xf.shape = s\n \n self.failIf(isMaskedArray(x))\n self.failUnless(isMaskedArray(xm))\n self.assertEqual(shape(xm), s)\n self.assertEqual(xm.shape, s)\n self.assertEqual( xm.size , reduce(lambda x,y:x*y, s))\n self.assertEqual( count(xm) , len(m1) - reduce(lambda x,y:x+y, m1))\n self.failUnless(eq(xm, xf))\n self.failUnless(eq(filled(xm, 1.e20), xf))\n self.failUnless(eq(x, xm))\n self.setUp()\n\n def check_testArithmetic (self):\n \"Test of basic arithmetic.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n a2d = array([[1,2],[0,4]])\n a2dm = masked_array(a2d, [[0,0],[1,0]])\n self.failUnless(eq (a2d * a2d, a2d * a2dm))\n self.failUnless(eq (a2d + a2d, a2d + a2dm))\n self.failUnless(eq (a2d - a2d, a2d - a2dm))\n for s in [(12,), (4,3), (2,6)]: \n x = x.reshape(s)\n y = y.reshape(s)\n xm = xm.reshape(s)\n ym = ym.reshape(s)\n xf = xf.reshape(s)\n self.failUnless(eq(-x, -xm))\n self.failUnless(eq(x + y, xm + ym))\n self.failUnless(eq(x - y, xm - ym))\n self.failUnless(eq(x * y, xm * ym))\n self.failUnless(eq(x / y, xm / ym))\n self.failUnless(eq(a10 + y, a10 + ym))\n self.failUnless(eq(a10 - y, a10 - ym))\n self.failUnless(eq(a10 * y, a10 * ym))\n self.failUnless(eq(a10 / y, a10 / ym))\n self.failUnless(eq(x + a10, xm + a10))\n self.failUnless(eq(x - a10, xm - a10))\n self.failUnless(eq(x * a10, xm * a10))\n self.failUnless(eq(x / a10, xm / a10))\n self.failUnless(eq(x**2, xm**2))\n self.failUnless(eq(abs(x)**2.5, abs(xm) **2.5))\n self.failUnless(eq(x**y, xm**ym))\n self.failUnless(eq(numpy.add(x,y), add(xm, ym)))\n self.failUnless(eq(numpy.subtract(x,y), subtract(xm, ym)))\n self.failUnless(eq(numpy.multiply(x,y), multiply(xm, ym)))\n self.failUnless(eq(numpy.divide(x,y), divide(xm, ym)))\n\n\n def check_testUfuncs1 (self):\n \"Test various functions such as sin, cos.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failUnless (eq(numpy.cos(x), cos(xm)))\n self.failUnless (eq(numpy.cosh(x), cosh(xm)))\n self.failUnless (eq(numpy.sin(x), sin(xm)))\n self.failUnless (eq(numpy.sinh(x), sinh(xm)))\n self.failUnless (eq(numpy.tan(x), tan(xm)))\n self.failUnless (eq(numpy.tanh(x), tanh(xm)))\n self.failUnless (eq(numpy.sqrt(abs(x)), sqrt(xm)))\n self.failUnless (eq(numpy.log(abs(x)), log(xm)))\n self.failUnless (eq(numpy.log10(abs(x)), log10(xm)))\n self.failUnless (eq(numpy.exp(x), exp(xm)))\n self.failUnless (eq(numpy.arcsin(z), arcsin(zm)))\n self.failUnless (eq(numpy.arccos(z), arccos(zm)))\n self.failUnless (eq(numpy.arctan(z), arctan(zm)))\n self.failUnless (eq(numpy.arctan2(x, y), arctan2(xm, ym)))\n self.failUnless (eq(numpy.absolute(x), absolute(xm)))\n self.failUnless (eq(numpy.equal(x,y), equal(xm, ym)))\n self.failUnless (eq(numpy.not_equal(x,y), not_equal(xm, ym)))\n self.failUnless (eq(numpy.less(x,y), less(xm, ym)))\n self.failUnless (eq(numpy.greater(x,y), greater(xm, ym)))\n self.failUnless (eq(numpy.less_equal(x,y), less_equal(xm, ym)))\n self.failUnless (eq(numpy.greater_equal(x,y), greater_equal(xm, ym)))\n self.failUnless (eq(numpy.conjugate(x), conjugate(xm)))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,ym))))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((x,y))))\n self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,y))))\n self.failUnless (eq(numpy.concatenate((x,y,x)), concatenate((x,ym,x))))\n \n def check_xtestCount (self):\n \"Test count\"\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n self.failUnless( isinstance(count(ott), types.IntType))\n self.assertEqual(3, count(ott))\n self.assertEqual(1, count(1))\n self.failUnless (eq(0, array(1,mask=[1])))\n ott=ott.reshape((2,2))\n assert isMaskedArray(count(ott,0))\n assert isinstance(count(ott), types.IntType)\n self.failUnless (eq(3, count(ott)))\n assert getmask(count(ott,0)) is None\n self.failUnless (eq([1,2],count(ott,0)))\n \n def check_testMinMax (self):\n \"Test minimum and maximum.\" \n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n xr = numpy.ravel(x) #max doesn't work if shaped\n xmr = ravel(xm)\n self.failUnless (eq(max(xr), maximum(xmr))) #true because of careful selection of data\n self.failUnless (eq(min(xr), minimum(xmr))) #true because of careful selection of data\n\n def check_testAddSumProd (self):\n \"Test add, sum, product.\"\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n self.failUnless (eq(numpy.add.reduce(x), add.reduce(x)))\n self.failUnless (eq(numpy.add.accumulate(x), add.accumulate(x)))\n self.failUnless (eq(4, sum(array(4))))\n self.failUnless (eq(4, sum(array(4), axis=0)))\n self.failUnless (eq(numpy.sum(x), sum(x)))\n self.failUnless (eq(numpy.sum(filled(xm,0)), sum(xm)))\n self.failUnless (eq(numpy.sum(x,0), sum(x,0)))\n self.failUnless (eq(numpy.product(x), product(x)))\n self.failUnless (eq(numpy.product(x,0), product(x,0)))\n self.failUnless (eq(numpy.product(filled(xm,1)), product(xm)))\n if len(s) > 1:\n self.failUnless (eq(numpy.concatenate((x,y),1), concatenate((xm,ym),1)))\n self.failUnless (eq(numpy.add.reduce(x,1), add.reduce(x,1)))\n self.failUnless (eq(numpy.sum(x,1), sum(x,1)))\n self.failUnless (eq(numpy.product(x,1), product(x,1)))\n \n \n def check_testCI(self):\n \"Test of conversions and indexing\"\n x1 = numpy.array([1,2,4,3])\n x2 = array(x1, mask = [1,0,0,0])\n x3 = array(x1, mask = [0,1,0,1])\n x4 = array(x1)\n # test conversion to strings\n junk, garbage = str(x2), repr(x2)\n assert eq(numpy.sort(x1),sort(x2, fill_value=0))\n # tests of indexing\n assert type(x2[1]) is type(x1[1])\n assert x1[1] == x2[1]\n assert x2[0] is masked\n assert eq(x1[2],x2[2])\n assert eq(x1[2:5],x2[2:5])\n assert eq(x1[:],x2[:])\n assert eq(x1[1:], x3[1:])\n x1[2]=9\n x2[2]=9\n assert eq(x1,x2)\n x1[1:3] = 99\n x2[1:3] = 99\n assert eq(x1,x2)\n x2[1] = masked\n assert eq(x1,x2)\n x2[1:3]=masked\n assert eq(x1,x2)\n x2[:] = x1\n x2[1] = masked\n assert allequal(getmask(x2),array([0,1,0,0]))\n x3[:] = masked_array([1,2,3,4],[0,1,1,0])\n assert allequal(getmask(x3), array([0,1,1,0]))\n x4[:] = masked_array([1,2,3,4],[0,1,1,0])\n assert allequal(getmask(x4), array([0,1,1,0]))\n assert allequal(x4, array([1,2,3,4]))\n x1 = numpy.arange(5)*1.0\n x2 = masked_values(x1, 3.0)\n assert eq(x1,x2)\n assert allequal(array([0,0,0,1,0],MaskType), x2.mask)\n assert eq(3.0, x2.fill_value())\n x1 = array([1,'hello',2,3],object)\n x2 = numpy.array([1,'hello',2,3],object)\n s1 = x1[1].item()\n s2 = x2[1].item()\n self.assertEqual(type(s2), str)\n self.assertEqual(type(s1), str)\n self.assertEqual(s1, s2)\n assert x1[1:1].shape == (0,)\n \n def check_testCopySize(self):\n \"Tests of some subtle points of copying and sizing.\"\n n = [0,0,1,0,0]\n m = make_mask(n)\n m2 = make_mask(m)\n self.failUnless(m is m2)\n m3 = make_mask(m, copy=1)\n self.failUnless(m is not m3)\n \n x1 = numpy.arange(5)\n y1 = array(x1, mask=m)\n self.failUnless( y1.raw_data() is not x1)\n self.failUnless( allequal(x1,y1.raw_data()))\n self.failUnless( y1.mask is m)\n \n y1a = array(y1, copy=0)\n self.failUnless( y1a.raw_data() is y1.raw_data())\n self.failUnless( y1a.mask is y1.mask)\n \n y2 = array(x1, mask=m, copy=0)\n self.failUnless( y2.raw_data() is x1)\n self.failUnless( y2.mask is m)\n self.failUnless( y2[2] is masked)\n y2[2]=9\n self.failUnless( y2[2] is not masked)\n self.failUnless( y2.mask is not m)\n self.failUnless( allequal(y2.mask, 0))\n \n y3 = array(x1*1.0, mask=m)\n self.failUnless(filled(y3).dtype is (x1*1.0).dtype)\n \n x4 = arange(4)\n x4[2] = masked\n y4 = resize(x4, (8,))\n self.failUnless( eq(concatenate([x4,x4]), y4))\n self.failUnless( eq(getmask(y4),[0,0,1,0,0,0,1,0]))\n y5 = repeat(x4, (2,2,2,2))\n self.failUnless( eq(y5, [0,0,1,1,2,2,3,3]))\n y6 = repeat(x4, 2)\n self.failUnless( eq(y5, y6))\n \n def check_testPut(self):\n \"Test of put\"\n d = arange(5)\n n = [0,0,0,1,1]\n m = make_mask(n)\n x = array(d, mask = m)\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is masked)\n x[[1,4]] = [10,40]\n self.failUnless( x.mask is not m)\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is not masked)\n self.failUnless( eq(x, [0,10,2,-1,40]))\n \n x = array(d, mask = m) \n x.put([-1,100,200])\n self.failUnless( eq(x, [-1,100,200,0,0]))\n self.failUnless( x[3] is masked)\n self.failUnless( x[4] is masked)\n \n x = array(d, mask = m) \n x.putmask([30,40])\n self.failUnless( eq(x, [0,1,2,30,40]))\n self.failUnless( x.mask is None)\n \n x = array(d, mask = m) \n y = x.compressed()\n z = array(x, mask = m)\n z.put(y)\n assert eq (x, z)\n \n def check_testMaPut(self):\n (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d\n m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1]\n i = numpy.nonzero(m)\n putmask(xm, m, z)\n assert take(xm, i) == z\n put(ym, i, zm)\n assert take(ym, i) == zm\n \n def check_testOddFeatures(self):\n \"Test of other odd features\"\n x = arange(20); x=x.reshape(4,5)\n x.flat[5] = 12\n assert x[1,0] == 12\n z = x + 10j * x\n assert eq(z.real, x)\n assert eq(z.imag, 10*x)\n assert eq((z*conjugate(z)).real, 101*x*x)\n z.imag[...] = 0.0\n \n x = arange(10)\n x[3] = masked\n assert str(x[3]) == str(masked)\n c = x >= 8\n assert count(where(c,masked,masked)) == 0\n assert shape(where(c,masked,masked)) == c.shape\n z = where(c , x, masked)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is masked\n assert z[7] is masked\n assert z[8] is not masked\n assert z[9] is not masked\n assert eq(x,z)\n z = where(c , masked, x)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is not masked\n assert z[7] is not masked\n assert z[8] is masked\n assert z[9] is masked\n z = masked_where(c, x)\n assert z.dtype is x.dtype\n assert z[3] is masked\n assert z[4] is not masked\n assert z[7] is not masked\n assert z[8] is masked\n assert z[9] is masked\n assert eq(x,z)\n x = array([1.,2.,3.,4.,5.])\n c = array([1,1,1,0,0])\n x[2] = masked\n z = where(c, x, -x)\n assert eq(z, [1.,2.,0., -4., -5])\n c[0] = masked\n z = where(c, x, -x)\n assert eq(z, [1.,2.,0., -4., -5])\n assert z[0] is masked\n assert z[1] is not masked\n assert z[2] is masked\n assert eq(masked_where(greater(x, 2), x), masked_greater(x,2))\n assert eq(masked_where(greater_equal(x, 2), x), masked_greater_equal(x,2))\n assert eq(masked_where(less(x, 2), x), masked_less(x,2))\n assert eq(masked_where(less_equal(x, 2), x), masked_less_equal(x,2))\n assert eq(masked_where(not_equal(x, 2), x), masked_not_equal(x,2))\n assert eq(masked_where(equal(x, 2), x), masked_equal(x,2))\n assert eq(masked_where(not_equal(x,2), x), masked_not_equal(x,2))\n assert eq(masked_inside(range(5), 1, 3), [0, 199, 199, 199, 4])\n assert eq(masked_outside(range(5), 1, 3),[199,1,2,3,199])\n assert eq(masked_inside(array(range(5), mask=[1,0,0,0,0]), 1, 3).mask, [1,1,1,1,0])\n assert eq(masked_outside(array(range(5), mask=[0,1,0,0,0]), 1, 3).mask, [1,1,0,0,1])\n assert eq(masked_equal(array(range(5), mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,0])\n assert eq(masked_not_equal(array([2,2,1,2,1], mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,1])\n assert eq(masked_where([1,1,0,0,0], [1,2,3,4,5]), [99,99,3,4,5])\n atest = ones((10,10,10), dtype=float32)\n btest = zeros(atest.shape, MaskType)\n ctest = masked_where(btest,atest)\n assert eq(atest,ctest)\n z = choose(c, (-x, x))\n assert eq(z, [1.,2.,0., -4., -5])\n assert z[0] is masked\n assert z[1] is not masked\n assert z[2] is masked\n x = arange(6)\n x[5] = masked\n y = arange(6)*10\n y[2]= masked\n c = array([1,1,1,0,0,0], mask=[1,0,0,0,0,0])\n cm = c.filled(1)\n z = where(c,x,y)\n zm = where(cm,x,y)\n assert eq(z, zm)\n assert getmask(zm) is None\n assert eq(zm, [0,1,2,30,40,50])\n z = where(c, masked, 1)\n assert eq(z, [99,99,99,1,1,1])\n z = where(c, 1, masked)\n assert eq(z, [99, 1, 1, 99, 99, 99])\n \n def check_testMinMax(self):\n \"Test of minumum, maximum.\" \n assert eq(minimum([1,2,3],[4,0,9]), [1,0,3])\n assert eq(maximum([1,2,3],[4,0,9]), [4,2,9])\n x = arange(5)\n y = arange(5) - 2\n x[3] = masked\n y[0] = masked\n assert eq(minimum(x,y), where(less(x,y), x, y))\n assert eq(maximum(x,y), where(greater(x,y), x, y))\n assert minimum(x) == 0\n assert maximum(x) == 4\n \n def check_testTakeTransposeInnerOuter(self):\n \"Test of take, transpose, inner, outer products\"\n x = arange(24)\n y = numpy.arange(24)\n x[5:6] = masked\n x=x.reshape(2,3,4)\n y=y.reshape(2,3,4)\n assert eq(numpy.transpose(y,(2,0,1)), transpose(x,(2,0,1)))\n assert eq(numpy.take(y, (2,0,1), 1), take(x, (2,0,1), 1))\n assert eq(numpy.innerproduct(filled(x,0),filled(y,0)),\n innerproduct(x, y))\n assert eq(numpy.outerproduct(filled(x,0),filled(y,0)),\n outerproduct(x, y))\n y = array(['abc', 1, 'def', 2, 3], object)\n y[2] = masked\n t = take(y,[0,3,4])\n assert t[0].item() == 'abc'\n assert t[1].item() == 2\n assert t[2].item() == 3\n \n def check_testInplace(self):\n \"\"\"Test of inplace operations and rich comparisons\"\"\"\n y = arange(10)\n \n x = arange(10)\n xm = arange(10)\n xm[2] = masked\n x += 1\n assert eq(x, y+1)\n xm += 1\n assert eq(x, y+1)\n \n x = arange(10)\n xm = arange(10)\n xm[2] = masked\n x -= 1\n assert eq(x, y-1)\n xm -= 1\n assert eq(xm, y-1)\n \n x = arange(10)*1.0\n xm = arange(10)*1.0\n xm[2] = masked\n x *= 2.0\n assert eq(x, y*2)\n xm *= 2.0\n assert eq(xm, y*2)\n \n x = arange(10)*2\n xm = arange(10)\n xm[2] = masked\n x /= 2\n assert eq(x, y)\n xm /= 2\n assert eq(x, y)\n \n x = arange(10)*1.0\n xm = arange(10)*1.0\n xm[2] = masked\n x /= 2.0\n assert eq(x, y/2.0)\n xm /= arange(10)\n assert eq(xm, ones((10,)))\n \n x = arange(10).astype(float32)\n xm = arange(10)\n xm[2] = masked\n id1 = id(x.raw_data())\n x += 1.\n assert id1 == id(x.raw_data())\n assert eq(x, y+1.)\n \n def check_testPickle(self):\n \"Test of pickling\"\n x = arange(12)\n x[4:10:2] = masked\n x=x.reshape(4,3)\n f = open('test9.pik','wb')\n import pickle\n pickle.dump(x, f)\n f.close()\n f = open('test9.pik', 'rb')\n y = pickle.load(f)\n assert eq(x,y) \n \n def check_testMasked(self):\n \"Test of masked element\"\n xx=arange(6)\n xx[1] = masked\n self.failUnless(xx[1] is masked)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, masked)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, 2)\n self.failUnlessRaises(Exception, lambda x,y: x+y, masked, xx)\n self.failUnlessRaises(Exception, lambda x,y: x+y, xx, masked)\n \n def check_testAverage1(self):\n \"Test of average.\"\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n self.failUnless(eq(2.0, average(ott)))\n self.failUnless(eq(2.0, average(ott, weights=[1., 1., 2., 1.])))\n result, wts = average(ott, weights=[1.,1.,2.,1.], returned=1)\n self.failUnless(eq(2.0, result))\n self.failUnless(wts == 4.0)\n ott[:] = masked\n self.failUnless(average(ott) is masked)\n ott = array([0.,1.,2.,3.], mask=[1,0,0,0])\n ott=ott.reshape(2,2)\n ott[:,1] = masked\n self.failUnless(eq(average(ott), [2.0, 0.0]))\n self.failUnless(average(ott,axis=1)[0] is masked)\n self.failUnless(eq([2.,0.], average(ott)))\n result, wts = average(ott, returned=1)\n self.failUnless(eq(wts, [1., 0.]))\n\n def check_testAverage2(self):\n \"More tests of average.\"\n w1 = [0,1,1,1,1,0]\n w2 = [[0,1,1,1,1,0],[1,0,0,0,0,1]]\n x=arange(6)\n self.failUnless(allclose(average(x), 2.5))\n self.failUnless(allclose(average(x, weights=w1), 2.5))\n y=array([arange(6), 2.0*arange(6)])\n self.failUnless(allclose(average(y, None), numpy.add.reduce(numpy.arange(6))*3./12.))\n self.failUnless(allclose(average(y, axis=0), numpy.arange(6) * 3./2.))\n self.failUnless(allclose(average(y, axis=1), [average(x), average(x) * 2.0]))\n self.failUnless(allclose(average(y, None, weights=w2), 20./6.))\n self.failUnless(allclose(average(y, axis=0, weights=w2), [0.,1.,2.,3.,4.,10.]))\n self.failUnless(allclose(average(y, axis=1), [average(x), average(x) * 2.0]))\n m1 = zeros(6)\n m2 = [0,0,1,1,0,0]\n m3 = [[0,0,1,1,0,0],[0,1,1,1,1,0]]\n m4 = ones(6)\n m5 = [0, 1, 1, 1, 1, 1]\n self.failUnless(allclose(average(masked_array(x, m1)), 2.5))\n self.failUnless(allclose(average(masked_array(x, m2)), 2.5))\n self.failUnless(average(masked_array(x, m4)) is masked)\n self.assertEqual(average(masked_array(x, m5)), 0.0)\n self.assertEqual(count(average(masked_array(x, m4))), 0)\n z = masked_array(y, m3)\n self.failUnless(allclose(average(z, None), 20./6.))\n self.failUnless(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5]))\n self.failUnless(allclose(average(z, axis=1), [2.5, 5.0]))\n self.failUnless(allclose( average(z,weights=w2), [0.,1., 99., 99., 4.0, 10.0]))\n \n a = arange(6)\n b = arange(6) * 3\n r1, w1 = average([[a,b],[b,a]], axis=1, returned=1)\n self.assertEqual(shape(r1) , shape(w1))\n self.assertEqual(r1.shape , w1.shape)\n r2, w2 = average(ones((2,2,3)), axis=0, weights=[3,1], returned=1)\n self.assertEqual(shape(w2) , shape(r2))\n r2, w2 = average(ones((2,2,3)), returned=1)\n self.assertEqual(shape(w2) , shape(r2))\n r2, w2 = average(ones((2,2,3)), weights=ones((2,2,3)), returned=1)\n self.failUnless(shape(w2) == shape(r2))\n a2d = array([[1,2],[0,4]], float)\n a2dm = masked_array(a2d, [[0,0],[1,0]])\n a2da = average(a2d)\n self.failUnless(eq (a2da, [0.5, 3.0]))\n a2dma = average(a2dm)\n self.failUnless(eq( a2dma, [1.0, 3.0]))\n a2dma = average(a2dm, axis=None)\n self.failUnless(eq(a2dma, 7./3.))\n a2dma = average(a2dm, axis=1)\n self.failUnless(eq(a2dma, [1.5, 4.0]))\n\n def check_testToPython(self):\n self.assertEqual(1, int(array(1)))\n self.assertEqual(1.0, float(array(1)))\n self.assertEqual(1, int(array([[[1]]])))\n self.assertEqual(1.0, float(array([[1]])))\n self.failUnlessRaises(ValueError, float, array([1,1]))\n self.failUnlessRaises(MAError, float, array([1],mask=[1]))\n \ndef timingTest():\n for f in [testf, testinplace]:\n for n in [1000,10000,50000]:\n t = testta(n, f)\n t1 = testtb(n, f)\n t2 = testtc(n, f)\n print f.test_name\n print \"\"\"\\\nn = %7d \nnumpy time (ms) %6.1f \nMA maskless ratio %6.1f\nMA masked ratio %6.1f\n\"\"\" % (n, t*1000.0, t1/t, t2/t)\n\ndef testta(n, f):\n x=numpy.arange(n) + 1.0\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testtb(n, f):\n x=arange(n) + 1.0\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testtc(n, f):\n x=arange(n) + 1.0\n x[0] = masked\n tn0 = time.time()\n z = f(x)\n return time.time() - tn0\n\ndef testf(x):\n for i in range(25):\n y = x **2 + 2.0 * x - 1.0\n w = x **2 + 1.0\n z = (y / w) ** 2\n return z\ntestf.test_name = 'Simple arithmetic'\n\ndef testinplace(x):\n for i in range(25):\n y = x**2\n y += 2.0*x\n y -= 1.0\n y /= x\n return y\ntestinplace.test_name = 'Inplace operations'\n\nif __name__ == \"__main__\":\n ScipyTest('numpy.core.ma').run() \n #timingTest()\n", + "methods": [ + { + "name": "eq", + "long_name": "eq( v , w )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 35, + "parameters": [ + "v", + "w" + ], + "start_line": 5, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , * args , ** kwds )", + "filename": "test_ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 15, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "setUp", + "long_name": "setUp( self )", + "filename": "test_ma.py", + "nloc": 14, + "complexity": 1, + "token_count": 276, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_testBasic1d", + "long_name": "check_testBasic1d( self )", + "filename": "test_ma.py", + "nloc": 14, + "complexity": 1, + "token_count": 186, + "parameters": [ + "self" + ], + "start_line": 34, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_testBasic2d", + "long_name": "check_testBasic2d( self )", + "filename": "test_ma.py", + "nloc": 19, + "complexity": 2, + "token_count": 209, + "parameters": [ + "self" + ], + "start_line": 49, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "check_testArithmetic", + "long_name": "check_testArithmetic( self )", + "filename": "test_ma.py", + "nloc": 34, + "complexity": 2, + "token_count": 518, + "parameters": [ + "self" + ], + "start_line": 70, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "check_testUfuncs1", + "long_name": "check_testUfuncs1( self )", + "filename": "test_ma.py", + "nloc": 29, + "complexity": 1, + "token_count": 600, + "parameters": [ + "self" + ], + "start_line": 106, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "check_xtestCount", + "long_name": "check_xtestCount( self )", + "filename": "test_ma.py", + "nloc": 13, + "complexity": 1, + "token_count": 174, + "parameters": [ + "self" + ], + "start_line": 136, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_testMinMax", + "long_name": "check_testMinMax( self )", + "filename": "test_ma.py", + "nloc": 7, + "complexity": 1, + "token_count": 81, + "parameters": [ + "self" + ], + "start_line": 150, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_testAddSumProd", + "long_name": "check_testAddSumProd( self )", + "filename": "test_ma.py", + "nloc": 18, + "complexity": 2, + "token_count": 361, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_testCI", + "long_name": "check_testCI( self )", + "filename": "test_ma.py", + "nloc": 46, + "complexity": 1, + "token_count": 568, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 1 + }, + { + "name": "check_testCopySize", + "long_name": "check_testCopySize( self )", + "filename": "test_ma.py", + "nloc": 35, + "complexity": 1, + "token_count": 409, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 1 + }, + { + "name": "check_testPut", + "long_name": "check_testPut( self )", + "filename": "test_ma.py", + "nloc": 27, + "complexity": 1, + "token_count": 291, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "check_testMaPut", + "long_name": "check_testMaPut( self )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 101, + "parameters": [ + "self" + ], + "start_line": 299, + "end_line": 306, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_testOddFeatures", + "long_name": "check_testOddFeatures( self )", + "filename": "test_ma.py", + "nloc": 88, + "complexity": 1, + "token_count": 1188, + "parameters": [ + "self" + ], + "start_line": 308, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 89, + "top_nesting_level": 1 + }, + { + "name": "check_testMinMax", + "long_name": "check_testMinMax( self )", + "filename": "test_ma.py", + "nloc": 12, + "complexity": 1, + "token_count": 154, + "parameters": [ + "self" + ], + "start_line": 398, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_testTakeTransposeInnerOuter", + "long_name": "check_testTakeTransposeInnerOuter( self )", + "filename": "test_ma.py", + "nloc": 19, + "complexity": 1, + "token_count": 247, + "parameters": [ + "self" + ], + "start_line": 411, + "end_line": 429, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "check_testInplace", + "long_name": "check_testInplace( self )", + "filename": "test_ma.py", + "nloc": 44, + "complexity": 1, + "token_count": 315, + "parameters": [ + "self" + ], + "start_line": 431, + "end_line": 481, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "check_testPickle", + "long_name": "check_testPickle( self )", + "filename": "test_ma.py", + "nloc": 12, + "complexity": 1, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 483, + "end_line": 494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_testMasked", + "long_name": "check_testMasked( self )", + "filename": "test_ma.py", + "nloc": 9, + "complexity": 1, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 496, + "end_line": 504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_testAverage1", + "long_name": "check_testAverage1( self )", + "filename": "test_ma.py", + "nloc": 18, + "complexity": 1, + "token_count": 289, + "parameters": [ + "self" + ], + "start_line": 506, + "end_line": 523, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_testAverage2", + "long_name": "check_testAverage2( self )", + "filename": "test_ma.py", + "nloc": 50, + "complexity": 1, + "token_count": 945, + "parameters": [ + "self" + ], + "start_line": 525, + "end_line": 575, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "check_testToPython", + "long_name": "check_testToPython( self )", + "filename": "test_ma.py", + "nloc": 11, + "complexity": 1, + "token_count": 193, + "parameters": [ + "self" + ], + "start_line": 577, + "end_line": 587, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_testScalarArithmetic", + "long_name": "check_testScalarArithmetic( self )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 589, + "end_line": 596, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "timingTest", + "long_name": "timingTest( )", + "filename": "test_ma.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [], + "start_line": 598, + "end_line": 610, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "testta", + "long_name": "testta( n , f )", + "filename": "test_ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 40, + "parameters": [ + "n", + "f" + ], + "start_line": 612, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "testtb", + "long_name": "testtb( n , f )", + "filename": "test_ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "n", + "f" + ], + "start_line": 618, + "end_line": 622, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "testtc", + "long_name": "testtc( n , f )", + "filename": "test_ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "n", + "f" + ], + "start_line": 624, + "end_line": 629, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "testf", + "long_name": "testf( x )", + "filename": "test_ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 48, + "parameters": [ + "x" + ], + "start_line": 631, + "end_line": 636, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "testinplace", + "long_name": "testinplace( x )", + "filename": "test_ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 639, + "end_line": 645, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "eq", + "long_name": "eq( v , w )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 35, + "parameters": [ + "v", + "w" + ], + "start_line": 5, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , * args , ** kwds )", + "filename": "test_ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 15, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "setUp", + "long_name": "setUp( self )", + "filename": "test_ma.py", + "nloc": 14, + "complexity": 1, + "token_count": 276, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_testBasic1d", + "long_name": "check_testBasic1d( self )", + "filename": "test_ma.py", + "nloc": 14, + "complexity": 1, + "token_count": 186, + "parameters": [ + "self" + ], + "start_line": 34, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_testBasic2d", + "long_name": "check_testBasic2d( self )", + "filename": "test_ma.py", + "nloc": 19, + "complexity": 2, + "token_count": 209, + "parameters": [ + "self" + ], + "start_line": 49, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "check_testArithmetic", + "long_name": "check_testArithmetic( self )", + "filename": "test_ma.py", + "nloc": 34, + "complexity": 2, + "token_count": 518, + "parameters": [ + "self" + ], + "start_line": 70, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "check_testUfuncs1", + "long_name": "check_testUfuncs1( self )", + "filename": "test_ma.py", + "nloc": 29, + "complexity": 1, + "token_count": 600, + "parameters": [ + "self" + ], + "start_line": 106, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "check_xtestCount", + "long_name": "check_xtestCount( self )", + "filename": "test_ma.py", + "nloc": 13, + "complexity": 1, + "token_count": 174, + "parameters": [ + "self" + ], + "start_line": 136, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_testMinMax", + "long_name": "check_testMinMax( self )", + "filename": "test_ma.py", + "nloc": 7, + "complexity": 1, + "token_count": 81, + "parameters": [ + "self" + ], + "start_line": 150, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_testAddSumProd", + "long_name": "check_testAddSumProd( self )", + "filename": "test_ma.py", + "nloc": 18, + "complexity": 2, + "token_count": 361, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_testCI", + "long_name": "check_testCI( self )", + "filename": "test_ma.py", + "nloc": 46, + "complexity": 1, + "token_count": 568, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 1 + }, + { + "name": "check_testCopySize", + "long_name": "check_testCopySize( self )", + "filename": "test_ma.py", + "nloc": 35, + "complexity": 1, + "token_count": 409, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 1 + }, + { + "name": "check_testPut", + "long_name": "check_testPut( self )", + "filename": "test_ma.py", + "nloc": 27, + "complexity": 1, + "token_count": 291, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "check_testMaPut", + "long_name": "check_testMaPut( self )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 101, + "parameters": [ + "self" + ], + "start_line": 299, + "end_line": 306, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_testOddFeatures", + "long_name": "check_testOddFeatures( self )", + "filename": "test_ma.py", + "nloc": 88, + "complexity": 1, + "token_count": 1188, + "parameters": [ + "self" + ], + "start_line": 308, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 89, + "top_nesting_level": 1 + }, + { + "name": "check_testMinMax", + "long_name": "check_testMinMax( self )", + "filename": "test_ma.py", + "nloc": 12, + "complexity": 1, + "token_count": 154, + "parameters": [ + "self" + ], + "start_line": 398, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_testTakeTransposeInnerOuter", + "long_name": "check_testTakeTransposeInnerOuter( self )", + "filename": "test_ma.py", + "nloc": 19, + "complexity": 1, + "token_count": 247, + "parameters": [ + "self" + ], + "start_line": 411, + "end_line": 429, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "check_testInplace", + "long_name": "check_testInplace( self )", + "filename": "test_ma.py", + "nloc": 44, + "complexity": 1, + "token_count": 315, + "parameters": [ + "self" + ], + "start_line": 431, + "end_line": 481, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "check_testPickle", + "long_name": "check_testPickle( self )", + "filename": "test_ma.py", + "nloc": 12, + "complexity": 1, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 483, + "end_line": 494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_testMasked", + "long_name": "check_testMasked( self )", + "filename": "test_ma.py", + "nloc": 9, + "complexity": 1, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 496, + "end_line": 504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_testAverage1", + "long_name": "check_testAverage1( self )", + "filename": "test_ma.py", + "nloc": 18, + "complexity": 1, + "token_count": 289, + "parameters": [ + "self" + ], + "start_line": 506, + "end_line": 523, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_testAverage2", + "long_name": "check_testAverage2( self )", + "filename": "test_ma.py", + "nloc": 50, + "complexity": 1, + "token_count": 945, + "parameters": [ + "self" + ], + "start_line": 525, + "end_line": 575, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "check_testToPython", + "long_name": "check_testToPython( self )", + "filename": "test_ma.py", + "nloc": 7, + "complexity": 1, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 577, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "timingTest", + "long_name": "timingTest( )", + "filename": "test_ma.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [], + "start_line": 585, + "end_line": 597, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "testta", + "long_name": "testta( n , f )", + "filename": "test_ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 40, + "parameters": [ + "n", + "f" + ], + "start_line": 599, + "end_line": 603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "testtb", + "long_name": "testtb( n , f )", + "filename": "test_ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "n", + "f" + ], + "start_line": 605, + "end_line": 609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "testtc", + "long_name": "testtc( n , f )", + "filename": "test_ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "n", + "f" + ], + "start_line": 611, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "testf", + "long_name": "testf( x )", + "filename": "test_ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 48, + "parameters": [ + "x" + ], + "start_line": 618, + "end_line": 623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "testinplace", + "long_name": "testinplace( x )", + "filename": "test_ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 626, + "end_line": 632, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "check_testScalarArithmetic", + "long_name": "check_testScalarArithmetic( self )", + "filename": "test_ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 589, + "end_line": 596, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_testToPython", + "long_name": "check_testToPython( self )", + "filename": "test_ma.py", + "nloc": 11, + "complexity": 1, + "token_count": 193, + "parameters": [ + "self" + ], + "start_line": 577, + "end_line": 587, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "nloc": 597, + "complexity": 38, + "token_count": 7800, + "diff_parsed": { + "added": [ + " self.failUnless(bool(array([0,1])))", + " self.failUnless(bool(array([0,0],mask=[0,1])))", + " self.failIf(bool(array([0,0])))", + " self.failIf(bool(array([0,0],mask=[0,0])))", + "", + " def check_testScalarArithmetic(self):", + " xm = array(0, mask=1)", + " self.failUnless((1/array(0)).mask)", + " self.failUnless((1 + xm).mask)", + " self.failUnless((-xm).mask)", + " self.failUnless((-xm).mask)", + " self.failUnless(maximum(xm, xm).mask)", + " self.failUnless(minimum(xm, xm).mask)", + "" + ], + "deleted": [ + "" + ] + } + } + ] + }, + { + "hash": "88cfa336bb8462718bd2ffcaaaa8146460a52f3c", + "msg": "Restore _import_tools.py.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-05T07:29:01+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:29:01+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "8081b28a284049bec54db9479de3e1d34380589a" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 0, + "insertions": 413, + "lines": 413, + "files": 1, + "dmm_unit_size": 0.21299638989169675, + "dmm_unit_complexity": 0.2743682310469314, + "dmm_unit_interfacing": 0.7075812274368231, + "modified_files": [ + { + "old_path": null, + "new_path": "numpy/_import_tools.py", + "filename": "_import_tools.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,413 @@\n+\n+import os\n+import sys\n+import imp\n+from glob import glob\n+\n+class PackageImport:\n+ \"\"\" Import packages from the current directory that implement\n+ info.py. See numpy/doc/DISTUTILS.txt for more info.\n+ \"\"\"\n+\n+ imported_packages = []\n+\n+ def __init__(self):\n+ self.frame = frame = sys._getframe(1)\n+ self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n+ self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n+\n+ def get_info_modules(self,packages=None):\n+ \"\"\"\n+ Return info modules of packages or all packages in parent path.\n+ \"\"\"\n+ if packages is None:\n+ info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n+ else:\n+ info_files = [os.path.join(self.parent_path,package,'info.py') \\\n+ for package in packages]\n+ info_modules = {}\n+ for info_file in info_files:\n+ package_name = os.path.basename(os.path.dirname(info_file))\n+ fullname = self.parent_name +'.'+ package_name\n+ try:\n+ info_module = imp.load_module(fullname+'.info',\n+ open(info_file,'U'),\n+ info_file,\n+ ('.py','U',1))\n+ except Exception,msg:\n+ print >> sys.stderr, msg\n+ info_module = None\n+\n+ if info_module is None:\n+ continue\n+ if getattr(info_module,'ignore',False):\n+ continue\n+\n+ info_modules[fullname] = info_module\n+\n+ return info_modules\n+\n+ def _sort_info_modules(self, info_modules):\n+ \"\"\"\n+ Return package names sorted in the order as they should be\n+ imported due to dependence relations between packages. \n+ \"\"\"\n+ depend_dict = {}\n+ for fullname,info_module in info_modules.items():\n+ depend_dict[fullname] = getattr(info_module,'depends',[])\n+ package_names = []\n+\n+ for name in depend_dict.keys():\n+ if not depend_dict[name]:\n+ package_names.append(name)\n+ del depend_dict[name]\n+\n+ while depend_dict:\n+ for name, lst in depend_dict.items():\n+ new_lst = [n for n in lst if depend_dict.has_key(n)]\n+ if not new_lst:\n+ package_names.append(name)\n+ del depend_dict[name]\n+ else:\n+ depend_dict[name] = new_lst\n+\n+ return package_names\n+\n+ def _get_doc_title(self, info_module):\n+ \"\"\" Get the title from a package info.py file.\n+ \"\"\"\n+ title = getattr(info_module,'__doc_title__',None)\n+ if title is not None:\n+ return title\n+ title = getattr(info_module,'__doc__',None)\n+ if title is not None:\n+ title = title.lstrip().split('\\n',1)[0]\n+ return title\n+ return '* Not Available *'\n+\n+ def _format_titles(self,titles):\n+ lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n+ max_length = max(lengths)\n+ lines = []\n+ for (name,title) in titles:\n+ name = name[name.find('.')+1:]\n+ w = max_length - len(name)\n+ lines.append('%s%s --- %s' % (name, w*' ', title))\n+ return '\\n'.join(lines)\n+\n+ def import_packages(self, packages=None):\n+ \"\"\"\n+ Import packages that implement info.py.\n+ Return a list of documentation strings info.__doc__ of succesfully\n+ imported packages.\n+ \"\"\"\n+ info_modules = self.get_info_modules(packages)\n+ package_names = self._sort_info_modules(info_modules)\n+ frame = self.frame\n+\n+ titles = []\n+\n+ for fullname in package_names:\n+ if fullname in self.imported_packages:\n+ continue\n+ package_name = fullname.split('.')[-1]\n+ info_module = info_modules[fullname]\n+ global_symbols = getattr(info_module,'global_symbols',[])\n+ postpone_import = getattr(info_module,'postpone_import',True)\n+ \n+ try:\n+ #print 'Importing',package_name,'to',self.parent_name\n+ exec ('import '+package_name, frame.f_globals,frame.f_locals)\n+ except Exception,msg:\n+ print >> sys.stderr, 'Failed to import',package_name\n+ print >> sys.stderr, msg\n+ raise\n+ continue\n+\n+ self.imported_packages.append(fullname)\n+\n+ for symbol in global_symbols:\n+ try:\n+ exec ('from '+package_name+' import '+symbol,\n+ frame.f_globals,frame.f_locals)\n+ except Exception,msg:\n+ print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n+ print >> sys.stderr, msg\n+ continue\n+\n+ titles.append((fullname,self._get_doc_title(info_module)))\n+\n+ try:\n+ exec ('\\n%s.test = ScipyTest(%s).test' \\\n+ % (package_name,package_name),\n+ frame.f_globals,frame.f_locals)\n+ except Exception,msg:\n+\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n+ print >> sys.stderr, msg\n+\n+ return self._format_titles(titles)\n+\n+class PackageLoader:\n+ def __init__(self):\n+ \"\"\" Manages loading NumPy packages.\n+ \"\"\"\n+\n+ self.parent_frame = frame = sys._getframe(1)\n+ self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n+ self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n+ if not frame.f_locals.has_key('__all__'):\n+ exec('__all__ = []',frame.f_globals,frame.f_locals)\n+ self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n+\n+ self.info_modules = None\n+ self.imported_packages = []\n+ self.verbose = None\n+\n+ def _get_info_files(self, package_dir, parent_path, parent_package=None):\n+ \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n+ \"\"\"\n+ from glob import glob\n+ files = glob(os.path.join(parent_path,package_dir,'info.py'))\n+ for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n+ if info_file[:-1] not in files:\n+ files.append(info_file)\n+ info_files = []\n+ for info_file in files:\n+ package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n+ .replace(os.sep,'.')\n+ if parent_package:\n+ package_name = parent_package + '.' + package_name\n+ info_files.append((package_name,info_file))\n+ info_files.extend(self._get_info_files('*',\n+ os.path.dirname(info_file),\n+ package_name))\n+ return info_files\n+\n+ def _init_info_modules(self, packages=None):\n+ \"\"\"Initialize info_modules = {: }.\n+ \"\"\"\n+ import imp\n+ info_files = []\n+ if packages is None:\n+ for path in self.parent_path:\n+ info_files.extend(self._get_info_files('*',path))\n+ else:\n+ for package_name in packages:\n+ package_dir = os.path.join(*package_name.split('.'))\n+ for path in self.parent_path:\n+ names_files = self._get_info_files(package_dir, path)\n+ if names_files:\n+ info_files.extend(names_files)\n+ break\n+ else:\n+ self.warn('Package %r does not have info.py file. Ignoring.'\\\n+ % package_name)\n+\n+ info_modules = self.info_modules\n+ for package_name,info_file in info_files:\n+ if info_modules.has_key(package_name):\n+ continue\n+ fullname = self.parent_name +'.'+ package_name\n+ if info_file[-1]=='c':\n+ filedescriptor = ('.pyc','rb',2)\n+ else:\n+ filedescriptor = ('.py','U',1)\n+\n+ try:\n+ info_module = imp.load_module(fullname+'.info',\n+ open(info_file,filedescriptor[1]),\n+ info_file,\n+ filedescriptor)\n+ except Exception,msg:\n+ self.error(msg)\n+ info_module = None\n+\n+ if info_module is None or getattr(info_module,'ignore',False):\n+ info_modules.pop(package_name,None)\n+ else:\n+ self._init_info_modules(getattr(info_module,'depends',[]))\n+ info_modules[package_name] = info_module\n+\n+ return\n+\n+ def _get_sorted_names(self):\n+ \"\"\" Return package names sorted in the order as they should be\n+ imported due to dependence relations between packages. \n+ \"\"\"\n+\n+ depend_dict = {}\n+ for name,info_module in self.info_modules.items():\n+ depend_dict[name] = getattr(info_module,'depends',[])\n+ package_names = []\n+\n+ for name in depend_dict.keys():\n+ if not depend_dict[name]:\n+ package_names.append(name)\n+ del depend_dict[name]\n+\n+ while depend_dict:\n+ for name, lst in depend_dict.items():\n+ new_lst = [n for n in lst if depend_dict.has_key(n)]\n+ if not new_lst:\n+ package_names.append(name)\n+ del depend_dict[name]\n+ else:\n+ depend_dict[name] = new_lst\n+\n+ return package_names\n+\n+ def __call__(self,*packages, **options):\n+ \"\"\"Load one or more packages into numpy's top-level namespace.\n+\n+ Usage:\n+\n+ This function is intended to shorten the need to import many of numpy's\n+ submodules constantly with statements such as\n+\n+ import numpy.linalg, numpy.fft, numpy.etc...\n+\n+ Instead, you can say:\n+\n+ import numpy\n+ numpy.pkgload('linalg','fft',...)\n+\n+ or\n+\n+ numpy.pkgload()\n+\n+ to load all of them in one call.\n+\n+ If a name which doesn't exist in numpy's namespace is\n+ given, an exception [[WHAT? ImportError, probably?]] is raised.\n+ [NotImplemented]\n+\n+ Inputs:\n+\n+ - the names (one or more strings) of all the numpy modules one wishes to\n+ load into the top-level namespace.\n+\n+ Optional keyword inputs:\n+\n+ - verbose - integer specifying verbosity level [default: 0].\n+ - force - when True, force reloading loaded packages [default: False].\n+ - postpone - when True, don't load packages [default: False]\n+\n+ If no input arguments are given, then all of numpy's subpackages are\n+ imported.\n+\n+\n+ Outputs:\n+\n+ The function returns a tuple with all the names of the modules which\n+ were actually imported. [NotImplemented]\n+\n+ \"\"\"\n+ frame = self.parent_frame\n+ self.info_modules = {}\n+ if options.get('force',False):\n+ self.imported_packages = []\n+ self.verbose = verbose = options.get('verbose',False)\n+ postpone = options.get('postpone',False)\n+\n+ self._init_info_modules(packages or None)\n+\n+ self.log('Imports to %r namespace\\n----------------------------'\\\n+ % self.parent_name)\n+\n+ for package_name in self._get_sorted_names():\n+ if package_name in self.imported_packages:\n+ continue\n+ info_module = self.info_modules[package_name]\n+ global_symbols = getattr(info_module,'global_symbols',[]) \n+ if postpone and not global_symbols:\n+ self.log('__all__.append(%r)' % (package_name))\n+ if '.' not in package_name:\n+ self.parent_export_names.append(package_name)\n+ continue\n+ \n+ old_object = frame.f_locals.get(package_name,None)\n+\n+ cmdstr = 'import '+package_name\n+ if self._execcmd(cmdstr):\n+ continue\n+ self.imported_packages.append(package_name)\n+ \n+ if verbose!=-1:\n+ new_object = frame.f_locals.get(package_name)\n+ if old_object is not None and old_object is not new_object:\n+ self.warn('Overwriting %s=%s (was %s)' \\\n+ % (package_name,self._obj2str(new_object),\n+ self._obj2str(old_object)))\n+\n+ if '.' not in package_name:\n+ self.parent_export_names.append(package_name)\n+\n+ for symbol in global_symbols:\n+ if symbol=='*':\n+ symbols = eval('getattr(%s,\"__all__\",None)'\\\n+ % (package_name),\n+ frame.f_globals,frame.f_locals)\n+ if symbols is None:\n+ symbols = eval('dir(%s)' % (package_name),\n+ frame.f_globals,frame.f_locals)\n+ symbols = filter(lambda s:not s.startswith('_'),symbols)\n+ else:\n+ symbols = [symbol]\n+\n+ if verbose!=-1:\n+ old_objects = {}\n+ for s in symbols:\n+ if frame.f_locals.has_key(s):\n+ old_objects[s] = frame.f_locals[s]\n+\n+ cmdstr = 'from '+package_name+' import '+symbol\n+ if self._execcmd(cmdstr):\n+ continue\n+\n+ if verbose!=-1:\n+ for s,old_object in old_objects.items():\n+ new_object = frame.f_locals[s]\n+ if new_object is not old_object:\n+ self.warn('Overwriting %s=%s (was %s)' \\\n+ % (s,self._obj2repr(new_object),\n+ self._obj2repr(old_object)))\n+\n+ if symbol=='*':\n+ self.parent_export_names.extend(symbols)\n+ else:\n+ self.parent_export_names.append(symbol)\n+\n+ return\n+\n+ def _execcmd(self,cmdstr):\n+ \"\"\" Execute command in parent_frame.\"\"\"\n+ frame = self.parent_frame\n+ try:\n+ exec (cmdstr, frame.f_globals,frame.f_locals)\n+ except Exception,msg:\n+ self.error('%s -> failed: %s' % (cmdstr,msg))\n+ return True\n+ else:\n+ self.log('%s -> success' % (cmdstr)) \n+ return\n+\n+ def _obj2repr(self,obj):\n+ \"\"\" Return repr(obj) with\"\"\"\n+ module = getattr(obj,'__module__',None)\n+ file = getattr(obj,'__file__',None)\n+ if module is not None:\n+ return repr(obj) + ' from ' + module\n+ if file is not None:\n+ return repr(obj) + ' from ' + file\n+ return repr(obj)\n+\n+ def log(self,mess):\n+ if self.verbose>1:\n+ print >> sys.stderr, str(mess)\n+ def warn(self,mess):\n+ if self.verbose>=0:\n+ print >> sys.stderr, str(mess)\n+ def error(self,mess):\n+ if self.verbose!=-1:\n+ print >> sys.stderr, str(mess)\n+\n", + "added_lines": 413, + "deleted_lines": 0, + "source_code": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\n", + "source_code_before": null, + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + } + ], + "nloc": 287, + "complexity": 93, + "token_count": 2071, + "diff_parsed": { + "added": [ + "", + "import os", + "import sys", + "import imp", + "from glob import glob", + "", + "class PackageImport:", + " \"\"\" Import packages from the current directory that implement", + " info.py. See numpy/doc/DISTUTILS.txt for more info.", + " \"\"\"", + "", + " imported_packages = []", + "", + " def __init__(self):", + " self.frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)", + "", + " def get_info_modules(self,packages=None):", + " \"\"\"", + " Return info modules of packages or all packages in parent path.", + " \"\"\"", + " if packages is None:", + " info_files = glob(os.path.join(self.parent_path,'*','info.py'))", + " else:", + " info_files = [os.path.join(self.parent_path,package,'info.py') \\", + " for package in packages]", + " info_modules = {}", + " for info_file in info_files:", + " package_name = os.path.basename(os.path.dirname(info_file))", + " fullname = self.parent_name +'.'+ package_name", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,'U'),", + " info_file,", + " ('.py','U',1))", + " except Exception,msg:", + " print >> sys.stderr, msg", + " info_module = None", + "", + " if info_module is None:", + " continue", + " if getattr(info_module,'ignore',False):", + " continue", + "", + " info_modules[fullname] = info_module", + "", + " return info_modules", + "", + " def _sort_info_modules(self, info_modules):", + " \"\"\"", + " Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + " depend_dict = {}", + " for fullname,info_module in info_modules.items():", + " depend_dict[fullname] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def _get_doc_title(self, info_module):", + " \"\"\" Get the title from a package info.py file.", + " \"\"\"", + " title = getattr(info_module,'__doc_title__',None)", + " if title is not None:", + " return title", + " title = getattr(info_module,'__doc__',None)", + " if title is not None:", + " title = title.lstrip().split('\\n',1)[0]", + " return title", + " return '* Not Available *'", + "", + " def _format_titles(self,titles):", + " lengths = [len(name)-name.find('.')-1 for (name,title) in titles]", + " max_length = max(lengths)", + " lines = []", + " for (name,title) in titles:", + " name = name[name.find('.')+1:]", + " w = max_length - len(name)", + " lines.append('%s%s --- %s' % (name, w*' ', title))", + " return '\\n'.join(lines)", + "", + " def import_packages(self, packages=None):", + " \"\"\"", + " Import packages that implement info.py.", + " Return a list of documentation strings info.__doc__ of succesfully", + " imported packages.", + " \"\"\"", + " info_modules = self.get_info_modules(packages)", + " package_names = self._sort_info_modules(info_modules)", + " frame = self.frame", + "", + " titles = []", + "", + " for fullname in package_names:", + " if fullname in self.imported_packages:", + " continue", + " package_name = fullname.split('.')[-1]", + " info_module = info_modules[fullname]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " postpone_import = getattr(info_module,'postpone_import',True)", + "", + " try:", + " #print 'Importing',package_name,'to',self.parent_name", + " exec ('import '+package_name, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " print >> sys.stderr, 'Failed to import',package_name", + " print >> sys.stderr, msg", + " raise", + " continue", + "", + " self.imported_packages.append(fullname)", + "", + " for symbol in global_symbols:", + " try:", + " exec ('from '+package_name+' import '+symbol,", + " frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " print >> sys.stderr, 'Failed to import',symbol,'from',package_name", + " print >> sys.stderr, msg", + " continue", + "", + " titles.append((fullname,self._get_doc_title(info_module)))", + "", + " try:", + " exec ('\\n%s.test = ScipyTest(%s).test' \\", + " % (package_name,package_name),", + " frame.f_globals,frame.f_locals)", + " except Exception,msg:", + "\t\tprint >> sys.stderr, 'Failed to set test function for',package_name", + " print >> sys.stderr, msg", + "", + " return self._format_titles(titles)", + "", + "class PackageLoader:", + " def __init__(self):", + " \"\"\" Manages loading NumPy packages.", + " \"\"\"", + "", + " self.parent_frame = frame = sys._getframe(1)", + " self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)", + " self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)", + " if not frame.f_locals.has_key('__all__'):", + " exec('__all__ = []',frame.f_globals,frame.f_locals)", + " self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)", + "", + " self.info_modules = None", + " self.imported_packages = []", + " self.verbose = None", + "", + " def _get_info_files(self, package_dir, parent_path, parent_package=None):", + " \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.", + " \"\"\"", + " from glob import glob", + " files = glob(os.path.join(parent_path,package_dir,'info.py'))", + " for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):", + " if info_file[:-1] not in files:", + " files.append(info_file)", + " info_files = []", + " for info_file in files:", + " package_name = os.path.dirname(info_file[len(parent_path)+1:])\\", + " .replace(os.sep,'.')", + " if parent_package:", + " package_name = parent_package + '.' + package_name", + " info_files.append((package_name,info_file))", + " info_files.extend(self._get_info_files('*',", + " os.path.dirname(info_file),", + " package_name))", + " return info_files", + "", + " def _init_info_modules(self, packages=None):", + " \"\"\"Initialize info_modules = {: }.", + " \"\"\"", + " import imp", + " info_files = []", + " if packages is None:", + " for path in self.parent_path:", + " info_files.extend(self._get_info_files('*',path))", + " else:", + " for package_name in packages:", + " package_dir = os.path.join(*package_name.split('.'))", + " for path in self.parent_path:", + " names_files = self._get_info_files(package_dir, path)", + " if names_files:", + " info_files.extend(names_files)", + " break", + " else:", + " self.warn('Package %r does not have info.py file. Ignoring.'\\", + " % package_name)", + "", + " info_modules = self.info_modules", + " for package_name,info_file in info_files:", + " if info_modules.has_key(package_name):", + " continue", + " fullname = self.parent_name +'.'+ package_name", + " if info_file[-1]=='c':", + " filedescriptor = ('.pyc','rb',2)", + " else:", + " filedescriptor = ('.py','U',1)", + "", + " try:", + " info_module = imp.load_module(fullname+'.info',", + " open(info_file,filedescriptor[1]),", + " info_file,", + " filedescriptor)", + " except Exception,msg:", + " self.error(msg)", + " info_module = None", + "", + " if info_module is None or getattr(info_module,'ignore',False):", + " info_modules.pop(package_name,None)", + " else:", + " self._init_info_modules(getattr(info_module,'depends',[]))", + " info_modules[package_name] = info_module", + "", + " return", + "", + " def _get_sorted_names(self):", + " \"\"\" Return package names sorted in the order as they should be", + " imported due to dependence relations between packages.", + " \"\"\"", + "", + " depend_dict = {}", + " for name,info_module in self.info_modules.items():", + " depend_dict[name] = getattr(info_module,'depends',[])", + " package_names = []", + "", + " for name in depend_dict.keys():", + " if not depend_dict[name]:", + " package_names.append(name)", + " del depend_dict[name]", + "", + " while depend_dict:", + " for name, lst in depend_dict.items():", + " new_lst = [n for n in lst if depend_dict.has_key(n)]", + " if not new_lst:", + " package_names.append(name)", + " del depend_dict[name]", + " else:", + " depend_dict[name] = new_lst", + "", + " return package_names", + "", + " def __call__(self,*packages, **options):", + " \"\"\"Load one or more packages into numpy's top-level namespace.", + "", + " Usage:", + "", + " This function is intended to shorten the need to import many of numpy's", + " submodules constantly with statements such as", + "", + " import numpy.linalg, numpy.fft, numpy.etc...", + "", + " Instead, you can say:", + "", + " import numpy", + " numpy.pkgload('linalg','fft',...)", + "", + " or", + "", + " numpy.pkgload()", + "", + " to load all of them in one call.", + "", + " If a name which doesn't exist in numpy's namespace is", + " given, an exception [[WHAT? ImportError, probably?]] is raised.", + " [NotImplemented]", + "", + " Inputs:", + "", + " - the names (one or more strings) of all the numpy modules one wishes to", + " load into the top-level namespace.", + "", + " Optional keyword inputs:", + "", + " - verbose - integer specifying verbosity level [default: 0].", + " - force - when True, force reloading loaded packages [default: False].", + " - postpone - when True, don't load packages [default: False]", + "", + " If no input arguments are given, then all of numpy's subpackages are", + " imported.", + "", + "", + " Outputs:", + "", + " The function returns a tuple with all the names of the modules which", + " were actually imported. [NotImplemented]", + "", + " \"\"\"", + " frame = self.parent_frame", + " self.info_modules = {}", + " if options.get('force',False):", + " self.imported_packages = []", + " self.verbose = verbose = options.get('verbose',False)", + " postpone = options.get('postpone',False)", + "", + " self._init_info_modules(packages or None)", + "", + " self.log('Imports to %r namespace\\n----------------------------'\\", + " % self.parent_name)", + "", + " for package_name in self._get_sorted_names():", + " if package_name in self.imported_packages:", + " continue", + " info_module = self.info_modules[package_name]", + " global_symbols = getattr(info_module,'global_symbols',[])", + " if postpone and not global_symbols:", + " self.log('__all__.append(%r)' % (package_name))", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + " continue", + "", + " old_object = frame.f_locals.get(package_name,None)", + "", + " cmdstr = 'import '+package_name", + " if self._execcmd(cmdstr):", + " continue", + " self.imported_packages.append(package_name)", + "", + " if verbose!=-1:", + " new_object = frame.f_locals.get(package_name)", + " if old_object is not None and old_object is not new_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (package_name,self._obj2str(new_object),", + " self._obj2str(old_object)))", + "", + " if '.' not in package_name:", + " self.parent_export_names.append(package_name)", + "", + " for symbol in global_symbols:", + " if symbol=='*':", + " symbols = eval('getattr(%s,\"__all__\",None)'\\", + " % (package_name),", + " frame.f_globals,frame.f_locals)", + " if symbols is None:", + " symbols = eval('dir(%s)' % (package_name),", + " frame.f_globals,frame.f_locals)", + " symbols = filter(lambda s:not s.startswith('_'),symbols)", + " else:", + " symbols = [symbol]", + "", + " if verbose!=-1:", + " old_objects = {}", + " for s in symbols:", + " if frame.f_locals.has_key(s):", + " old_objects[s] = frame.f_locals[s]", + "", + " cmdstr = 'from '+package_name+' import '+symbol", + " if self._execcmd(cmdstr):", + " continue", + "", + " if verbose!=-1:", + " for s,old_object in old_objects.items():", + " new_object = frame.f_locals[s]", + " if new_object is not old_object:", + " self.warn('Overwriting %s=%s (was %s)' \\", + " % (s,self._obj2repr(new_object),", + " self._obj2repr(old_object)))", + "", + " if symbol=='*':", + " self.parent_export_names.extend(symbols)", + " else:", + " self.parent_export_names.append(symbol)", + "", + " return", + "", + " def _execcmd(self,cmdstr):", + " \"\"\" Execute command in parent_frame.\"\"\"", + " frame = self.parent_frame", + " try:", + " exec (cmdstr, frame.f_globals,frame.f_locals)", + " except Exception,msg:", + " self.error('%s -> failed: %s' % (cmdstr,msg))", + " return True", + " else:", + " self.log('%s -> success' % (cmdstr))", + " return", + "", + " def _obj2repr(self,obj):", + " \"\"\" Return repr(obj) with\"\"\"", + " module = getattr(obj,'__module__',None)", + " file = getattr(obj,'__file__',None)", + " if module is not None:", + " return repr(obj) + ' from ' + module", + " if file is not None:", + " return repr(obj) + ' from ' + file", + " return repr(obj)", + "", + " def log(self,mess):", + " if self.verbose>1:", + " print >> sys.stderr, str(mess)", + " def warn(self,mess):", + " if self.verbose>=0:", + " print >> sys.stderr, str(mess)", + " def error(self,mess):", + " if self.verbose!=-1:", + " print >> sys.stderr, str(mess)", + "" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "de399f0bc36d35703bb87a79ce3510c7ccada586", + "msg": "Fixed name change.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-05T07:31:57+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T07:31:57+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "88cfa336bb8462718bd2ffcaaaa8146460a52f3c" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 1, + "insertions": 1, + "lines": 2, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/distutils/misc_util.py", + "new_path": "numpy/distutils/misc_util.py", + "filename": "misc_util.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -865,7 +865,7 @@ def get_numpy_include_dirs():\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n- if numpy.show_core_config is None:\n+ if numpy.show_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n 'core','include'))\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import os\nimport re\nimport sys\nimport imp\nimport copy\nimport types\nimport glob\n\ndef allpath(name):\n \"Convert a /-separated pathname to one using the OS's path separator.\"\n splitted = name.split('/')\n return os.path.join(*splitted)\n\ndef get_path(mod_name,parent_path=None):\n \"\"\" Return path of the module.\n\n Returned path is relative to parent_path when given,\n otherwise it is absolute path.\n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n __import__(mod_name)\n mod = sys.modules[mod_name]\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n if parent_path is not None:\n pd = os.path.abspath(parent_path)\n if pd==d[:len(pd)]:\n d = d[len(pd)+1:]\n return d or '.'\n\n# Hooks for colored terminal output.\n# See also http://www.livinglogic.de/Python/ansistyle\ndef terminal_has_colors():\n if sys.platform=='cygwin' and not os.environ.has_key('USE_COLOR'):\n # Avoid importing curses that causes illegal operation\n # with a message:\n # PYTHON2 caused an invalid page fault in\n # module CYGNURSES7.DLL as 015f:18bbfc28\n # Details: Python 2.3.3 [GCC 3.3.1 (cygming special)]\n # ssh to Win32 machine from debian\n # curses.version is 2.2\n # CYGWIN_98-4.10, release 1.5.7(0.109/3/2))\n return 0\n if hasattr(sys.stdout,'isatty') and sys.stdout.isatty(): \n try:\n import curses\n curses.setupterm()\n if (curses.tigetnum(\"colors\") >= 0\n and curses.tigetnum(\"pairs\") >= 0\n and ((curses.tigetstr(\"setf\") is not None \n and curses.tigetstr(\"setb\") is not None) \n or (curses.tigetstr(\"setaf\") is not None\n and curses.tigetstr(\"setab\") is not None)\n or curses.tigetstr(\"scp\") is not None)):\n return 1\n except Exception,msg:\n pass\n return 0\n\nif terminal_has_colors():\n def red_text(s): return '\\x1b[31m%s\\x1b[0m'%s\n def green_text(s): return '\\x1b[32m%s\\x1b[0m'%s\n def yellow_text(s): return '\\x1b[33m%s\\x1b[0m'%s\n def blue_text(s): return '\\x1b[34m%s\\x1b[0m'%s\n def cyan_text(s): return '\\x1b[35m%s\\x1b[0m'%s\nelse:\n def red_text(s): return s\n def green_text(s): return s\n def yellow_text(s): return s\n def cyan_text(s): return s\n def blue_text(s): return s\n\n#########################\n\ndef cyg2win32(path):\n if sys.platform=='cygwin' and path.startswith('/cygdrive'):\n path = path[10] + ':' + os.path.normcase(path[11:])\n return path\n\n#########################\n\n#XXX need support for .C that is also C++\ncxx_ext_match = re.compile(r'.*[.](cpp|cxx|cc)\\Z',re.I).match\nfortran_ext_match = re.compile(r'.*[.](f90|f95|f77|for|ftn|f)\\Z',re.I).match\nf90_ext_match = re.compile(r'.*[.](f90|f95)\\Z',re.I).match\nf90_module_name_match = re.compile(r'\\s*module\\s*(?P[\\w_]+)',re.I).match\ndef _get_f90_modules(source):\n \"\"\" Return a list of Fortran f90 module names that\n given source file defines.\n \"\"\"\n if not f90_ext_match(source):\n return []\n modules = []\n f = open(source,'r')\n f_readlines = getattr(f,'xreadlines',f.readlines)\n for line in f_readlines():\n m = f90_module_name_match(line)\n if m:\n name = m.group('name')\n modules.append(name)\n # break # XXX can we assume that there is one module per file?\n f.close()\n return modules\n\ndef all_strings(lst):\n \"\"\" Return True if all items in lst are string objects. \"\"\"\n for item in lst:\n if type(item) is not types.StringType:\n return False\n return True\n\ndef has_f_sources(sources):\n \"\"\" Return True if sources contains Fortran files \"\"\"\n for source in sources:\n if fortran_ext_match(source):\n return True\n return False\n\ndef has_cxx_sources(sources):\n \"\"\" Return True if sources contains C++ files \"\"\"\n for source in sources:\n if cxx_ext_match(source):\n return True\n return False\n\ndef filter_sources(sources):\n \"\"\" Return four lists of filenames containing\n C, C++, Fortran, and Fortran 90 module sources,\n respectively.\n \"\"\"\n c_sources = []\n cxx_sources = []\n f_sources = []\n fmodule_sources = []\n for source in sources:\n if fortran_ext_match(source):\n modules = _get_f90_modules(source)\n if modules:\n fmodule_sources.append(source)\n else:\n f_sources.append(source)\n elif cxx_ext_match(source):\n cxx_sources.append(source)\n else:\n c_sources.append(source) \n return c_sources, cxx_sources, f_sources, fmodule_sources\n\n\ndef _get_headers(directory_list):\n # get *.h files from list of directories\n headers = []\n for dir in directory_list:\n head = glob.glob(os.path.join(dir,\"*.h\")) #XXX: *.hpp files??\n headers.extend(head)\n return headers\n\ndef _get_directories(list_of_sources):\n # get unique directories from list of sources.\n direcs = []\n for file in list_of_sources:\n dir = os.path.split(file)\n if dir[0] != '' and not dir[0] in direcs:\n direcs.append(dir[0])\n return direcs\n\ndef get_dependencies(sources):\n #XXX scan sources for include statements\n return _get_headers(_get_directories(sources))\n\ndef is_local_src_dir(directory):\n \"\"\" Return true if directory is local directory.\n \"\"\"\n if type(directory) is not type(''):\n return False\n abs_dir = os.path.abspath(directory)\n c = os.path.commonprefix([os.getcwd(),abs_dir])\n new_dir = abs_dir[len(c):].split(os.sep)\n if new_dir and not new_dir[0]:\n new_dir = new_dir[1:]\n if new_dir and new_dir[0]=='build':\n return False\n new_dir = os.sep.join(new_dir)\n return os.path.isdir(new_dir)\n\ndef _gsf_visit_func(filenames,dirname,names):\n if os.path.basename(dirname) in ['CVS','.svn','build']:\n names[:] = []\n return\n for name in names:\n if name[-1] in \"~#\":\n continue\n fullname = os.path.join(dirname,name)\n ext = os.path.splitext(fullname)[1]\n if ext and ext in ['.pyc','.o']:\n continue\n if os.path.isfile(fullname):\n filenames.append(fullname)\n\ndef get_ext_source_files(ext):\n # Get sources and any include files in the same directory.\n filenames = []\n sources = filter(lambda s:type(s) is types.StringType,ext.sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n for d in ext.depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_script_files(scripts):\n scripts = filter(lambda s:type(s) is types.StringType,scripts)\n return scripts\n\ndef get_lib_source_files(lib):\n filenames = []\n sources = lib[1].get('sources',[])\n sources = filter(lambda s:type(s) is types.StringType,sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n depends = lib[1].get('depends',[])\n for d in depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_data_files(data):\n if type(data) is types.StringType:\n return [data]\n sources = data[1]\n filenames = []\n for s in sources:\n if callable(s):\n s = s()\n if s is None:\n continue\n if is_local_src_dir(s):\n os.path.walk(s,_gsf_visit_func,filenames)\n elif type(s) is type(''):\n if os.path.isfile(s):\n filenames.append(s)\n else:\n print 'Not existing data file:',s\n else:\n raise TypeError,`s`\n return filenames\n\ndef dot_join(*args):\n return '.'.join(filter(None,args))\n\ndef get_frame(level=0):\n try:\n return sys._getframe(level+1)\n except AttributeError:\n frame = sys.exc_info()[2].tb_frame\n for i in range(level+1):\n frame = frame.f_back\n return frame\n\n######################\n\nclass Configuration:\n\n _list_keys = ['packages','ext_modules','data_files','include_dirs',\n 'libraries','headers','scripts']\n _dict_keys = ['package_dir']\n\n numpy_include_dirs = []\n\n def __init__(self,\n package_name=None,\n parent_name=None,\n top_path=None,\n package_path=None,\n **attrs):\n \"\"\" Construct configuration instance of a package.\n \"\"\"\n self.name = dot_join(parent_name, package_name)\n\n caller_frame = get_frame(1)\n caller_name = eval('__name__',caller_frame.f_globals,caller_frame.f_locals)\n \n self.local_path = get_path(caller_name, top_path)\n if top_path is None:\n top_path = self.local_path\n if package_path is None:\n package_path = self.local_path\n elif os.path.isdir(os.path.join(self.local_path,package_path)):\n package_path = os.path.join(self.local_path,package_path)\n assert os.path.isdir(package_path),`package_path`\n self.top_path = top_path\n\n self.list_keys = copy.copy(self._list_keys)\n self.dict_keys = copy.copy(self._dict_keys)\n\n for n in self.list_keys:\n setattr(self,n,copy.copy(attrs.get(n,[])))\n\n for n in self.dict_keys:\n setattr(self,n,copy.copy(attrs.get(n,{})))\n\n known_keys = self.list_keys + self.dict_keys\n self.extra_keys = []\n for n in attrs.keys():\n if n in known_keys:\n continue\n a = attrs[n]\n setattr(self,n,a)\n if type(a) is types.ListType:\n self.list_keys.append(n)\n elif type(a) is types.DictType:\n self.dict_keys.append(n)\n else:\n self.extra_keys.append(n)\n\n if os.path.exists(os.path.join(package_path,'__init__.py')):\n self.packages.append(self.name)\n self.package_dir[self.name] = package_path \n return\n\n def todict(self):\n \"\"\" Return configuration distionary suitable for passing\n to distutils.core.setup() function.\n \"\"\"\n d = {}\n for n in self.list_keys + self.dict_keys + self.extra_keys:\n a = getattr(self,n)\n if a:\n d[n] = a\n if self.name:\n d['name'] = self.name\n return d\n\n def __dict__(self):\n return self.todict()\n\n def get_distribution(self):\n import distutils.core\n dist = distutils.core._setup_distribution \n return dist\n\n def get_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Return subpackage configuration.\n \"\"\"\n if subpackage_name is None:\n assert subpackage_path is not None\n subpackage_name = os.path.basename(subpackage_path)\n assert '.' not in subpackage_name,`subpackage_name`\n if subpackage_path is None:\n subpackage_path = os.path.join(self.local_path,subpackage_name)\n else:\n subpackage_path = self._fix_paths([subpackage_path])[0]\n\n setup_py = os.path.join(subpackage_path,'setup_%s.py' % (subpackage_name))\n if not os.path.isfile(setup_py):\n setup_py = os.path.join(subpackage_path,'setup.py')\n if not os.path.isfile(setup_py):\n print 'Assuming default configuration '\\\n '(%s/{setup_%s,setup}.py was not found)' \\\n % (os.path.dirname(setup_py),subpackage_name)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n # In case setup_py imports local modules:\n sys.path.insert(0,os.path.dirname(setup_py))\n try:\n info = (open(setup_py),setup_py,('.py','U',1))\n setup_name = os.path.splitext(os.path.basename(setup_py))[0]\n n = dot_join(self.name,setup_name)\n setup_module = imp.load_module('_'.join(n.split('.')),*info)\n\n if not hasattr(setup_module,'configuration'):\n print 'Assuming default configuration '\\\n '(%s does not define configuration())' % (setup_module)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n args = (self.name,)\n if setup_module.configuration.func_code.co_argcount>1:\n args = args + (self.top_path,)\n config = setup_module.configuration(*args)\n\n finally:\n del sys.path[0]\n\n return config\n\n def add_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Add subpackage to configuration.\n \"\"\"\n config = self.get_subpackage(subpackage_name,subpackage_path)\n\n if not config:\n print 'No configuration returned, assuming unavailable.'\n else:\n\n if isinstance(config,Configuration):\n print 'Appending %s configuration to %s' % (config.name,self.name)\n self.dict_append(**config.todict())\n else:\n print 'Appending %s configuration to %s' % (config.get('name'),self.name)\n self.dict_append(**config)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a subpackage', subpackage_name\n return\n\n def add_data_dir(self,data_path):\n \"\"\" Recursively add files under data_path to data_files list.\n Argument can be either\n - 2-sequence (,)\n - path to data directory where python datadir suffix defaults\n to package dir.\n If path is not absolute then it's datadir suffix is\n package dir + subdirname of the path.\n \"\"\"\n if type(data_path) is type(()):\n assert len(data_path)==2,`data_path`\n d,data_path = data_path\n else:\n d = None\n assert type(data_path) is type(''),`data_path`\n for path in self.paths(data_path):\n if not os.path.exists(path):\n print 'Not existing data path',path\n continue\n filenames = []\n os.path.walk(path, _gsf_visit_func,filenames)\n if not os.path.isabs(path):\n if d is None:\n ds = os.path.join(*(self.name.split('.')+[data_path]))\n else:\n ds = os.path.join(d,data_path)\n self.add_data_files((ds,filenames))\n else:\n if d is None:\n self.add_data_files(*filenames)\n else:\n self.add_data_files((d,filenames))\n return\n\n def add_data_files(self,*files):\n \"\"\" Add data files to configuration data_files.\n Argument(s) can be either\n - 2-sequence (,)\n - paths to data files where python datadir prefix defaults\n to package dir.\n If path is not absolute then it's datadir prefix is\n package dir + dirname of the path.\n \"\"\"\n data_dict = {}\n new_files = []\n for p in files:\n if type(p) is not type(()):\n d = os.path.join(*(self.name.split('.')))\n if type(p) is type('') and not os.path.isabs(p):\n d = appendpath(d,os.path.dirname(p))\n p = (d,p)\n new_files.append(p)\n files = []\n for prefix,filepattern in new_files:\n if type(filepattern) is type(''):\n file_list = self.paths(filepattern)\n elif callable(filepattern):\n file_list = [filepattern]\n else:\n file_list = self.paths(*filepattern)\n\n nof_path_components = [len(f.split(os.sep)) \\\n for f in file_list if type(f) is type('')]\n if nof_path_components:\n min_path_components = min(nof_path_components)-1\n else:\n min_path_components = 0\n\n for f in file_list:\n if type(f) is type(''):\n extra_path_components = f.split(os.sep)[min_path_components:-1]\n p = os.path.join(*([prefix]+extra_path_components))\n else:\n p = prefix\n if not data_dict.has_key(p):\n data_dict[p] = [f]\n else:\n data_dict[p].append(f)\n\n dist = self.get_distribution()\n if dist is not None:\n dist.data_files.extend(data_dict.items())\n else:\n self.data_files.extend(data_dict.items())\n return \n \n def add_include_dirs(self,*paths):\n \"\"\" Add paths to configuration include directories.\n \"\"\"\n include_dirs = self._fix_paths(paths)\n dist = self.get_distribution()\n if dist is not None:\n dist.include_dirs.extend(include_dirs)\n else:\n self.include_dirs.extend(include_dirs)\n return\n\n def add_headers(self,*files):\n \"\"\" Add installable headers to configuration.\n Argument(s) can be either\n - 2-sequence (,)\n - path(s) to header file(s) where python includedir suffix will default\n to package name.\n \"\"\"\n headers = []\n for path in files:\n if type(path) is type(''):\n [headers.append((self.name,p)) for p in self.paths(path)]\n else:\n assert type(path) in [type(()),type([])] and len(path)==2,`path`\n [headers.append((path[0],p)) for p in self.paths(path[1])]\n dist = self.get_distribution()\n if dist is not None:\n dist.headers.extend(headers)\n else:\n self.headers.extend(headers)\n return\n\n def _fix_paths(self,paths):\n new_paths = []\n for n in paths:\n if isinstance(n,str):\n if '*' in n or '?' in n:\n p = glob.glob(n)\n p2 = glob.glob(os.path.join(self.local_path,n))\n if p2:\n new_paths.extend(p2)\n elif p:\n new_paths.extend(p)\n else:\n new_paths.append(n)\n else:\n n2 = os.path.join(self.local_path,n)\n if os.path.exists(n2):\n new_paths.append(n2)\n else:\n new_paths.append(n)\n else:\n new_paths.append(n)\n return new_paths\n\n def paths(self,*paths):\n \"\"\" Apply glob to paths and prepend local_path if needed.\n \"\"\"\n return self._fix_paths(paths)\n\n def add_extension(self,name,sources,**kw):\n \"\"\" Add extension to configuration.\n\n Keywords:\n include_dirs, define_macros, undef_macros,\n library_dirs, libraries, runtime_library_dirs,\n extra_objects, extra_compile_args, extra_link_args,\n export_symbols, swig_opts, depends, language,\n f2py_options, module_dirs\n extra_info - dict or list of dict of keywords to be\n appended to keywords.\n \"\"\"\n ext_args = copy.copy(kw)\n ext_args['name'] = dot_join(self.name,name)\n ext_args['sources'] = sources\n\n if ext_args.has_key('extra_info'):\n extra_info = ext_args['extra_info']\n del ext_args['extra_info']\n if type(extra_info) is type({}):\n extra_info = [extra_info]\n for info in extra_info:\n assert type(info) is type({}),`info`\n dict_append(ext_args,**info)\n\n for k in ext_args.keys():\n v = ext_args[k]\n if k in ['sources','depends','include_dirs','library_dirs',\n 'module_dirs','extra_objects']:\n new_v = self._fix_paths(v)\n ext_args[k] = new_v\n\n # Resolve out-of-tree dependencies\n libraries = ext_args.get('libraries',[])\n libnames = []\n ext_args['libraries'] = []\n for libname in libraries:\n if '@' in libname:\n lname,lpath = libname.split('@',1)\n lpath = os.path.abspath(os.path.join(self.local_path,lpath))\n if os.path.isdir(lpath):\n c = self.get_subpackage(None,lpath)\n if isinstance(c,Configuration):\n c = c.todict()\n for l in [l[0] for l in c.get('libraries',[])]:\n llname = l.split('__OF__',1)[0]\n if llname == lname:\n c.pop('name',None)\n dict_append(ext_args,**c)\n break\n continue\n libnames.append(libname)\n\n ext_args['libraries'] = libnames + ext_args['libraries']\n\n from numpy.distutils.core import Extension\n ext = Extension(**ext_args)\n self.ext_modules.append(ext)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add an extension', name\n return ext\n\n def add_library(self,name,sources,**build_info):\n \"\"\" Add library to configuration.\n \n Valid keywords for build_info:\n depends\n macros\n include_dirs\n extra_compiler_args\n f2py_options\n \"\"\"\n build_info = copy.copy(build_info)\n name = name #+ '__OF__' + self.name\n build_info['sources'] = sources\n\n for k in build_info.keys():\n v = build_info[k]\n if k in ['sources','depends']:\n new_v = self._fix_paths(v)\n build_info[k] = new_v\n self.libraries.append((name,build_info))\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a library', name\n return\n\n def add_scripts(self,*files):\n \"\"\" Add scripts to configuration.\n \"\"\"\n scripts = self._fix_paths(files)\n dist = self.get_distribution()\n if dist is not None:\n dist.scripts.extend(scripts)\n else:\n self.scripts.extend(scripts)\n return\n\n def dict_append(self,**dict):\n for key in self.list_keys:\n a = getattr(self,key)\n a.extend(dict.get(key,[]))\n for key in self.dict_keys:\n a = getattr(self,key)\n a.update(dict.get(key,{}))\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n for key in dict.keys():\n if key not in known_keys and not hasattr(self,key):\n print 'Inheriting attribute %r from %r' \\\n % (key,dict.get('name','?'))\n setattr(self,key,dict[key])\n self.extra_keys.append(key)\n return\n\n def __str__(self):\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n s = '<'+5*'-' + '\\n'\n s += 'Configuration of '+self.name+':\\n'\n for k in known_keys:\n a = getattr(self,k,None)\n if a:\n s += '%s = %r\\n' % (k,a)\n s += 5*'-' + '>'\n return s\n\n def get_config_cmd(self):\n cmd = get_cmd('config')\n cmd.ensure_finalized()\n cmd.dump_source = 0\n cmd.noisy = 0\n old_path = os.environ.get('PATH')\n if old_path:\n path = os.pathsep.join(['.',old_path])\n os.environ['PATH'] = path\n return cmd\n\n def get_build_temp_dir(self):\n cmd = get_cmd('build')\n cmd.ensure_finalized()\n return cmd.build_temp\n\n def have_f77c(self):\n \"\"\" Check for availability of Fortran 77 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f77')\n return flag\n\n def have_f90c(self):\n \"\"\" Check for availability of Fortran 90 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f90')\n return flag\n\n def append_to(self, extlib):\n \"\"\" Append libraries, include_dirs to extension or library item.\n \"\"\"\n if type(extlib) is type(()):\n lib_name, build_info = extlib\n dict_append(build_info,\n libraries=self.libraries,\n include_dirs=self.include_dirs)\n else:\n from numpy.distutils.core import Extension\n assert isinstance(extlib,Extension),`extlib`\n extlib.libraries.extend(self.libraries)\n extlib.include_dirs.extend(self.include_dirs)\n return\n\n def _get_svn_revision(self,path):\n \"\"\" Return path's SVN revision number.\n \"\"\"\n entries = os.path.join(path,'.svn','entries')\n revision = None\n if os.path.isfile(entries):\n f = open(entries)\n m = re.search(r'revision=\"(?P\\d+)\"',f.read())\n f.close()\n if m:\n revision = int(m.group('revision'))\n return revision\n\n def get_version(self):\n \"\"\" Try to get version string of a package.\n \"\"\"\n version = getattr(self,'version',None)\n if version is not None:\n return version\n\n # Get version from version file.\n files = ['__version__.py',\n self.name.split('.')[-1]+'_version.py',\n 'version.py',\n '__svn_version__.py']\n version_vars = ['version',\n '__version__',\n self.name.split('.')[-1]+'_version']\n for f in files:\n fn = os.path.join(self.local_path,f)\n if os.path.isfile(fn):\n info = (open(fn),fn,('.py','U',1))\n name = os.path.splitext(os.path.basename(fn))[0]\n n = dot_join(self.name,name)\n try:\n version_module = imp.load_module('_'.join(n.split('.')),*info)\n except ImportError,msg:\n print msg\n version_module = None\n if version_module is None:\n continue\n\n for a in version_vars:\n version = getattr(version_module,a,None)\n if version is not None:\n break\n if version is not None:\n break\n\n if version is not None:\n self.version = version\n return version\n\n # Get version as SVN revision number\n revision = self._get_svn_revision(self.local_path)\n if revision is not None:\n version = str(revision)\n self.version = version\n\n return version\n\n def make_svn_version_py(self):\n \"\"\" Generate package __svn_version__.py file from SVN revision number,\n it will be removed after python exits but will be available\n when sdist, etc commands are executed.\n\n If __svn_version__.py existed before, nothing is done.\n \"\"\"\n target = os.path.join(self.local_path,'__svn_version__.py')\n if os.path.isfile(target):\n return\n\n def generate_svn_version_py():\n if not os.path.isfile(target):\n revision = self._get_svn_revision(self.local_path)\n assert revision is not None,'hmm, why I am not inside SVN tree???'\n version = str(revision)\n print 'Creating %s (version=%r)' % (target,version)\n f = open(target,'w')\n f.write('version = %r\\n' % (version))\n f.close()\n \n import atexit\n def rm_file(f=target):\n try: os.remove(f); print 'removed',f\n except OSError: pass\n try: os.remove(f+'c'); print 'removed',f+'c'\n except OSError: pass\n atexit.register(rm_file)\n\n return target\n\n d = os.path.join(*(self.name.split('.')))\n self.add_data_files((d,generate_svn_version_py()))\n return\n\n def make_config_py(self,name='__config__'):\n \"\"\" Generate package __config__.py file containing system_info\n information used during building the package.\n \"\"\"\n self.add_extension(name,[generate_config_py])\n return\n\ndef get_cmd(cmdname,_cache={}):\n if not _cache.has_key(cmdname):\n import distutils.core\n dist = distutils.core._setup_distribution\n if dist is None:\n from distutils.errors import DistutilsInternalError\n raise DistutilsInternalError,\\\n 'setup distribution instance not initialized'\n cmd = dist.get_command_obj(cmdname)\n _cache[cmdname] = cmd\n return _cache[cmdname]\n\ndef get_numpy_include_dirs():\n # numpy_include_dirs are set by numpy/core/setup.py, otherwise []\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n if numpy.show_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n 'core','include'))\n else:\n # using installed numpy core headers\n import numpy.core as core\n include_dirs.append(os.path.join(os.path.dirname(core.__file__),'include'))\n # else running numpy/core/setup.py\n return include_dirs\n\n#########################\n\ndef default_config_dict(name = None, parent_name = None, local_path=None):\n \"\"\" Return a configuration dictionary for usage in\n configuration() function defined in file setup_.py.\n \"\"\"\n import warnings\n warnings.warn('Use Configuration(%s,%s,top_path=%s) instead of '\\\n 'deprecated default_config_dict(%s,%s,%s)' \\\n % (`name`,`parent_name`,`local_path`,\n `name`,`parent_name`,`local_path`,\n ))\n c = Configuration(name, parent_name, local_path)\n return c.todict()\n\n\ndef dict_append(d,**kws):\n for k,v in kws.items():\n if d.has_key(k):\n d[k].extend(v)\n else:\n d[k] = v\n\ndef appendpath(prefix,path):\n if not ('/' == os.path.sep):\n prefix = prefix.replace('/',os.path.sep)\n path = path.replace('/',os.path.sep)\n drive = ''\n if os.path.isabs(path):\n drive = os.path.splitdrive(prefix)[0]\n absprefix = os.path.splitdrive(os.path.abspath(prefix))[1]\n pathdrive,path = os.path.splitdrive(path)\n d = os.path.commonprefix([absprefix,path])\n if os.path.join(absprefix[:len(d)],absprefix[len(d):])!=absprefix \\\n or os.path.join(path[:len(d)],path[len(d):])!=path:\n # Handle invalid paths\n d = os.path.dirname(d)\n subpath = path[len(d):]\n if os.path.isabs(subpath):\n subpath = subpath[1:]\n else:\n subpath = path\n return os.path.normpath(os.path.join(drive + prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n \"\"\" Generate /config.py file containing system_info\n information used during building the package.\n\n Usage:\\\n ext = Extension(dot_join(config['name'],'config'),\n sources=[generate_config_py])\n config['ext_modules'].append(ext)\n \"\"\"\n from numpy.distutils.system_info import system_info\n from distutils.dir_util import mkpath\n target = os.path.join(*([build_dir]+extension.name.split('.'))) + '.py'\n mkpath(os.path.dirname(target))\n f = open(target,'w')\n f.write('# This file is generated by %s\\n' % (os.path.abspath(sys.argv[0])))\n f.write('# It contains system_info results at the time of building this package.\\n')\n f.write('__all__ = [\"get_info\",\"show\"]\\n\\n')\n for k,i in system_info.saved_results.items():\n f.write('%s=%r\\n' % (k,i))\n f.write('\\ndef get_info(name): g=globals(); return g.get(name,g.get(name+\"_info\",{}))\\n')\n f.write('''\ndef show():\n for name,info_dict in globals().items():\n if name[0]==\"_\" or type(info_dict) is not type({}): continue\n print name+\":\"\n if not info_dict:\n print \" NOT AVAILABLE\"\n for k,v in info_dict.items():\n v = str(v)\n if k==\\'sources\\' and len(v)>200: v = v[:60]+\\' ...\\\\n... \\'+v[-60:]\n print \\' %s = %s\\'%(k,v)\n print\n return\n ''')\n\n f.close()\n return target\n\ndef generate_svn_version_py(extension, build_dir):\n \"\"\" Generate __svn_version__.py file containing SVN\n revision number of a module.\n \n To use, add the following codelet to setup\n configuration(..) function\n\n ext = Extension(dot_join(config['name'],'__svn_version__'),\n sources=[generate_svn_version_py])\n ext.local_path = local_path\n config['ext_modules'].append(ext)\n\n \"\"\"\n from distutils import dep_util\n local_path = extension.local_path\n target = os.path.join(build_dir, '__svn_version__.py')\n entries = os.path.join(local_path,'.svn','entries')\n if os.path.isfile(entries):\n if not dep_util.newer(entries, target):\n return target\n elif os.path.isfile(target):\n return target\n\n revision = get_svn_revision(local_path)\n f = open(target,'w')\n f.write('revision=%s\\n' % (revision))\n f.close()\n return target\n", + "source_code_before": "import os\nimport re\nimport sys\nimport imp\nimport copy\nimport types\nimport glob\n\ndef allpath(name):\n \"Convert a /-separated pathname to one using the OS's path separator.\"\n splitted = name.split('/')\n return os.path.join(*splitted)\n\ndef get_path(mod_name,parent_path=None):\n \"\"\" Return path of the module.\n\n Returned path is relative to parent_path when given,\n otherwise it is absolute path.\n \"\"\"\n if mod_name == '__main__':\n d = os.path.abspath('.')\n elif mod_name == '__builtin__':\n #builtin if/then added by Pearu for use in core.run_setup. \n d = os.path.dirname(os.path.abspath(sys.argv[0]))\n else:\n __import__(mod_name)\n mod = sys.modules[mod_name]\n file = mod.__file__\n d = os.path.dirname(os.path.abspath(file))\n if parent_path is not None:\n pd = os.path.abspath(parent_path)\n if pd==d[:len(pd)]:\n d = d[len(pd)+1:]\n return d or '.'\n\n# Hooks for colored terminal output.\n# See also http://www.livinglogic.de/Python/ansistyle\ndef terminal_has_colors():\n if sys.platform=='cygwin' and not os.environ.has_key('USE_COLOR'):\n # Avoid importing curses that causes illegal operation\n # with a message:\n # PYTHON2 caused an invalid page fault in\n # module CYGNURSES7.DLL as 015f:18bbfc28\n # Details: Python 2.3.3 [GCC 3.3.1 (cygming special)]\n # ssh to Win32 machine from debian\n # curses.version is 2.2\n # CYGWIN_98-4.10, release 1.5.7(0.109/3/2))\n return 0\n if hasattr(sys.stdout,'isatty') and sys.stdout.isatty(): \n try:\n import curses\n curses.setupterm()\n if (curses.tigetnum(\"colors\") >= 0\n and curses.tigetnum(\"pairs\") >= 0\n and ((curses.tigetstr(\"setf\") is not None \n and curses.tigetstr(\"setb\") is not None) \n or (curses.tigetstr(\"setaf\") is not None\n and curses.tigetstr(\"setab\") is not None)\n or curses.tigetstr(\"scp\") is not None)):\n return 1\n except Exception,msg:\n pass\n return 0\n\nif terminal_has_colors():\n def red_text(s): return '\\x1b[31m%s\\x1b[0m'%s\n def green_text(s): return '\\x1b[32m%s\\x1b[0m'%s\n def yellow_text(s): return '\\x1b[33m%s\\x1b[0m'%s\n def blue_text(s): return '\\x1b[34m%s\\x1b[0m'%s\n def cyan_text(s): return '\\x1b[35m%s\\x1b[0m'%s\nelse:\n def red_text(s): return s\n def green_text(s): return s\n def yellow_text(s): return s\n def cyan_text(s): return s\n def blue_text(s): return s\n\n#########################\n\ndef cyg2win32(path):\n if sys.platform=='cygwin' and path.startswith('/cygdrive'):\n path = path[10] + ':' + os.path.normcase(path[11:])\n return path\n\n#########################\n\n#XXX need support for .C that is also C++\ncxx_ext_match = re.compile(r'.*[.](cpp|cxx|cc)\\Z',re.I).match\nfortran_ext_match = re.compile(r'.*[.](f90|f95|f77|for|ftn|f)\\Z',re.I).match\nf90_ext_match = re.compile(r'.*[.](f90|f95)\\Z',re.I).match\nf90_module_name_match = re.compile(r'\\s*module\\s*(?P[\\w_]+)',re.I).match\ndef _get_f90_modules(source):\n \"\"\" Return a list of Fortran f90 module names that\n given source file defines.\n \"\"\"\n if not f90_ext_match(source):\n return []\n modules = []\n f = open(source,'r')\n f_readlines = getattr(f,'xreadlines',f.readlines)\n for line in f_readlines():\n m = f90_module_name_match(line)\n if m:\n name = m.group('name')\n modules.append(name)\n # break # XXX can we assume that there is one module per file?\n f.close()\n return modules\n\ndef all_strings(lst):\n \"\"\" Return True if all items in lst are string objects. \"\"\"\n for item in lst:\n if type(item) is not types.StringType:\n return False\n return True\n\ndef has_f_sources(sources):\n \"\"\" Return True if sources contains Fortran files \"\"\"\n for source in sources:\n if fortran_ext_match(source):\n return True\n return False\n\ndef has_cxx_sources(sources):\n \"\"\" Return True if sources contains C++ files \"\"\"\n for source in sources:\n if cxx_ext_match(source):\n return True\n return False\n\ndef filter_sources(sources):\n \"\"\" Return four lists of filenames containing\n C, C++, Fortran, and Fortran 90 module sources,\n respectively.\n \"\"\"\n c_sources = []\n cxx_sources = []\n f_sources = []\n fmodule_sources = []\n for source in sources:\n if fortran_ext_match(source):\n modules = _get_f90_modules(source)\n if modules:\n fmodule_sources.append(source)\n else:\n f_sources.append(source)\n elif cxx_ext_match(source):\n cxx_sources.append(source)\n else:\n c_sources.append(source) \n return c_sources, cxx_sources, f_sources, fmodule_sources\n\n\ndef _get_headers(directory_list):\n # get *.h files from list of directories\n headers = []\n for dir in directory_list:\n head = glob.glob(os.path.join(dir,\"*.h\")) #XXX: *.hpp files??\n headers.extend(head)\n return headers\n\ndef _get_directories(list_of_sources):\n # get unique directories from list of sources.\n direcs = []\n for file in list_of_sources:\n dir = os.path.split(file)\n if dir[0] != '' and not dir[0] in direcs:\n direcs.append(dir[0])\n return direcs\n\ndef get_dependencies(sources):\n #XXX scan sources for include statements\n return _get_headers(_get_directories(sources))\n\ndef is_local_src_dir(directory):\n \"\"\" Return true if directory is local directory.\n \"\"\"\n if type(directory) is not type(''):\n return False\n abs_dir = os.path.abspath(directory)\n c = os.path.commonprefix([os.getcwd(),abs_dir])\n new_dir = abs_dir[len(c):].split(os.sep)\n if new_dir and not new_dir[0]:\n new_dir = new_dir[1:]\n if new_dir and new_dir[0]=='build':\n return False\n new_dir = os.sep.join(new_dir)\n return os.path.isdir(new_dir)\n\ndef _gsf_visit_func(filenames,dirname,names):\n if os.path.basename(dirname) in ['CVS','.svn','build']:\n names[:] = []\n return\n for name in names:\n if name[-1] in \"~#\":\n continue\n fullname = os.path.join(dirname,name)\n ext = os.path.splitext(fullname)[1]\n if ext and ext in ['.pyc','.o']:\n continue\n if os.path.isfile(fullname):\n filenames.append(fullname)\n\ndef get_ext_source_files(ext):\n # Get sources and any include files in the same directory.\n filenames = []\n sources = filter(lambda s:type(s) is types.StringType,ext.sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n for d in ext.depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_script_files(scripts):\n scripts = filter(lambda s:type(s) is types.StringType,scripts)\n return scripts\n\ndef get_lib_source_files(lib):\n filenames = []\n sources = lib[1].get('sources',[])\n sources = filter(lambda s:type(s) is types.StringType,sources)\n filenames.extend(sources)\n filenames.extend(get_dependencies(sources))\n depends = lib[1].get('depends',[])\n for d in depends:\n if is_local_src_dir(d):\n os.path.walk(d,_gsf_visit_func,filenames)\n elif os.path.isfile(d):\n filenames.append(d)\n return filenames\n\ndef get_data_files(data):\n if type(data) is types.StringType:\n return [data]\n sources = data[1]\n filenames = []\n for s in sources:\n if callable(s):\n s = s()\n if s is None:\n continue\n if is_local_src_dir(s):\n os.path.walk(s,_gsf_visit_func,filenames)\n elif type(s) is type(''):\n if os.path.isfile(s):\n filenames.append(s)\n else:\n print 'Not existing data file:',s\n else:\n raise TypeError,`s`\n return filenames\n\ndef dot_join(*args):\n return '.'.join(filter(None,args))\n\ndef get_frame(level=0):\n try:\n return sys._getframe(level+1)\n except AttributeError:\n frame = sys.exc_info()[2].tb_frame\n for i in range(level+1):\n frame = frame.f_back\n return frame\n\n######################\n\nclass Configuration:\n\n _list_keys = ['packages','ext_modules','data_files','include_dirs',\n 'libraries','headers','scripts']\n _dict_keys = ['package_dir']\n\n numpy_include_dirs = []\n\n def __init__(self,\n package_name=None,\n parent_name=None,\n top_path=None,\n package_path=None,\n **attrs):\n \"\"\" Construct configuration instance of a package.\n \"\"\"\n self.name = dot_join(parent_name, package_name)\n\n caller_frame = get_frame(1)\n caller_name = eval('__name__',caller_frame.f_globals,caller_frame.f_locals)\n \n self.local_path = get_path(caller_name, top_path)\n if top_path is None:\n top_path = self.local_path\n if package_path is None:\n package_path = self.local_path\n elif os.path.isdir(os.path.join(self.local_path,package_path)):\n package_path = os.path.join(self.local_path,package_path)\n assert os.path.isdir(package_path),`package_path`\n self.top_path = top_path\n\n self.list_keys = copy.copy(self._list_keys)\n self.dict_keys = copy.copy(self._dict_keys)\n\n for n in self.list_keys:\n setattr(self,n,copy.copy(attrs.get(n,[])))\n\n for n in self.dict_keys:\n setattr(self,n,copy.copy(attrs.get(n,{})))\n\n known_keys = self.list_keys + self.dict_keys\n self.extra_keys = []\n for n in attrs.keys():\n if n in known_keys:\n continue\n a = attrs[n]\n setattr(self,n,a)\n if type(a) is types.ListType:\n self.list_keys.append(n)\n elif type(a) is types.DictType:\n self.dict_keys.append(n)\n else:\n self.extra_keys.append(n)\n\n if os.path.exists(os.path.join(package_path,'__init__.py')):\n self.packages.append(self.name)\n self.package_dir[self.name] = package_path \n return\n\n def todict(self):\n \"\"\" Return configuration distionary suitable for passing\n to distutils.core.setup() function.\n \"\"\"\n d = {}\n for n in self.list_keys + self.dict_keys + self.extra_keys:\n a = getattr(self,n)\n if a:\n d[n] = a\n if self.name:\n d['name'] = self.name\n return d\n\n def __dict__(self):\n return self.todict()\n\n def get_distribution(self):\n import distutils.core\n dist = distutils.core._setup_distribution \n return dist\n\n def get_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Return subpackage configuration.\n \"\"\"\n if subpackage_name is None:\n assert subpackage_path is not None\n subpackage_name = os.path.basename(subpackage_path)\n assert '.' not in subpackage_name,`subpackage_name`\n if subpackage_path is None:\n subpackage_path = os.path.join(self.local_path,subpackage_name)\n else:\n subpackage_path = self._fix_paths([subpackage_path])[0]\n\n setup_py = os.path.join(subpackage_path,'setup_%s.py' % (subpackage_name))\n if not os.path.isfile(setup_py):\n setup_py = os.path.join(subpackage_path,'setup.py')\n if not os.path.isfile(setup_py):\n print 'Assuming default configuration '\\\n '(%s/{setup_%s,setup}.py was not found)' \\\n % (os.path.dirname(setup_py),subpackage_name)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n # In case setup_py imports local modules:\n sys.path.insert(0,os.path.dirname(setup_py))\n try:\n info = (open(setup_py),setup_py,('.py','U',1))\n setup_name = os.path.splitext(os.path.basename(setup_py))[0]\n n = dot_join(self.name,setup_name)\n setup_module = imp.load_module('_'.join(n.split('.')),*info)\n\n if not hasattr(setup_module,'configuration'):\n print 'Assuming default configuration '\\\n '(%s does not define configuration())' % (setup_module)\n config = Configuration(subpackage_name,self.name,\n self.top_path,subpackage_path)\n else:\n args = (self.name,)\n if setup_module.configuration.func_code.co_argcount>1:\n args = args + (self.top_path,)\n config = setup_module.configuration(*args)\n\n finally:\n del sys.path[0]\n\n return config\n\n def add_subpackage(self,subpackage_name,subpackage_path=None):\n \"\"\" Add subpackage to configuration.\n \"\"\"\n config = self.get_subpackage(subpackage_name,subpackage_path)\n\n if not config:\n print 'No configuration returned, assuming unavailable.'\n else:\n\n if isinstance(config,Configuration):\n print 'Appending %s configuration to %s' % (config.name,self.name)\n self.dict_append(**config.todict())\n else:\n print 'Appending %s configuration to %s' % (config.get('name'),self.name)\n self.dict_append(**config)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a subpackage', subpackage_name\n return\n\n def add_data_dir(self,data_path):\n \"\"\" Recursively add files under data_path to data_files list.\n Argument can be either\n - 2-sequence (,)\n - path to data directory where python datadir suffix defaults\n to package dir.\n If path is not absolute then it's datadir suffix is\n package dir + subdirname of the path.\n \"\"\"\n if type(data_path) is type(()):\n assert len(data_path)==2,`data_path`\n d,data_path = data_path\n else:\n d = None\n assert type(data_path) is type(''),`data_path`\n for path in self.paths(data_path):\n if not os.path.exists(path):\n print 'Not existing data path',path\n continue\n filenames = []\n os.path.walk(path, _gsf_visit_func,filenames)\n if not os.path.isabs(path):\n if d is None:\n ds = os.path.join(*(self.name.split('.')+[data_path]))\n else:\n ds = os.path.join(d,data_path)\n self.add_data_files((ds,filenames))\n else:\n if d is None:\n self.add_data_files(*filenames)\n else:\n self.add_data_files((d,filenames))\n return\n\n def add_data_files(self,*files):\n \"\"\" Add data files to configuration data_files.\n Argument(s) can be either\n - 2-sequence (,)\n - paths to data files where python datadir prefix defaults\n to package dir.\n If path is not absolute then it's datadir prefix is\n package dir + dirname of the path.\n \"\"\"\n data_dict = {}\n new_files = []\n for p in files:\n if type(p) is not type(()):\n d = os.path.join(*(self.name.split('.')))\n if type(p) is type('') and not os.path.isabs(p):\n d = appendpath(d,os.path.dirname(p))\n p = (d,p)\n new_files.append(p)\n files = []\n for prefix,filepattern in new_files:\n if type(filepattern) is type(''):\n file_list = self.paths(filepattern)\n elif callable(filepattern):\n file_list = [filepattern]\n else:\n file_list = self.paths(*filepattern)\n\n nof_path_components = [len(f.split(os.sep)) \\\n for f in file_list if type(f) is type('')]\n if nof_path_components:\n min_path_components = min(nof_path_components)-1\n else:\n min_path_components = 0\n\n for f in file_list:\n if type(f) is type(''):\n extra_path_components = f.split(os.sep)[min_path_components:-1]\n p = os.path.join(*([prefix]+extra_path_components))\n else:\n p = prefix\n if not data_dict.has_key(p):\n data_dict[p] = [f]\n else:\n data_dict[p].append(f)\n\n dist = self.get_distribution()\n if dist is not None:\n dist.data_files.extend(data_dict.items())\n else:\n self.data_files.extend(data_dict.items())\n return \n \n def add_include_dirs(self,*paths):\n \"\"\" Add paths to configuration include directories.\n \"\"\"\n include_dirs = self._fix_paths(paths)\n dist = self.get_distribution()\n if dist is not None:\n dist.include_dirs.extend(include_dirs)\n else:\n self.include_dirs.extend(include_dirs)\n return\n\n def add_headers(self,*files):\n \"\"\" Add installable headers to configuration.\n Argument(s) can be either\n - 2-sequence (,)\n - path(s) to header file(s) where python includedir suffix will default\n to package name.\n \"\"\"\n headers = []\n for path in files:\n if type(path) is type(''):\n [headers.append((self.name,p)) for p in self.paths(path)]\n else:\n assert type(path) in [type(()),type([])] and len(path)==2,`path`\n [headers.append((path[0],p)) for p in self.paths(path[1])]\n dist = self.get_distribution()\n if dist is not None:\n dist.headers.extend(headers)\n else:\n self.headers.extend(headers)\n return\n\n def _fix_paths(self,paths):\n new_paths = []\n for n in paths:\n if isinstance(n,str):\n if '*' in n or '?' in n:\n p = glob.glob(n)\n p2 = glob.glob(os.path.join(self.local_path,n))\n if p2:\n new_paths.extend(p2)\n elif p:\n new_paths.extend(p)\n else:\n new_paths.append(n)\n else:\n n2 = os.path.join(self.local_path,n)\n if os.path.exists(n2):\n new_paths.append(n2)\n else:\n new_paths.append(n)\n else:\n new_paths.append(n)\n return new_paths\n\n def paths(self,*paths):\n \"\"\" Apply glob to paths and prepend local_path if needed.\n \"\"\"\n return self._fix_paths(paths)\n\n def add_extension(self,name,sources,**kw):\n \"\"\" Add extension to configuration.\n\n Keywords:\n include_dirs, define_macros, undef_macros,\n library_dirs, libraries, runtime_library_dirs,\n extra_objects, extra_compile_args, extra_link_args,\n export_symbols, swig_opts, depends, language,\n f2py_options, module_dirs\n extra_info - dict or list of dict of keywords to be\n appended to keywords.\n \"\"\"\n ext_args = copy.copy(kw)\n ext_args['name'] = dot_join(self.name,name)\n ext_args['sources'] = sources\n\n if ext_args.has_key('extra_info'):\n extra_info = ext_args['extra_info']\n del ext_args['extra_info']\n if type(extra_info) is type({}):\n extra_info = [extra_info]\n for info in extra_info:\n assert type(info) is type({}),`info`\n dict_append(ext_args,**info)\n\n for k in ext_args.keys():\n v = ext_args[k]\n if k in ['sources','depends','include_dirs','library_dirs',\n 'module_dirs','extra_objects']:\n new_v = self._fix_paths(v)\n ext_args[k] = new_v\n\n # Resolve out-of-tree dependencies\n libraries = ext_args.get('libraries',[])\n libnames = []\n ext_args['libraries'] = []\n for libname in libraries:\n if '@' in libname:\n lname,lpath = libname.split('@',1)\n lpath = os.path.abspath(os.path.join(self.local_path,lpath))\n if os.path.isdir(lpath):\n c = self.get_subpackage(None,lpath)\n if isinstance(c,Configuration):\n c = c.todict()\n for l in [l[0] for l in c.get('libraries',[])]:\n llname = l.split('__OF__',1)[0]\n if llname == lname:\n c.pop('name',None)\n dict_append(ext_args,**c)\n break\n continue\n libnames.append(libname)\n\n ext_args['libraries'] = libnames + ext_args['libraries']\n\n from numpy.distutils.core import Extension\n ext = Extension(**ext_args)\n self.ext_modules.append(ext)\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add an extension', name\n return ext\n\n def add_library(self,name,sources,**build_info):\n \"\"\" Add library to configuration.\n \n Valid keywords for build_info:\n depends\n macros\n include_dirs\n extra_compiler_args\n f2py_options\n \"\"\"\n build_info = copy.copy(build_info)\n name = name #+ '__OF__' + self.name\n build_info['sources'] = sources\n\n for k in build_info.keys():\n v = build_info[k]\n if k in ['sources','depends']:\n new_v = self._fix_paths(v)\n build_info[k] = new_v\n self.libraries.append((name,build_info))\n\n dist = self.get_distribution()\n if dist is not None:\n print 'distutils distribution has been initialized, it may be too late to add a library', name\n return\n\n def add_scripts(self,*files):\n \"\"\" Add scripts to configuration.\n \"\"\"\n scripts = self._fix_paths(files)\n dist = self.get_distribution()\n if dist is not None:\n dist.scripts.extend(scripts)\n else:\n self.scripts.extend(scripts)\n return\n\n def dict_append(self,**dict):\n for key in self.list_keys:\n a = getattr(self,key)\n a.extend(dict.get(key,[]))\n for key in self.dict_keys:\n a = getattr(self,key)\n a.update(dict.get(key,{}))\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n for key in dict.keys():\n if key not in known_keys and not hasattr(self,key):\n print 'Inheriting attribute %r from %r' \\\n % (key,dict.get('name','?'))\n setattr(self,key,dict[key])\n self.extra_keys.append(key)\n return\n\n def __str__(self):\n known_keys = self.list_keys + self.dict_keys + self.extra_keys\n s = '<'+5*'-' + '\\n'\n s += 'Configuration of '+self.name+':\\n'\n for k in known_keys:\n a = getattr(self,k,None)\n if a:\n s += '%s = %r\\n' % (k,a)\n s += 5*'-' + '>'\n return s\n\n def get_config_cmd(self):\n cmd = get_cmd('config')\n cmd.ensure_finalized()\n cmd.dump_source = 0\n cmd.noisy = 0\n old_path = os.environ.get('PATH')\n if old_path:\n path = os.pathsep.join(['.',old_path])\n os.environ['PATH'] = path\n return cmd\n\n def get_build_temp_dir(self):\n cmd = get_cmd('build')\n cmd.ensure_finalized()\n return cmd.build_temp\n\n def have_f77c(self):\n \"\"\" Check for availability of Fortran 77 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f77')\n return flag\n\n def have_f90c(self):\n \"\"\" Check for availability of Fortran 90 compiler.\n Use it inside source generating function to ensure that\n setup distribution instance has been initialized.\n \"\"\"\n simple_fortran_subroutine = '''\n subroutine simple\n end\n '''\n config_cmd = self.get_config_cmd()\n flag = config_cmd.try_compile(simple_fortran_subroutine,lang='f90')\n return flag\n\n def append_to(self, extlib):\n \"\"\" Append libraries, include_dirs to extension or library item.\n \"\"\"\n if type(extlib) is type(()):\n lib_name, build_info = extlib\n dict_append(build_info,\n libraries=self.libraries,\n include_dirs=self.include_dirs)\n else:\n from numpy.distutils.core import Extension\n assert isinstance(extlib,Extension),`extlib`\n extlib.libraries.extend(self.libraries)\n extlib.include_dirs.extend(self.include_dirs)\n return\n\n def _get_svn_revision(self,path):\n \"\"\" Return path's SVN revision number.\n \"\"\"\n entries = os.path.join(path,'.svn','entries')\n revision = None\n if os.path.isfile(entries):\n f = open(entries)\n m = re.search(r'revision=\"(?P\\d+)\"',f.read())\n f.close()\n if m:\n revision = int(m.group('revision'))\n return revision\n\n def get_version(self):\n \"\"\" Try to get version string of a package.\n \"\"\"\n version = getattr(self,'version',None)\n if version is not None:\n return version\n\n # Get version from version file.\n files = ['__version__.py',\n self.name.split('.')[-1]+'_version.py',\n 'version.py',\n '__svn_version__.py']\n version_vars = ['version',\n '__version__',\n self.name.split('.')[-1]+'_version']\n for f in files:\n fn = os.path.join(self.local_path,f)\n if os.path.isfile(fn):\n info = (open(fn),fn,('.py','U',1))\n name = os.path.splitext(os.path.basename(fn))[0]\n n = dot_join(self.name,name)\n try:\n version_module = imp.load_module('_'.join(n.split('.')),*info)\n except ImportError,msg:\n print msg\n version_module = None\n if version_module is None:\n continue\n\n for a in version_vars:\n version = getattr(version_module,a,None)\n if version is not None:\n break\n if version is not None:\n break\n\n if version is not None:\n self.version = version\n return version\n\n # Get version as SVN revision number\n revision = self._get_svn_revision(self.local_path)\n if revision is not None:\n version = str(revision)\n self.version = version\n\n return version\n\n def make_svn_version_py(self):\n \"\"\" Generate package __svn_version__.py file from SVN revision number,\n it will be removed after python exits but will be available\n when sdist, etc commands are executed.\n\n If __svn_version__.py existed before, nothing is done.\n \"\"\"\n target = os.path.join(self.local_path,'__svn_version__.py')\n if os.path.isfile(target):\n return\n\n def generate_svn_version_py():\n if not os.path.isfile(target):\n revision = self._get_svn_revision(self.local_path)\n assert revision is not None,'hmm, why I am not inside SVN tree???'\n version = str(revision)\n print 'Creating %s (version=%r)' % (target,version)\n f = open(target,'w')\n f.write('version = %r\\n' % (version))\n f.close()\n \n import atexit\n def rm_file(f=target):\n try: os.remove(f); print 'removed',f\n except OSError: pass\n try: os.remove(f+'c'); print 'removed',f+'c'\n except OSError: pass\n atexit.register(rm_file)\n\n return target\n\n d = os.path.join(*(self.name.split('.')))\n self.add_data_files((d,generate_svn_version_py()))\n return\n\n def make_config_py(self,name='__config__'):\n \"\"\" Generate package __config__.py file containing system_info\n information used during building the package.\n \"\"\"\n self.add_extension(name,[generate_config_py])\n return\n\ndef get_cmd(cmdname,_cache={}):\n if not _cache.has_key(cmdname):\n import distutils.core\n dist = distutils.core._setup_distribution\n if dist is None:\n from distutils.errors import DistutilsInternalError\n raise DistutilsInternalError,\\\n 'setup distribution instance not initialized'\n cmd = dist.get_command_obj(cmdname)\n _cache[cmdname] = cmd\n return _cache[cmdname]\n\ndef get_numpy_include_dirs():\n # numpy_include_dirs are set by numpy/core/setup.py, otherwise []\n include_dirs = Configuration.numpy_include_dirs[:]\n if not include_dirs:\n import numpy\n if numpy.show_core_config is None:\n # running from numpy_core source directory\n include_dirs.append(os.path.join(os.path.dirname(numpy.__file__),\n 'core','include'))\n else:\n # using installed numpy core headers\n import numpy.core as core\n include_dirs.append(os.path.join(os.path.dirname(core.__file__),'include'))\n # else running numpy/core/setup.py\n return include_dirs\n\n#########################\n\ndef default_config_dict(name = None, parent_name = None, local_path=None):\n \"\"\" Return a configuration dictionary for usage in\n configuration() function defined in file setup_.py.\n \"\"\"\n import warnings\n warnings.warn('Use Configuration(%s,%s,top_path=%s) instead of '\\\n 'deprecated default_config_dict(%s,%s,%s)' \\\n % (`name`,`parent_name`,`local_path`,\n `name`,`parent_name`,`local_path`,\n ))\n c = Configuration(name, parent_name, local_path)\n return c.todict()\n\n\ndef dict_append(d,**kws):\n for k,v in kws.items():\n if d.has_key(k):\n d[k].extend(v)\n else:\n d[k] = v\n\ndef appendpath(prefix,path):\n if not ('/' == os.path.sep):\n prefix = prefix.replace('/',os.path.sep)\n path = path.replace('/',os.path.sep)\n drive = ''\n if os.path.isabs(path):\n drive = os.path.splitdrive(prefix)[0]\n absprefix = os.path.splitdrive(os.path.abspath(prefix))[1]\n pathdrive,path = os.path.splitdrive(path)\n d = os.path.commonprefix([absprefix,path])\n if os.path.join(absprefix[:len(d)],absprefix[len(d):])!=absprefix \\\n or os.path.join(path[:len(d)],path[len(d):])!=path:\n # Handle invalid paths\n d = os.path.dirname(d)\n subpath = path[len(d):]\n if os.path.isabs(subpath):\n subpath = subpath[1:]\n else:\n subpath = path\n return os.path.normpath(os.path.join(drive + prefix, subpath))\n\ndef generate_config_py(extension, build_dir):\n \"\"\" Generate /config.py file containing system_info\n information used during building the package.\n\n Usage:\\\n ext = Extension(dot_join(config['name'],'config'),\n sources=[generate_config_py])\n config['ext_modules'].append(ext)\n \"\"\"\n from numpy.distutils.system_info import system_info\n from distutils.dir_util import mkpath\n target = os.path.join(*([build_dir]+extension.name.split('.'))) + '.py'\n mkpath(os.path.dirname(target))\n f = open(target,'w')\n f.write('# This file is generated by %s\\n' % (os.path.abspath(sys.argv[0])))\n f.write('# It contains system_info results at the time of building this package.\\n')\n f.write('__all__ = [\"get_info\",\"show\"]\\n\\n')\n for k,i in system_info.saved_results.items():\n f.write('%s=%r\\n' % (k,i))\n f.write('\\ndef get_info(name): g=globals(); return g.get(name,g.get(name+\"_info\",{}))\\n')\n f.write('''\ndef show():\n for name,info_dict in globals().items():\n if name[0]==\"_\" or type(info_dict) is not type({}): continue\n print name+\":\"\n if not info_dict:\n print \" NOT AVAILABLE\"\n for k,v in info_dict.items():\n v = str(v)\n if k==\\'sources\\' and len(v)>200: v = v[:60]+\\' ...\\\\n... \\'+v[-60:]\n print \\' %s = %s\\'%(k,v)\n print\n return\n ''')\n\n f.close()\n return target\n\ndef generate_svn_version_py(extension, build_dir):\n \"\"\" Generate __svn_version__.py file containing SVN\n revision number of a module.\n \n To use, add the following codelet to setup\n configuration(..) function\n\n ext = Extension(dot_join(config['name'],'__svn_version__'),\n sources=[generate_svn_version_py])\n ext.local_path = local_path\n config['ext_modules'].append(ext)\n\n \"\"\"\n from distutils import dep_util\n local_path = extension.local_path\n target = os.path.join(build_dir, '__svn_version__.py')\n entries = os.path.join(local_path,'.svn','entries')\n if os.path.isfile(entries):\n if not dep_util.newer(entries, target):\n return target\n elif os.path.isfile(target):\n return target\n\n revision = get_svn_revision(local_path)\n f = open(target,'w')\n f.write('revision=%s\\n' % (revision))\n f.close()\n return target\n", + "methods": [ + { + "name": "allpath", + "long_name": "allpath( name )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "name" + ], + "start_line": 9, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "get_path", + "long_name": "get_path( mod_name , parent_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 132, + "parameters": [ + "mod_name", + "parent_path" + ], + "start_line": 14, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "terminal_has_colors", + "long_name": "terminal_has_colors( )", + "filename": "misc_util.py", + "nloc": 18, + "complexity": 13, + "token_count": 137, + "parameters": [], + "start_line": 38, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "cyg2win32", + "long_name": "cyg2win32( path )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "path" + ], + "start_line": 80, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "_get_f90_modules", + "long_name": "_get_f90_modules( source )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 77, + "parameters": [ + "source" + ], + "start_line": 92, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "all_strings", + "long_name": "all_strings( lst )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 26, + "parameters": [ + "lst" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_f_sources", + "long_name": "has_f_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 117, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_cxx_sources", + "long_name": "has_cxx_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 124, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "filter_sources", + "long_name": "filter_sources( sources )", + "filename": "misc_util.py", + "nloc": 17, + "complexity": 5, + "token_count": 84, + "parameters": [ + "sources" + ], + "start_line": 131, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "_get_headers", + "long_name": "_get_headers( directory_list )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "directory_list" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_get_directories", + "long_name": "_get_directories( list_of_sources )", + "filename": "misc_util.py", + "nloc": 7, + "complexity": 4, + "token_count": 51, + "parameters": [ + "list_of_sources" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "get_dependencies", + "long_name": "get_dependencies( sources )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "sources" + ], + "start_line": 171, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "is_local_src_dir", + "long_name": "is_local_src_dir( directory )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 6, + "token_count": 112, + "parameters": [ + "directory" + ], + "start_line": 175, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "_gsf_visit_func", + "long_name": "_gsf_visit_func( filenames , dirname , names )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 7, + "token_count": 103, + "parameters": [ + "filenames", + "dirname", + "names" + ], + "start_line": 190, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_ext_source_files", + "long_name": "get_ext_source_files( ext )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 4, + "token_count": 87, + "parameters": [ + "ext" + ], + "start_line": 204, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "get_script_files", + "long_name": "get_script_files( scripts )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "scripts" + ], + "start_line": 217, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "get_lib_source_files", + "long_name": "get_lib_source_files( lib )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 111, + "parameters": [ + "lib" + ], + "start_line": 221, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_data_files", + "long_name": "get_data_files( data )", + "filename": "misc_util.py", + "nloc": 20, + "complexity": 8, + "token_count": 112, + "parameters": [ + "data" + ], + "start_line": 235, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "dot_join", + "long_name": "dot_join( * args )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "args" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_frame", + "long_name": "get_frame( level = 0 )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "level" + ], + "start_line": 259, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , package_name = None , parent_name = None , top_path = None , package_path = None , ** attrs )", + "filename": "misc_util.py", + "nloc": 41, + "complexity": 11, + "token_count": 348, + "parameters": [ + "self", + "package_name", + "parent_name", + "top_path", + "package_path", + "attrs" + ], + "start_line": 278, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 1 + }, + { + "name": "todict", + "long_name": "todict( self )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__dict__", + "long_name": "__dict__( self )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 342, + "end_line": 343, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_distribution", + "long_name": "get_distribution( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 345, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_subpackage", + "long_name": "get_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 8, + "token_count": 333, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 350, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "add_subpackage", + "long_name": "add_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 103, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 396, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "add_data_dir", + "long_name": "add_data_dir( self , data_path )", + "filename": "misc_util.py", + "nloc": 25, + "complexity": 7, + "token_count": 188, + "parameters": [ + "self", + "data_path" + ], + "start_line": 417, + "end_line": 449, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_data_files", + "long_name": "add_data_files( self , * files )", + "filename": "misc_util.py", + "nloc": 40, + "complexity": 15, + "token_count": 324, + "parameters": [ + "self", + "files" + ], + "start_line": 451, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "add_include_dirs", + "long_name": "add_include_dirs( self , * paths )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "paths" + ], + "start_line": 503, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "add_headers", + "long_name": "add_headers( self , * files )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 7, + "token_count": 143, + "parameters": [ + "self", + "files" + ], + "start_line": 514, + "end_line": 533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "_fix_paths", + "long_name": "_fix_paths( self , paths )", + "filename": "misc_util.py", + "nloc": 22, + "complexity": 8, + "token_count": 136, + "parameters": [ + "self", + "paths" + ], + "start_line": 535, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "paths", + "long_name": "paths( self , * paths )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "paths" + ], + "start_line": 558, + "end_line": 561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "add_extension", + "long_name": "add_extension( self , name , sources , ** kw )", + "filename": "misc_util.py", + "nloc": 45, + "complexity": 14, + "token_count": 365, + "parameters": [ + "self", + "name", + "sources", + "kw" + ], + "start_line": 563, + "end_line": 625, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "add_library", + "long_name": "add_library( self , name , sources , ** build_info )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 4, + "token_count": 98, + "parameters": [ + "self", + "name", + "sources", + "build_info" + ], + "start_line": 627, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "add_scripts", + "long_name": "add_scripts( self , * files )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "files" + ], + "start_line": 653, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "dict_append", + "long_name": "dict_append( self , ** dict )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 138, + "parameters": [ + "self", + "dict" + ], + "start_line": 664, + "end_line": 678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 680, + "end_line": 689, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_config_cmd", + "long_name": "get_config_cmd( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 691, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_build_temp_dir", + "long_name": "get_build_temp_dir( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 702, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "have_f77c", + "long_name": "have_f77c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 707, + "end_line": 718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "have_f90c", + "long_name": "have_f90c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 720, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "append_to", + "long_name": "append_to( self , extlib )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 2, + "token_count": 83, + "parameters": [ + "self", + "extlib" + ], + "start_line": 733, + "end_line": 746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_svn_revision", + "long_name": "_get_svn_revision( self , path )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 77, + "parameters": [ + "self", + "path" + ], + "start_line": 748, + "end_line": 759, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "get_version", + "long_name": "get_version( self )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 11, + "token_count": 257, + "parameters": [ + "self" + ], + "start_line": 761, + "end_line": 807, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 1 + }, + { + "name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file", + "long_name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file( f = target )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "f" + ], + "start_line": 831, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 3 + }, + { + "name": "make_svn_version_py.generate_svn_version_py", + "long_name": "make_svn_version_py.generate_svn_version_py( )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 2, + "token_count": 81, + "parameters": [], + "start_line": 820, + "end_line": 838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 2 + }, + { + "name": "make_svn_version_py", + "long_name": "make_svn_version_py( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 809, + "end_line": 842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "make_config_py", + "long_name": "make_config_py( self , name = '__config__' )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "name" + ], + "start_line": 844, + "end_line": 849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_cmd", + "long_name": "get_cmd( cmdname , _cache = { } )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 65, + "parameters": [ + "cmdname", + "_cache" + ], + "start_line": 851, + "end_line": 861, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "default_config_dict", + "long_name": "default_config_dict( name = None , parent_name = None , local_path = None )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 1, + "token_count": 70, + "parameters": [ + "name", + "parent_name", + "local_path" + ], + "start_line": 881, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 895, + "end_line": 900, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "appendpath", + "long_name": "appendpath( prefix , path )", + "filename": "misc_util.py", + "nloc": 19, + "complexity": 6, + "token_count": 237, + "parameters": [ + "prefix", + "path" + ], + "start_line": 902, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generate_config_py", + "long_name": "generate_config_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 28, + "complexity": 2, + "token_count": 145, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 923, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "generate_svn_version_py", + "long_name": "generate_svn_version_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 109, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 961, + "end_line": 988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "allpath", + "long_name": "allpath( name )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "name" + ], + "start_line": 9, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "get_path", + "long_name": "get_path( mod_name , parent_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 132, + "parameters": [ + "mod_name", + "parent_path" + ], + "start_line": 14, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "terminal_has_colors", + "long_name": "terminal_has_colors( )", + "filename": "misc_util.py", + "nloc": 18, + "complexity": 13, + "token_count": 137, + "parameters": [], + "start_line": 38, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "cyg2win32", + "long_name": "cyg2win32( path )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "path" + ], + "start_line": 80, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "_get_f90_modules", + "long_name": "_get_f90_modules( source )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 77, + "parameters": [ + "source" + ], + "start_line": 92, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "all_strings", + "long_name": "all_strings( lst )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 26, + "parameters": [ + "lst" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_f_sources", + "long_name": "has_f_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 117, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "has_cxx_sources", + "long_name": "has_cxx_sources( sources )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 21, + "parameters": [ + "sources" + ], + "start_line": 124, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "filter_sources", + "long_name": "filter_sources( sources )", + "filename": "misc_util.py", + "nloc": 17, + "complexity": 5, + "token_count": 84, + "parameters": [ + "sources" + ], + "start_line": 131, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "_get_headers", + "long_name": "_get_headers( directory_list )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "directory_list" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_get_directories", + "long_name": "_get_directories( list_of_sources )", + "filename": "misc_util.py", + "nloc": 7, + "complexity": 4, + "token_count": 51, + "parameters": [ + "list_of_sources" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "get_dependencies", + "long_name": "get_dependencies( sources )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "sources" + ], + "start_line": 171, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "is_local_src_dir", + "long_name": "is_local_src_dir( directory )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 6, + "token_count": 112, + "parameters": [ + "directory" + ], + "start_line": 175, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "_gsf_visit_func", + "long_name": "_gsf_visit_func( filenames , dirname , names )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 7, + "token_count": 103, + "parameters": [ + "filenames", + "dirname", + "names" + ], + "start_line": 190, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_ext_source_files", + "long_name": "get_ext_source_files( ext )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 4, + "token_count": 87, + "parameters": [ + "ext" + ], + "start_line": 204, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "get_script_files", + "long_name": "get_script_files( scripts )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "scripts" + ], + "start_line": 217, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "get_lib_source_files", + "long_name": "get_lib_source_files( lib )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 4, + "token_count": 111, + "parameters": [ + "lib" + ], + "start_line": 221, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "get_data_files", + "long_name": "get_data_files( data )", + "filename": "misc_util.py", + "nloc": 20, + "complexity": 8, + "token_count": 112, + "parameters": [ + "data" + ], + "start_line": 235, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "dot_join", + "long_name": "dot_join( * args )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "args" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "get_frame", + "long_name": "get_frame( level = 0 )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 3, + "token_count": 50, + "parameters": [ + "level" + ], + "start_line": 259, + "end_line": 266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , package_name = None , parent_name = None , top_path = None , package_path = None , ** attrs )", + "filename": "misc_util.py", + "nloc": 41, + "complexity": 11, + "token_count": 348, + "parameters": [ + "self", + "package_name", + "parent_name", + "top_path", + "package_path", + "attrs" + ], + "start_line": 278, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 1 + }, + { + "name": "todict", + "long_name": "todict( self )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 4, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__dict__", + "long_name": "__dict__( self )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 342, + "end_line": 343, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_distribution", + "long_name": "get_distribution( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 345, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_subpackage", + "long_name": "get_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 8, + "token_count": 333, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 350, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "add_subpackage", + "long_name": "add_subpackage( self , subpackage_name , subpackage_path = None )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 103, + "parameters": [ + "self", + "subpackage_name", + "subpackage_path" + ], + "start_line": 396, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "add_data_dir", + "long_name": "add_data_dir( self , data_path )", + "filename": "misc_util.py", + "nloc": 25, + "complexity": 7, + "token_count": 188, + "parameters": [ + "self", + "data_path" + ], + "start_line": 417, + "end_line": 449, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_data_files", + "long_name": "add_data_files( self , * files )", + "filename": "misc_util.py", + "nloc": 40, + "complexity": 15, + "token_count": 324, + "parameters": [ + "self", + "files" + ], + "start_line": 451, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "add_include_dirs", + "long_name": "add_include_dirs( self , * paths )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "paths" + ], + "start_line": 503, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "add_headers", + "long_name": "add_headers( self , * files )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 7, + "token_count": 143, + "parameters": [ + "self", + "files" + ], + "start_line": 514, + "end_line": 533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "_fix_paths", + "long_name": "_fix_paths( self , paths )", + "filename": "misc_util.py", + "nloc": 22, + "complexity": 8, + "token_count": 136, + "parameters": [ + "self", + "paths" + ], + "start_line": 535, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "paths", + "long_name": "paths( self , * paths )", + "filename": "misc_util.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "paths" + ], + "start_line": 558, + "end_line": 561, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "add_extension", + "long_name": "add_extension( self , name , sources , ** kw )", + "filename": "misc_util.py", + "nloc": 45, + "complexity": 14, + "token_count": 365, + "parameters": [ + "self", + "name", + "sources", + "kw" + ], + "start_line": 563, + "end_line": 625, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "add_library", + "long_name": "add_library( self , name , sources , ** build_info )", + "filename": "misc_util.py", + "nloc": 14, + "complexity": 4, + "token_count": 98, + "parameters": [ + "self", + "name", + "sources", + "build_info" + ], + "start_line": 627, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "add_scripts", + "long_name": "add_scripts( self , * files )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "files" + ], + "start_line": 653, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "dict_append", + "long_name": "dict_append( self , ** dict )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 6, + "token_count": 138, + "parameters": [ + "self", + "dict" + ], + "start_line": 664, + "end_line": 678, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 680, + "end_line": 689, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_config_cmd", + "long_name": "get_config_cmd( self )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 691, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_build_temp_dir", + "long_name": "get_build_temp_dir( self )", + "filename": "misc_util.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 702, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "have_f77c", + "long_name": "have_f77c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 707, + "end_line": 718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "have_f90c", + "long_name": "have_f90c( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 720, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "append_to", + "long_name": "append_to( self , extlib )", + "filename": "misc_util.py", + "nloc": 12, + "complexity": 2, + "token_count": 83, + "parameters": [ + "self", + "extlib" + ], + "start_line": 733, + "end_line": 746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_svn_revision", + "long_name": "_get_svn_revision( self , path )", + "filename": "misc_util.py", + "nloc": 10, + "complexity": 3, + "token_count": 77, + "parameters": [ + "self", + "path" + ], + "start_line": 748, + "end_line": 759, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "get_version", + "long_name": "get_version( self )", + "filename": "misc_util.py", + "nloc": 38, + "complexity": 11, + "token_count": 257, + "parameters": [ + "self" + ], + "start_line": 761, + "end_line": 807, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 1 + }, + { + "name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file", + "long_name": "make_svn_version_py.make_svn_version_py.generate_svn_version_py.rm_file( f = target )", + "filename": "misc_util.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "f" + ], + "start_line": 831, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 3 + }, + { + "name": "make_svn_version_py.generate_svn_version_py", + "long_name": "make_svn_version_py.generate_svn_version_py( )", + "filename": "misc_util.py", + "nloc": 13, + "complexity": 2, + "token_count": 81, + "parameters": [], + "start_line": 820, + "end_line": 838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 2 + }, + { + "name": "make_svn_version_py", + "long_name": "make_svn_version_py( self )", + "filename": "misc_util.py", + "nloc": 8, + "complexity": 2, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 809, + "end_line": 842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "make_config_py", + "long_name": "make_config_py( self , name = '__config__' )", + "filename": "misc_util.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "name" + ], + "start_line": 844, + "end_line": 849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_cmd", + "long_name": "get_cmd( cmdname , _cache = { } )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 65, + "parameters": [ + "cmdname", + "_cache" + ], + "start_line": 851, + "end_line": 861, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "default_config_dict", + "long_name": "default_config_dict( name = None , parent_name = None , local_path = None )", + "filename": "misc_util.py", + "nloc": 9, + "complexity": 1, + "token_count": 70, + "parameters": [ + "name", + "parent_name", + "local_path" + ], + "start_line": 881, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "misc_util.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 895, + "end_line": 900, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "appendpath", + "long_name": "appendpath( prefix , path )", + "filename": "misc_util.py", + "nloc": 19, + "complexity": 6, + "token_count": 237, + "parameters": [ + "prefix", + "path" + ], + "start_line": 902, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generate_config_py", + "long_name": "generate_config_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 28, + "complexity": 2, + "token_count": 145, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 923, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "generate_svn_version_py", + "long_name": "generate_svn_version_py( extension , build_dir )", + "filename": "misc_util.py", + "nloc": 15, + "complexity": 4, + "token_count": 109, + "parameters": [ + "extension", + "build_dir" + ], + "start_line": 961, + "end_line": 988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_numpy_include_dirs", + "long_name": "get_numpy_include_dirs( )", + "filename": "misc_util.py", + "nloc": 11, + "complexity": 3, + "token_count": 85, + "parameters": [], + "start_line": 863, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 739, + "complexity": 231, + "token_count": 5512, + "diff_parsed": { + "added": [ + " if numpy.show_config is None:" + ], + "deleted": [ + " if numpy.show_core_config is None:" + ] + } + } + ] + }, + { + "hash": "4dd79b090e85566d3d3290357c3a9bbdd2558dc1", + "msg": "Added i0 natively for kaiser window", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T08:36:12+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T08:36:12+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "de399f0bc36d35703bb87a79ce3510c7ccada586" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 31, + "insertions": 121, + "lines": 152, + "files": 10, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": "numpy/_import_tools.py", + "new_path": "numpy/_import_tools.py", + "filename": "_import_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -264,12 +264,12 @@ def __call__(self,*packages, **options):\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n \n- import numpy.linalg, numpy.fft, numpy.etc...\n+ import numpy.linalg, numpy.dft, numpy.etc...\n \n Instead, you can say:\n \n import numpy\n- numpy.pkgload('linalg','fft',...)\n+ numpy.pkgload('linalg','dft',...)\n \n or\n \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.dft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','dft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\n", + "source_code_before": "\nimport os\nimport sys\nimport imp\nfrom glob import glob\n\nclass PackageImport:\n \"\"\" Import packages from the current directory that implement\n info.py. See numpy/doc/DISTUTILS.txt for more info.\n \"\"\"\n\n imported_packages = []\n\n def __init__(self):\n self.frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__[0]',frame.f_globals,frame.f_locals)\n\n def get_info_modules(self,packages=None):\n \"\"\"\n Return info modules of packages or all packages in parent path.\n \"\"\"\n if packages is None:\n info_files = glob(os.path.join(self.parent_path,'*','info.py'))\n else:\n info_files = [os.path.join(self.parent_path,package,'info.py') \\\n for package in packages]\n info_modules = {}\n for info_file in info_files:\n package_name = os.path.basename(os.path.dirname(info_file))\n fullname = self.parent_name +'.'+ package_name\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,'U'),\n info_file,\n ('.py','U',1))\n except Exception,msg:\n print >> sys.stderr, msg\n info_module = None\n\n if info_module is None:\n continue\n if getattr(info_module,'ignore',False):\n continue\n\n info_modules[fullname] = info_module\n\n return info_modules\n\n def _sort_info_modules(self, info_modules):\n \"\"\"\n Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n depend_dict = {}\n for fullname,info_module in info_modules.items():\n depend_dict[fullname] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def _get_doc_title(self, info_module):\n \"\"\" Get the title from a package info.py file.\n \"\"\"\n title = getattr(info_module,'__doc_title__',None)\n if title is not None:\n return title\n title = getattr(info_module,'__doc__',None)\n if title is not None:\n title = title.lstrip().split('\\n',1)[0]\n return title\n return '* Not Available *'\n\n def _format_titles(self,titles):\n lengths = [len(name)-name.find('.')-1 for (name,title) in titles]\n max_length = max(lengths)\n lines = []\n for (name,title) in titles:\n name = name[name.find('.')+1:]\n w = max_length - len(name)\n lines.append('%s%s --- %s' % (name, w*' ', title))\n return '\\n'.join(lines)\n\n def import_packages(self, packages=None):\n \"\"\"\n Import packages that implement info.py.\n Return a list of documentation strings info.__doc__ of succesfully\n imported packages.\n \"\"\"\n info_modules = self.get_info_modules(packages)\n package_names = self._sort_info_modules(info_modules)\n frame = self.frame\n\n titles = []\n\n for fullname in package_names:\n if fullname in self.imported_packages:\n continue\n package_name = fullname.split('.')[-1]\n info_module = info_modules[fullname]\n global_symbols = getattr(info_module,'global_symbols',[])\n postpone_import = getattr(info_module,'postpone_import',True)\n \n try:\n #print 'Importing',package_name,'to',self.parent_name\n exec ('import '+package_name, frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',package_name\n print >> sys.stderr, msg\n raise\n continue\n\n self.imported_packages.append(fullname)\n\n for symbol in global_symbols:\n try:\n exec ('from '+package_name+' import '+symbol,\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n print >> sys.stderr, 'Failed to import',symbol,'from',package_name\n print >> sys.stderr, msg\n continue\n\n titles.append((fullname,self._get_doc_title(info_module)))\n\n try:\n exec ('\\n%s.test = ScipyTest(%s).test' \\\n % (package_name,package_name),\n frame.f_globals,frame.f_locals)\n except Exception,msg:\n\t\tprint >> sys.stderr, 'Failed to set test function for',package_name\n print >> sys.stderr, msg\n\n return self._format_titles(titles)\n\nclass PackageLoader:\n def __init__(self):\n \"\"\" Manages loading NumPy packages.\n \"\"\"\n\n self.parent_frame = frame = sys._getframe(1)\n self.parent_name = eval('__name__',frame.f_globals,frame.f_locals)\n self.parent_path = eval('__path__',frame.f_globals,frame.f_locals)\n if not frame.f_locals.has_key('__all__'):\n exec('__all__ = []',frame.f_globals,frame.f_locals)\n self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)\n\n self.info_modules = None\n self.imported_packages = []\n self.verbose = None\n\n def _get_info_files(self, package_dir, parent_path, parent_package=None):\n \"\"\" Return list of (package name,info.py file) from parent_path subdirectories.\n \"\"\"\n from glob import glob\n files = glob(os.path.join(parent_path,package_dir,'info.py'))\n for info_file in glob(os.path.join(parent_path,package_dir,'info.pyc')):\n if info_file[:-1] not in files:\n files.append(info_file)\n info_files = []\n for info_file in files:\n package_name = os.path.dirname(info_file[len(parent_path)+1:])\\\n .replace(os.sep,'.')\n if parent_package:\n package_name = parent_package + '.' + package_name\n info_files.append((package_name,info_file))\n info_files.extend(self._get_info_files('*',\n os.path.dirname(info_file),\n package_name))\n return info_files\n\n def _init_info_modules(self, packages=None):\n \"\"\"Initialize info_modules = {: }.\n \"\"\"\n import imp\n info_files = []\n if packages is None:\n for path in self.parent_path:\n info_files.extend(self._get_info_files('*',path))\n else:\n for package_name in packages:\n package_dir = os.path.join(*package_name.split('.'))\n for path in self.parent_path:\n names_files = self._get_info_files(package_dir, path)\n if names_files:\n info_files.extend(names_files)\n break\n else:\n self.warn('Package %r does not have info.py file. Ignoring.'\\\n % package_name)\n\n info_modules = self.info_modules\n for package_name,info_file in info_files:\n if info_modules.has_key(package_name):\n continue\n fullname = self.parent_name +'.'+ package_name\n if info_file[-1]=='c':\n filedescriptor = ('.pyc','rb',2)\n else:\n filedescriptor = ('.py','U',1)\n\n try:\n info_module = imp.load_module(fullname+'.info',\n open(info_file,filedescriptor[1]),\n info_file,\n filedescriptor)\n except Exception,msg:\n self.error(msg)\n info_module = None\n\n if info_module is None or getattr(info_module,'ignore',False):\n info_modules.pop(package_name,None)\n else:\n self._init_info_modules(getattr(info_module,'depends',[]))\n info_modules[package_name] = info_module\n\n return\n\n def _get_sorted_names(self):\n \"\"\" Return package names sorted in the order as they should be\n imported due to dependence relations between packages. \n \"\"\"\n\n depend_dict = {}\n for name,info_module in self.info_modules.items():\n depend_dict[name] = getattr(info_module,'depends',[])\n package_names = []\n\n for name in depend_dict.keys():\n if not depend_dict[name]:\n package_names.append(name)\n del depend_dict[name]\n\n while depend_dict:\n for name, lst in depend_dict.items():\n new_lst = [n for n in lst if depend_dict.has_key(n)]\n if not new_lst:\n package_names.append(name)\n del depend_dict[name]\n else:\n depend_dict[name] = new_lst\n\n return package_names\n\n def __call__(self,*packages, **options):\n \"\"\"Load one or more packages into numpy's top-level namespace.\n\n Usage:\n\n This function is intended to shorten the need to import many of numpy's\n submodules constantly with statements such as\n\n import numpy.linalg, numpy.fft, numpy.etc...\n\n Instead, you can say:\n\n import numpy\n numpy.pkgload('linalg','fft',...)\n\n or\n\n numpy.pkgload()\n\n to load all of them in one call.\n\n If a name which doesn't exist in numpy's namespace is\n given, an exception [[WHAT? ImportError, probably?]] is raised.\n [NotImplemented]\n\n Inputs:\n\n - the names (one or more strings) of all the numpy modules one wishes to\n load into the top-level namespace.\n\n Optional keyword inputs:\n\n - verbose - integer specifying verbosity level [default: 0].\n - force - when True, force reloading loaded packages [default: False].\n - postpone - when True, don't load packages [default: False]\n\n If no input arguments are given, then all of numpy's subpackages are\n imported.\n\n\n Outputs:\n\n The function returns a tuple with all the names of the modules which\n were actually imported. [NotImplemented]\n\n \"\"\"\n frame = self.parent_frame\n self.info_modules = {}\n if options.get('force',False):\n self.imported_packages = []\n self.verbose = verbose = options.get('verbose',False)\n postpone = options.get('postpone',False)\n\n self._init_info_modules(packages or None)\n\n self.log('Imports to %r namespace\\n----------------------------'\\\n % self.parent_name)\n\n for package_name in self._get_sorted_names():\n if package_name in self.imported_packages:\n continue\n info_module = self.info_modules[package_name]\n global_symbols = getattr(info_module,'global_symbols',[]) \n if postpone and not global_symbols:\n self.log('__all__.append(%r)' % (package_name))\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n continue\n \n old_object = frame.f_locals.get(package_name,None)\n\n cmdstr = 'import '+package_name\n if self._execcmd(cmdstr):\n continue\n self.imported_packages.append(package_name)\n \n if verbose!=-1:\n new_object = frame.f_locals.get(package_name)\n if old_object is not None and old_object is not new_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (package_name,self._obj2str(new_object),\n self._obj2str(old_object)))\n\n if '.' not in package_name:\n self.parent_export_names.append(package_name)\n\n for symbol in global_symbols:\n if symbol=='*':\n symbols = eval('getattr(%s,\"__all__\",None)'\\\n % (package_name),\n frame.f_globals,frame.f_locals)\n if symbols is None:\n symbols = eval('dir(%s)' % (package_name),\n frame.f_globals,frame.f_locals)\n symbols = filter(lambda s:not s.startswith('_'),symbols)\n else:\n symbols = [symbol]\n\n if verbose!=-1:\n old_objects = {}\n for s in symbols:\n if frame.f_locals.has_key(s):\n old_objects[s] = frame.f_locals[s]\n\n cmdstr = 'from '+package_name+' import '+symbol\n if self._execcmd(cmdstr):\n continue\n\n if verbose!=-1:\n for s,old_object in old_objects.items():\n new_object = frame.f_locals[s]\n if new_object is not old_object:\n self.warn('Overwriting %s=%s (was %s)' \\\n % (s,self._obj2repr(new_object),\n self._obj2repr(old_object)))\n\n if symbol=='*':\n self.parent_export_names.extend(symbols)\n else:\n self.parent_export_names.append(symbol)\n\n return\n\n def _execcmd(self,cmdstr):\n \"\"\" Execute command in parent_frame.\"\"\"\n frame = self.parent_frame\n try:\n exec (cmdstr, frame.f_globals,frame.f_locals)\n except Exception,msg:\n self.error('%s -> failed: %s' % (cmdstr,msg))\n return True\n else:\n self.log('%s -> success' % (cmdstr)) \n return\n\n def _obj2repr(self,obj):\n \"\"\" Return repr(obj) with\"\"\"\n module = getattr(obj,'__module__',None)\n file = getattr(obj,'__file__',None)\n if module is not None:\n return repr(obj) + ' from ' + module\n if file is not None:\n return repr(obj) + ' from ' + file\n return repr(obj)\n\n def log(self,mess):\n if self.verbose>1:\n print >> sys.stderr, str(mess)\n def warn(self,mess):\n if self.verbose>=0:\n print >> sys.stderr, str(mess)\n def error(self,mess):\n if self.verbose!=-1:\n print >> sys.stderr, str(mess)\n\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_info_modules", + "long_name": "get_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 24, + "complexity": 7, + "token_count": 164, + "parameters": [ + "self", + "packages" + ], + "start_line": 19, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "_sort_info_modules", + "long_name": "_sort_info_modules( self , info_modules )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self", + "info_modules" + ], + "start_line": 50, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "_get_doc_title", + "long_name": "_get_doc_title( self , info_module )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "info_module" + ], + "start_line": 76, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_format_titles", + "long_name": "_format_titles( self , titles )", + "filename": "_import_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 96, + "parameters": [ + "self", + "titles" + ], + "start_line": 88, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "import_packages", + "long_name": "import_packages( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 37, + "complexity": 7, + "token_count": 255, + "parameters": [ + "self", + "packages" + ], + "start_line": 98, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 151, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "_get_info_files", + "long_name": "_get_info_files( self , package_dir , parent_path , parent_package = None )", + "filename": "_import_tools.py", + "nloc": 17, + "complexity": 5, + "token_count": 153, + "parameters": [ + "self", + "package_dir", + "parent_path", + "parent_package" + ], + "start_line": 166, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "_init_info_modules", + "long_name": "_init_info_modules( self , packages = None )", + "filename": "_import_tools.py", + "nloc": 40, + "complexity": 12, + "token_count": 246, + "parameters": [ + "self", + "packages" + ], + "start_line": 186, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "_get_sorted_names", + "long_name": "_get_sorted_names( self )", + "filename": "_import_tools.py", + "nloc": 18, + "complexity": 9, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + }, + { + "name": "_execcmd", + "long_name": "_execcmd( self , cmdstr )", + "filename": "_import_tools.py", + "nloc": 10, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "cmdstr" + ], + "start_line": 382, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "_obj2repr", + "long_name": "_obj2repr( self , obj )", + "filename": "_import_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 63, + "parameters": [ + "self", + "obj" + ], + "start_line": 394, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "log", + "long_name": "log( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 404, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "warn", + "long_name": "warn( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "mess" + ], + "start_line": 407, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "error", + "long_name": "error( self , mess )", + "filename": "_import_tools.py", + "nloc": 3, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self", + "mess" + ], + "start_line": 410, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "__call__", + "long_name": "__call__( self , * packages , ** options )", + "filename": "_import_tools.py", + "nloc": 64, + "complexity": 24, + "token_count": 459, + "parameters": [ + "self", + "packages", + "options" + ], + "start_line": 259, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 122, + "top_nesting_level": 1 + } + ], + "nloc": 287, + "complexity": 93, + "token_count": 2071, + "diff_parsed": { + "added": [ + " import numpy.linalg, numpy.dft, numpy.etc...", + " numpy.pkgload('linalg','dft',...)" + ], + "deleted": [ + " import numpy.linalg, numpy.fft, numpy.etc...", + " numpy.pkgload('linalg','fft',...)" + ] + } + }, + { + "old_path": "numpy/core/defmatrix.py", + "new_path": "numpy/core/defmatrix.py", + "filename": "defmatrix.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -199,7 +199,7 @@ def getH(self):\n return self.transpose()\n \n def getI(self):\n- from numpy.linalg import inv\n+ from numpy.dual import inv\n return matrix(inv(self))\n \n A = property(getA, None, doc=\"base array\")\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\n__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']\n\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power, \\\n isscalar, binary_repr\nimport types\nimport string as str_\nimport sys\n\n# make translation table\n_table = [None]*256\nfor k in range(256):\n _table[k] = chr(k)\n_table = ''.join(_table)\n\n_numchars = str_.digits + \".-+jeEL\"\ndel str_\n_todelete = []\nfor k in _table:\n if k not in _numchars:\n _todelete.append(k)\n_todelete = ''.join(_todelete)\ndel k\n\ndef _eval(astr):\n return eval(astr.translate(_table,_todelete))\n\ndef _convert_from_string(data):\n rows = data.split(';')\n newdata = []\n count = 0\n for row in rows:\n trow = row.split(',')\n newrow = []\n for col in trow:\n temp = col.split()\n newrow.extend(map(_eval,temp))\n if count == 0:\n Ncols = len(newrow)\n elif len(newrow) != Ncols:\n raise ValueError, \"Rows not the same size.\"\n count += 1\n newdata.append(newrow)\n return newdata\n\ndef asmatrix(data, dtype=None): \n \"\"\" Returns 'data' as a matrix. Unlike matrix(), no copy is performed \n if 'data' is already a matrix or array. Equivalent to: \n matrix(data, copy=False) \n \"\"\" \n return matrix(data, dtype=dtype, copy=False) \n\nclass matrix(N.ndarray):\n __array_priority__ = 10.0\n def __new__(subtype, data, dtype=None, copy=True):\n if isinstance(data, matrix):\n dtype2 = data.dtype\n if (dtype is None):\n dtype = dtype2\n if (dtype2 is dtype) and (not copy):\n return data\n return data.astype(dtype)\n\n if dtype is None:\n if isinstance(data, N.ndarray):\n dtype = data.dtype\n intype = N.obj2dtype(dtype)\n\n if isinstance(data, types.StringType):\n data = _convert_from_string(data)\n\n # now convert data to an array\n arr = N.array(data, dtype=intype, copy=copy)\n ndim = arr.ndim\n shape = arr.shape\n if (ndim > 2):\n raise ValueError, \"matrix must be 2-dimensional\"\n elif ndim == 0:\n shape = (1,1)\n elif ndim == 1:\n shape = (1,shape[0])\n\n fortran = False\n if (ndim == 2) and arr.flags.fortran:\n fortran = True\n \n if not (fortran or arr.flags.contiguous):\n arr = arr.copy()\n\n ret = N.ndarray.__new__(subtype, shape, arr.dtypedescr,\n buffer=arr,\n fortran=fortran)\n return ret\n\n def __array_finalize__(self, obj):\n ndim = self.ndim\n if ndim == 0:\n self.shape = (1,1)\n elif ndim == 1:\n self.shape = (1,self.shape[0])\n return\n\n def __getitem__(self, index):\n out = N.ndarray.__getitem__(self, index)\n # Need to swap if slice is on first index\n retscal = False\n try:\n n = len(index)\n if (n==2):\n if isinstance(index[0], types.SliceType):\n if (isscalar(index[1])):\n sh = out.shape\n out.shape = (sh[1], sh[0])\n else:\n if (isscalar(index[0])) and (isscalar(index[1])):\n retscal = True\n except TypeError:\n pass\n if retscal and out.shape == (1,1): # convert scalars\n return out.A[0,0]\n return out\n\n def __mul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(self, other)\n else:\n return N.dot(self, other)\n\n def __rmul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(other, self)\n else:\n return N.dot(other, self)\n\n def __imul__(self, other):\n self[:] = self * other\n return self\n\n def __pow__(self, other):\n shape = self.shape\n if len(shape) != 2 or shape[0] != shape[1]:\n raise TypeError, \"matrix is not square\"\n if type(other) in (type(1), type(1L)):\n if other==0:\n return matrix(N.identity(shape[0]))\n if other<0:\n x = self.I\n other=-other\n else:\n x=self\n result = x\n if other <= 3:\n while(other>1):\n result=result*x\n other=other-1\n return result\n # binary decomposition to reduce the number of Matrix\n # Multiplies for other > 3.\n beta = binary_repr(other)\n t = len(beta)\n Z,q = x.copy(),0\n while beta[t-q-1] == '0':\n Z *= Z\n q += 1\n result = Z.copy()\n for k in range(q+1,t):\n Z *= Z\n if beta[t-k-1] == '1':\n result *= Z\n return result\n else:\n raise TypeError, \"exponent must be an integer\"\n\n def __rpow__(self, other):\n raise NotImplementedError\n\n def __repr__(self):\n return repr(self.__array__()).replace('array','matrix')\n\n def __str__(self):\n return str(self.__array__())\n\n # Needed becase tolist method expects a[i] \n # to have dimension a.ndim-1\n def tolist(self):\n return self.__array__().tolist()\n\n def getA(self):\n return self.__array__()\n\n def getT(self):\n return self.transpose()\n\n def getH(self):\n if issubclass(self.dtype, N.complexfloating):\n return self.transpose().conjugate()\n else:\n return self.transpose()\n\n def getI(self):\n from numpy.dual import inv\n return matrix(inv(self))\n\n A = property(getA, None, doc=\"base array\")\n T = property(getT, None, doc=\"transpose\")\n H = property(getH, None, doc=\"hermitian (conjugate) transpose\")\n I = property(getI, None, doc=\"inverse\")\n\n\ndef _from_string(str,gdict,ldict):\n rows = str.split(';')\n rowtup = []\n for row in rows:\n trow = row.split(',')\n newrow = []\n for x in trow:\n newrow.extend(x.split())\n trow = newrow\n coltup = []\n for col in trow:\n col = col.strip()\n try:\n thismat = ldict[col]\n except KeyError:\n try:\n thismat = gdict[col]\n except KeyError:\n raise KeyError, \"%s not found\" % (col,)\n\n coltup.append(thismat)\n rowtup.append(concatenate(coltup,axis=-1))\n return concatenate(rowtup,axis=0)\n\n\ndef bmat(obj,ldict=None, gdict=None):\n \"\"\"Build a matrix object from string, nested sequence, or array.\n\n Ex: F = bmat('A, B; C, D') \n F = bmat([[A,B],[C,D]])\n F = bmat(r_[c_[A,B],c_[C,D]])\n\n all produce the same Matrix Object [ A B ]\n [ C D ]\n\n if A, B, C, and D are appropriately shaped 2-d arrays.\n \"\"\"\n if isinstance(obj, types.StringType):\n if gdict is None:\n # get previous frame\n frame = sys._getframe().f_back\n glob_dict = frame.f_globals\n loc_dict = frame.f_locals\n else:\n glob_dict = gdict\n loc_dict = ldict\n\n return matrix(_from_string(obj, glob_dict, loc_dict))\n\n if isinstance(obj, (types.TupleType, types.ListType)):\n # [[A,B],[C,D]]\n arr_rows = []\n for row in obj:\n if isinstance(row, ArrayType): # not 2-d\n return matrix(concatenate(obj,axis=-1))\n else:\n arr_rows.append(concatenate(row,axis=-1))\n return matrix(concatenate(arr_rows,axis=0))\n if isinstance(obj, ArrayType):\n return matrix(obj)\n\nmat = matrix\n", + "source_code_before": "\n__all__ = ['matrix', 'bmat', 'mat', 'asmatrix']\n\nimport numeric as N\nfrom numeric import ArrayType, concatenate, integer, multiply, power, \\\n isscalar, binary_repr\nimport types\nimport string as str_\nimport sys\n\n# make translation table\n_table = [None]*256\nfor k in range(256):\n _table[k] = chr(k)\n_table = ''.join(_table)\n\n_numchars = str_.digits + \".-+jeEL\"\ndel str_\n_todelete = []\nfor k in _table:\n if k not in _numchars:\n _todelete.append(k)\n_todelete = ''.join(_todelete)\ndel k\n\ndef _eval(astr):\n return eval(astr.translate(_table,_todelete))\n\ndef _convert_from_string(data):\n rows = data.split(';')\n newdata = []\n count = 0\n for row in rows:\n trow = row.split(',')\n newrow = []\n for col in trow:\n temp = col.split()\n newrow.extend(map(_eval,temp))\n if count == 0:\n Ncols = len(newrow)\n elif len(newrow) != Ncols:\n raise ValueError, \"Rows not the same size.\"\n count += 1\n newdata.append(newrow)\n return newdata\n\ndef asmatrix(data, dtype=None): \n \"\"\" Returns 'data' as a matrix. Unlike matrix(), no copy is performed \n if 'data' is already a matrix or array. Equivalent to: \n matrix(data, copy=False) \n \"\"\" \n return matrix(data, dtype=dtype, copy=False) \n\nclass matrix(N.ndarray):\n __array_priority__ = 10.0\n def __new__(subtype, data, dtype=None, copy=True):\n if isinstance(data, matrix):\n dtype2 = data.dtype\n if (dtype is None):\n dtype = dtype2\n if (dtype2 is dtype) and (not copy):\n return data\n return data.astype(dtype)\n\n if dtype is None:\n if isinstance(data, N.ndarray):\n dtype = data.dtype\n intype = N.obj2dtype(dtype)\n\n if isinstance(data, types.StringType):\n data = _convert_from_string(data)\n\n # now convert data to an array\n arr = N.array(data, dtype=intype, copy=copy)\n ndim = arr.ndim\n shape = arr.shape\n if (ndim > 2):\n raise ValueError, \"matrix must be 2-dimensional\"\n elif ndim == 0:\n shape = (1,1)\n elif ndim == 1:\n shape = (1,shape[0])\n\n fortran = False\n if (ndim == 2) and arr.flags.fortran:\n fortran = True\n \n if not (fortran or arr.flags.contiguous):\n arr = arr.copy()\n\n ret = N.ndarray.__new__(subtype, shape, arr.dtypedescr,\n buffer=arr,\n fortran=fortran)\n return ret\n\n def __array_finalize__(self, obj):\n ndim = self.ndim\n if ndim == 0:\n self.shape = (1,1)\n elif ndim == 1:\n self.shape = (1,self.shape[0])\n return\n\n def __getitem__(self, index):\n out = N.ndarray.__getitem__(self, index)\n # Need to swap if slice is on first index\n retscal = False\n try:\n n = len(index)\n if (n==2):\n if isinstance(index[0], types.SliceType):\n if (isscalar(index[1])):\n sh = out.shape\n out.shape = (sh[1], sh[0])\n else:\n if (isscalar(index[0])) and (isscalar(index[1])):\n retscal = True\n except TypeError:\n pass\n if retscal and out.shape == (1,1): # convert scalars\n return out.A[0,0]\n return out\n\n def __mul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(self, other)\n else:\n return N.dot(self, other)\n\n def __rmul__(self, other):\n if isinstance(other, N.ndarray) and other.ndim == 0:\n return N.multiply(other, self)\n else:\n return N.dot(other, self)\n\n def __imul__(self, other):\n self[:] = self * other\n return self\n\n def __pow__(self, other):\n shape = self.shape\n if len(shape) != 2 or shape[0] != shape[1]:\n raise TypeError, \"matrix is not square\"\n if type(other) in (type(1), type(1L)):\n if other==0:\n return matrix(N.identity(shape[0]))\n if other<0:\n x = self.I\n other=-other\n else:\n x=self\n result = x\n if other <= 3:\n while(other>1):\n result=result*x\n other=other-1\n return result\n # binary decomposition to reduce the number of Matrix\n # Multiplies for other > 3.\n beta = binary_repr(other)\n t = len(beta)\n Z,q = x.copy(),0\n while beta[t-q-1] == '0':\n Z *= Z\n q += 1\n result = Z.copy()\n for k in range(q+1,t):\n Z *= Z\n if beta[t-k-1] == '1':\n result *= Z\n return result\n else:\n raise TypeError, \"exponent must be an integer\"\n\n def __rpow__(self, other):\n raise NotImplementedError\n\n def __repr__(self):\n return repr(self.__array__()).replace('array','matrix')\n\n def __str__(self):\n return str(self.__array__())\n\n # Needed becase tolist method expects a[i] \n # to have dimension a.ndim-1\n def tolist(self):\n return self.__array__().tolist()\n\n def getA(self):\n return self.__array__()\n\n def getT(self):\n return self.transpose()\n\n def getH(self):\n if issubclass(self.dtype, N.complexfloating):\n return self.transpose().conjugate()\n else:\n return self.transpose()\n\n def getI(self):\n from numpy.linalg import inv\n return matrix(inv(self))\n\n A = property(getA, None, doc=\"base array\")\n T = property(getT, None, doc=\"transpose\")\n H = property(getH, None, doc=\"hermitian (conjugate) transpose\")\n I = property(getI, None, doc=\"inverse\")\n\n\ndef _from_string(str,gdict,ldict):\n rows = str.split(';')\n rowtup = []\n for row in rows:\n trow = row.split(',')\n newrow = []\n for x in trow:\n newrow.extend(x.split())\n trow = newrow\n coltup = []\n for col in trow:\n col = col.strip()\n try:\n thismat = ldict[col]\n except KeyError:\n try:\n thismat = gdict[col]\n except KeyError:\n raise KeyError, \"%s not found\" % (col,)\n\n coltup.append(thismat)\n rowtup.append(concatenate(coltup,axis=-1))\n return concatenate(rowtup,axis=0)\n\n\ndef bmat(obj,ldict=None, gdict=None):\n \"\"\"Build a matrix object from string, nested sequence, or array.\n\n Ex: F = bmat('A, B; C, D') \n F = bmat([[A,B],[C,D]])\n F = bmat(r_[c_[A,B],c_[C,D]])\n\n all produce the same Matrix Object [ A B ]\n [ C D ]\n\n if A, B, C, and D are appropriately shaped 2-d arrays.\n \"\"\"\n if isinstance(obj, types.StringType):\n if gdict is None:\n # get previous frame\n frame = sys._getframe().f_back\n glob_dict = frame.f_globals\n loc_dict = frame.f_locals\n else:\n glob_dict = gdict\n loc_dict = ldict\n\n return matrix(_from_string(obj, glob_dict, loc_dict))\n\n if isinstance(obj, (types.TupleType, types.ListType)):\n # [[A,B],[C,D]]\n arr_rows = []\n for row in obj:\n if isinstance(row, ArrayType): # not 2-d\n return matrix(concatenate(obj,axis=-1))\n else:\n arr_rows.append(concatenate(row,axis=-1))\n return matrix(concatenate(arr_rows,axis=0))\n if isinstance(obj, ArrayType):\n return matrix(obj)\n\nmat = matrix\n", + "methods": [ + { + "name": "_eval", + "long_name": "_eval( astr )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "astr" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_string", + "long_name": "_convert_from_string( data )", + "filename": "defmatrix.py", + "nloc": 17, + "complexity": 5, + "token_count": 94, + "parameters": [ + "data" + ], + "start_line": 29, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "asmatrix", + "long_name": "asmatrix( data , dtype = None )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "data", + "dtype" + ], + "start_line": 47, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__new__", + "long_name": "__new__( subtype , data , dtype = None , copy = True )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 15, + "token_count": 231, + "parameters": [ + "subtype", + "data", + "dtype", + "copy" + ], + "start_line": 56, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "__array_finalize__", + "long_name": "__array_finalize__( self , obj )", + "filename": "defmatrix.py", + "nloc": 7, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self", + "obj" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , index )", + "filename": "defmatrix.py", + "nloc": 18, + "complexity": 9, + "token_count": 135, + "parameters": [ + "self", + "index" + ], + "start_line": 104, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 124, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 130, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "other" + ], + "start_line": 136, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 11, + "token_count": 205, + "parameters": [ + "self", + "other" + ], + "start_line": 140, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "__rpow__", + "long_name": "__rpow__( self , other )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "other" + ], + "start_line": 175, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 181, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 186, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getA", + "long_name": "getA( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getT", + "long_name": "getT( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 193, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getH", + "long_name": "getH( self )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_from_string", + "long_name": "_from_string( str , gdict , ldict )", + "filename": "defmatrix.py", + "nloc": 22, + "complexity": 6, + "token_count": 132, + "parameters": [ + "str", + "gdict", + "ldict" + ], + "start_line": 211, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "bmat", + "long_name": "bmat( obj , ldict = None , gdict = None )", + "filename": "defmatrix.py", + "nloc": 20, + "complexity": 7, + "token_count": 155, + "parameters": [ + "obj", + "ldict", + "gdict" + ], + "start_line": 236, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_eval", + "long_name": "_eval( astr )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "astr" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_convert_from_string", + "long_name": "_convert_from_string( data )", + "filename": "defmatrix.py", + "nloc": 17, + "complexity": 5, + "token_count": 94, + "parameters": [ + "data" + ], + "start_line": 29, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "asmatrix", + "long_name": "asmatrix( data , dtype = None )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "data", + "dtype" + ], + "start_line": 47, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__new__", + "long_name": "__new__( subtype , data , dtype = None , copy = True )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 15, + "token_count": 231, + "parameters": [ + "subtype", + "data", + "dtype", + "copy" + ], + "start_line": 56, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "__array_finalize__", + "long_name": "__array_finalize__( self , obj )", + "filename": "defmatrix.py", + "nloc": 7, + "complexity": 3, + "token_count": 46, + "parameters": [ + "self", + "obj" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , index )", + "filename": "defmatrix.py", + "nloc": 18, + "complexity": 9, + "token_count": 135, + "parameters": [ + "self", + "index" + ], + "start_line": 104, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 124, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "self", + "other" + ], + "start_line": 130, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "other" + ], + "start_line": 136, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other )", + "filename": "defmatrix.py", + "nloc": 32, + "complexity": 11, + "token_count": 205, + "parameters": [ + "self", + "other" + ], + "start_line": 140, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 1 + }, + { + "name": "__rpow__", + "long_name": "__rpow__( self , other )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "other" + ], + "start_line": 175, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 181, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 186, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getA", + "long_name": "getA( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getT", + "long_name": "getT( self )", + "filename": "defmatrix.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 193, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getH", + "long_name": "getH( self )", + "filename": "defmatrix.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_from_string", + "long_name": "_from_string( str , gdict , ldict )", + "filename": "defmatrix.py", + "nloc": 22, + "complexity": 6, + "token_count": 132, + "parameters": [ + "str", + "gdict", + "ldict" + ], + "start_line": 211, + "end_line": 233, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "bmat", + "long_name": "bmat( obj , ldict = None , gdict = None )", + "filename": "defmatrix.py", + "nloc": 20, + "complexity": 7, + "token_count": 155, + "parameters": [ + "obj", + "ldict", + "gdict" + ], + "start_line": 236, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 35, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "getI", + "long_name": "getI( self )", + "filename": "defmatrix.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "nloc": 211, + "complexity": 74, + "token_count": 1472, + "diff_parsed": { + "added": [ + " from numpy.dual import inv" + ], + "deleted": [ + " from numpy.linalg import inv" + ] + } + }, + { + "old_path": "numpy/core/ma.py", + "new_path": "numpy/core/ma.py", + "filename": "ma.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -822,7 +822,7 @@ def __nonzero__(self):\n \n \"\"\"\n # XXX: This changes bool conversion logic from MA.\n- # XXX: In MA bool(a) == len(a) != 0, but in scipy\n+ # XXX: In MA bool(a) == len(a) != 0, but in numpy\n # XXX: scalars do not have len \n m = self._mask\n d = self._data\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\"MA: a facility for dealing with missing observations\nMA is generally used as a numpy.array look-alike.\nby Paul F. Dubois.\n\nCopyright 1999, 2000, 2001 Regents of the University of California.\nReleased for unlimited redistribution.\nAdapted for numpy_core 2005 by Travis Oliphant and\n(mainly) Paul Dubois.\n\"\"\"\nimport string, types, sys\n\nimport umath\nimport oldnumeric\nfrom numeric import e, pi, newaxis, ndarray, inf\nfrom oldnumeric import typecodes, amax, amin\nfrom numerictypes import *\nimport numeric\n\n \nMaskType=bool_\ndivide_tolerance = 1.e-35\n\nclass MAError (Exception):\n def __init__ (self, args=None):\n \"Create an exception\"\n self.args = args\n def __str__(self):\n \"Calculate the string representation\"\n return str(self.args)\n __repr__ = __str__\n\nclass _MaskedPrintOption:\n \"One instance of this class, masked_print_option, is created.\"\n def __init__ (self, display):\n \"Create the masked print option object.\"\n self.set_display(display)\n self._enabled = 1\n\n def display (self):\n \"Show what prints for masked values.\"\n return self._display\n\n def set_display (self, s):\n \"set_display(s) sets what prints for masked values.\"\n self._display = s\n\n def enabled (self):\n \"Is the use of the display value enabled?\"\n return self._enabled\n\n def enable(self, flag=1):\n \"Set the enabling flag to flag.\"\n self._enabled = flag\n\n def __str__ (self):\n return str(self._display)\n\n#if you single index into a masked location you get this object.\nmasked_print_option = _MaskedPrintOption('--')\n\n# Use single element arrays or scalars.\ndefault_real_fill_value = 1.e20\ndefault_complex_fill_value = 1.e20 + 0.0j\ndefault_character_fill_value = '-'\ndefault_integer_fill_value = 999999\ndefault_object_fill_value = '?'\n\ndef default_fill_value (obj):\n \"Function to calculate default fill value for an object.\"\n if isinstance(obj, types.FloatType):\n return default_real_fill_value\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return default_integer_fill_value\n elif isinstance(obj, types.StringType):\n return default_character_fill_value\n elif isinstance(obj, types.ComplexType):\n return default_complex_fill_value\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return default_real_fill_value\n if x in typecodes['Integer']:\n return default_integer_fill_value\n if x in typecodes['Complex']:\n return default_complex_fill_value\n if x in typecodes['Character']:\n return default_character_fill_value\n if x in typecodes['UnsignedInteger']:\n return umath.absolute(default_integer_fill_value)\n return default_object_fill_value\n else:\n return default_object_fill_value\n\ndef minimum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking minima.\"\n if isinstance(obj, types.FloatType):\n return numeric.inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return numeric.inf\n if x in typecodes['Integer']:\n return sys.maxint\n if x in typecodes['UnsignedInteger']:\n return sys.maxint\n else:\n raise TypeError, 'Unsuitable type for calculating minimum.'\n\ndef maximum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking maxima.\"\n if isinstance(obj, types.FloatType):\n return -inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return -sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return -inf\n if x in typecodes['Integer']:\n return -sys.maxint\n if x in typecodes['UnsignedInteger']:\n return 0\n else:\n raise TypeError, 'Unsuitable type for calculating maximum.'\n\ndef set_fill_value (a, fill_value):\n \"Set fill value of a if it is a masked array.\"\n if isMaskedArray(a):\n a.set_fill_value (fill_value)\n\ndef getmask (a):\n \"\"\"Mask of values in a; could be None.\n Returns None if a is not a masked array.\n To get an array for sure use getmaskarray.\"\"\"\n if isinstance(a, MaskedArray):\n return a.raw_mask()\n else:\n return None\n\ndef getmaskarray (a):\n \"\"\"Mask of values in a; an array of zeros if mask is None\n or not a masked array, and is a byte-sized integer.\n Do not try to add up entries, for example.\n \"\"\"\n m = getmask(a)\n if m is None:\n return make_mask_none(shape(a))\n else:\n return m\n\ndef is_mask (m):\n \"\"\"Is m a legal mask? Does not check contents, only type.\n \"\"\"\n if m is None or (isinstance(m, ndarray) and \\\n m.dtype is MaskType):\n return 1\n else:\n return 0\n\ndef make_mask (m, copy=0, flag=0):\n \"\"\"make_mask(m, copy=0, flag=0)\n return m as a mask, creating a copy if necessary or requested.\n Can accept any sequence of integers or None. Does not check\n that contents must be 0s and 1s.\n if flag, return None if m contains no true elements.\n \"\"\"\n if m is None:\n return None\n elif isinstance(m, ndarray):\n if m.dtype is MaskType:\n if copy:\n result = numeric.array(m, dtype=MaskType, copy=copy)\n else:\n result = m\n else:\n result = m.astype(MaskType)\n else:\n result = filled(m,True).astype(MaskType)\n\n if flag and not oldnumeric.sometrue(oldnumeric.ravel(result)):\n return None\n else:\n return result\n\ndef make_mask_none (s):\n \"Return a mask of all zeros of shape s.\"\n result = numeric.zeros(s, dtype=MaskType)\n result.shape = s\n return result\n\ndef mask_or (m1, m2):\n \"\"\"Logical or of the mask candidates m1 and m2, treating None as false.\n Result may equal m1 or m2 if the other is None.\n \"\"\"\n if m1 is None: return make_mask(m2)\n if m2 is None: return make_mask(m1)\n if m1 is m2 and is_mask(m1): return m1\n return make_mask(umath.logical_or(m1, m2))\n\ndef filled (a, value = None):\n \"\"\"a as a contiguous numeric array with any masked areas replaced by value\n if value is None or the special element \"masked\", get_fill_value(a)\n is used instead.\n\n If a is already a contiguous numeric array, a itself is returned.\n\n filled(a) can be used to be sure that the result is numeric when\n passing an object a to other software ignorant of MA, in particular to\n numeric itself.\n \"\"\"\n if isinstance(a, MaskedArray):\n return a.filled(value)\n elif isinstance(a, ndarray) and a.flags['CONTIGUOUS']:\n return a\n elif isinstance(a, types.DictType):\n return numeric.array(a, 'O')\n else:\n return numeric.array(a)\n\ndef get_fill_value (a):\n \"\"\"\n The fill value of a, if it has one; otherwise, the default fill value\n for that type.\n \"\"\"\n if isMaskedArray(a):\n result = a.fill_value()\n else:\n result = default_fill_value(a)\n return result\n\ndef common_fill_value (a, b):\n \"The common fill_value of a and b, if there is one, or None\"\n t1 = get_fill_value(a)\n t2 = get_fill_value(b)\n if t1 == t2: return t1\n return None\n\n# Domain functions return 1 where the argument(s) are not in the domain.\nclass domain_check_interval:\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n def __init__(self, y1, y2):\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n self.y1 = y1\n self.y2 = y2\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.logical_or(umath.greater (x, self.y2),\n umath.less(x, self.y1)\n )\n\nclass domain_tan:\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n def __init__(self, eps):\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n self.eps = eps\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less(umath.absolute(umath.cos(x)), self.eps)\n\nclass domain_greater:\n \"domain_greater(v)(x) = true where x <= v\"\n def __init__(self, critical_value):\n \"domain_greater(v)(x) = true where x <= v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less_equal (x, self.critical_value)\n\nclass domain_greater_equal:\n \"domain_greater_equal(v)(x) = true where x < v\"\n def __init__(self, critical_value):\n \"domain_greater_equal(v)(x) = true where x < v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less (x, self.critical_value)\n\nclass masked_unary_operation:\n def __init__ (self, aufunc, fill=0, domain=None):\n \"\"\" masked_unary_operation(aufunc, fill=0, domain=None)\n aufunc(fill) must be defined\n self(x) returns aufunc(x)\n with masked values where domain(x) is true or getmask(x) is true.\n \"\"\"\n self.f = aufunc\n self.fill = fill\n self.domain = domain\n self.__doc__ = getattr(aufunc, \"__doc__\", str(aufunc))\n\n def __call__ (self, a, *args, **kwargs):\n \"Execute the call behavior.\"\n# numeric tries to return scalars rather than arrays when given scalars.\n m = getmask(a)\n d1 = filled(a, self.fill)\n if self.domain is not None:\n m = mask_or(m, self.domain(d1))\n result = self.f(d1, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\n\nclass domain_safe_divide:\n def __init__ (self, tolerance=divide_tolerance):\n self.tolerance = tolerance\n def __call__ (self, a, b):\n return umath.absolute(a) * self.tolerance >= umath.absolute(b)\n\nclass domained_binary_operation:\n \"\"\"Binary operations that have a domain, like divide. These are complicated so they\n are a separate class. They have no reduce, outer or accumulate.\n \"\"\"\n def __init__ (self, abfunc, domain, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.domain = domain\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__(self, a, b):\n \"Execute the call behavior.\"\n ma = getmask(a)\n mb = getmask(b)\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n t = self.domain(d1, d2)\n\n if oldnumeric.sometrue(t, None):\n d2 = where(t, self.filly, d2)\n mb = mask_or(mb, t)\n m = mask_or(ma, mb)\n result = self.f(d1, d2)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n \n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nclass masked_binary_operation:\n def __init__ (self, abfunc, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__ (self, a, b, *args, **kwargs):\n \"Execute the call behavior.\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis with this function.\"\"\"\n m = getmask(target)\n t = filled(target, self.filly)\n if t.shape == ():\n t = t.reshape(1)\n if m is not None:\n m = make_mask(m, copy=1)\n m.shape = (1,)\n if m is None:\n return masked_array (self.f.reduce (t, axis))\n else:\n t = masked_array (t, m)\n t = self.f.reduce(filled(t, self.filly), axis)\n m = umath.logical_and.reduce(m, axis)\n if isinstance(t, ndarray):\n return masked_array(t, m, get_fill_value(target))\n elif m:\n return masked\n else:\n return t\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = self.f.outer(filled(a, self.fillx), filled(b, self.filly))\n return masked_array(d, m)\n\n def accumulate (self, target, axis=0):\n \"\"\"Accumulate target along axis after filling with y fill value.\"\"\"\n t = filled(target, self.filly)\n return masked_array (self.f.accumulate (t, axis))\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nsqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0))\nlog = masked_unary_operation(umath.log, 1.0, domain_greater(0.0))\nlog10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0))\nexp = masked_unary_operation(umath.exp)\nconjugate = masked_unary_operation(umath.conjugate)\nsin = masked_unary_operation(umath.sin)\ncos = masked_unary_operation(umath.cos)\ntan = masked_unary_operation(umath.tan, 0.0, domain_tan(1.e-35))\narcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-1.0, 1.0))\narccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-1.0, 1.0))\narctan = masked_unary_operation(umath.arctan)\n# Missing from numeric\narcsinh = masked_unary_operation(umath.arcsinh)\narccosh = masked_unary_operation(umath.arccosh)\narctanh = masked_unary_operation(umath.arctanh)\nsinh = masked_unary_operation(umath.sinh)\ncosh = masked_unary_operation(umath.cosh)\ntanh = masked_unary_operation(umath.tanh)\nabsolute = masked_unary_operation(umath.absolute)\nfabs = masked_unary_operation(umath.fabs)\nnegative = masked_unary_operation(umath.negative)\nnonzero = masked_unary_operation(oldnumeric.nonzero)\naround = masked_unary_operation(oldnumeric.round_)\nfloor = masked_unary_operation(umath.floor)\nceil = masked_unary_operation(umath.ceil)\nsometrue = masked_unary_operation(oldnumeric.sometrue)\nalltrue = masked_unary_operation(oldnumeric.alltrue, 1)\nlogical_not = masked_unary_operation(umath.logical_not)\n\nadd = masked_binary_operation(umath.add)\nsubtract = masked_binary_operation(umath.subtract)\nsubtract.reduce = None\nmultiply = masked_binary_operation(umath.multiply, 1, 1)\ndivide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1)\ntrue_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1)\nfloor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1)\nremainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1)\nfmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1)\nhypot = masked_binary_operation(umath.hypot)\narctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0)\narctan2.reduce = None\nequal = masked_binary_operation(umath.equal)\nequal.reduce = None\nnot_equal = masked_binary_operation(umath.not_equal)\nnot_equal.reduce = None\nless_equal = masked_binary_operation(umath.less_equal)\nless_equal.reduce = None\ngreater_equal = masked_binary_operation(umath.greater_equal)\ngreater_equal.reduce = None\nless = masked_binary_operation(umath.less)\nless.reduce = None\ngreater = masked_binary_operation(umath.greater)\ngreater.reduce = None\nlogical_and = masked_binary_operation(umath.logical_and)\nlogical_or = masked_binary_operation(umath.logical_or)\nlogical_xor = masked_binary_operation(umath.logical_xor)\nbitwise_and = masked_binary_operation(umath.bitwise_and)\nbitwise_or = masked_binary_operation(umath.bitwise_or)\nbitwise_xor = masked_binary_operation(umath.bitwise_xor)\n\ndef rank (object):\n return oldnumeric.rank(filled(object))\n\ndef shape (object):\n return oldnumeric.shape(filled(object))\n\ndef size (object, axis=None):\n return oldnumeric.size(filled(object), axis)\n\nclass MaskedArray (object):\n \"\"\"Arrays with possibly masked values.\n Masked values of 1 exclude the corresponding element from \n any computation.\n\n Construction:\n x = array(data, dtype=None, copy=True, fortran=False,\n mask = None, fill_value=None)\n\n If copy=False, every effort is made not to copy the data:\n If data is a MaskedArray, and argument mask=None,\n then the candidate data is data.data and the\n mask used is data.mask. If data is a numeric array,\n it is used as the candidate raw data.\n If dtypechar is not None and\n is != data.dtypechar then a data copy is required.\n Otherwise, the candidate is used.\n\n If a data copy is required, raw data stored is the result of:\n numeric.array(data, dtype=dtypechar, copy=copy)\n\n If mask is None there are no masked values. Otherwise mask must\n be convertible to an array of booleans with the same shape as x.\n\n fill_value is used to fill in masked values when necessary,\n such as when printing and in method/function filled().\n The fill_value is not used for computation within this module.\n \"\"\"\n def __init__(self, data, dtype=None, copy=True, fortran=False, \n mask=None, fill_value=None):\n \"\"\"array(data, dtype=None, copy=True, fortran=False, mask=None, fill_value=None)\n If data already a numeric array, its dtype becomes the default value of dtype.\n \"\"\"\n tc = dtype\n need_data_copied = copy\n if isinstance(data, MaskedArray):\n c = data.data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n if mask is None:\n mask = data.mask\n elif mask is not None: #attempting to change the mask\n need_data_copied = True\n\n elif isinstance(data, ndarray):\n c = data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n else:\n need_data_copied = False #because I'll do it now\n c = numeric.array(data, dtype=tc, copy=True, fortran=fortran)\n\n if need_data_copied:\n if tc == ctc:\n self._data = numeric.array(c, dtype=tc, copy=True, fortran=fortran)\n else:\n self._data = c.astype(tc)\n else:\n self._data = c\n\n if mask is None:\n self._mask = None\n self._shared_mask = 0\n else:\n self._mask = make_mask (mask)\n if self._mask is None:\n self._shared_mask = 0\n else:\n self._shared_mask = (self._mask is mask)\n nm = size(self._mask)\n nd = size(self._data)\n if nm != nd:\n if nm == 1:\n self._mask = oldnumeric.resize(self._mask, self._data.shape)\n self._shared_mask = 0\n elif nd == 1:\n self._data = oldnumeric.resize(self._data, self._mask.shape)\n self._data.shape = self._mask.shape\n else:\n raise MAError, \"Mask and data not compatible.\"\n elif nm == 1 and shape(self._mask) != shape(self._data):\n self.unshare_mask()\n self._mask.shape = self._data.shape\n\n self.set_fill_value(fill_value)\n\n def __array__ (self, t = None):\n \"Special hook for numeric. Converts to numeric if possible.\"\n if self._mask is not None:\n if oldnumeric.ravel(self._mask).any():\n raise MAError, \\\n \"\"\"Cannot automatically convert masked array to numeric because data\n is masked in one or more locations.\n \"\"\"\n else: # Mask is all false\n # Optimize to avoid future invocations of this section.\n self._mask = None\n self._shared_mask = 0\n if t:\n return self._data.astype(t)\n else:\n return self._data\n\n def _get_shape(self):\n \"Return the current shape.\"\n return self._data.shape\n\n def _set_shape (self, newshape):\n \"Set the array's shape.\"\n self._data.shape = newshape\n if self._mask is not None:\n self._mask = self._mask.copy()\n self._mask.shape = newshape\n\n def _get_flat(self):\n \"\"\"Calculate the flat value.\n \"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel(), mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.ravel(),\n mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_flat (self, value):\n \"x.flat = value\"\n y = self.ravel()\n y[:] = value\n\n def _get_real(self):\n \"Get the real part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.real, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.real, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_real (self, value):\n \"x.real = value\"\n y = self.real\n y[...] = value\n\n def _get_imaginary(self):\n \"Get the imaginary part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.imag, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.imag, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_imaginary (self, value):\n \"x.imaginary = value\"\n y = self.imaginary\n y[...] = value\n\n def __str__(self):\n \"\"\"Calculate the str representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n if masked_print_option.enabled():\n f = masked_print_option\n else:\n f = self.fill_value()\n res = self.filled(f)\n return str(res)\n\n def __repr__(self):\n \"\"\"Calculate the repr representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n with_mask = \"\"\"\\\narray(data =\n %(data)s,\n mask =\n %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n with_mask1 = \"\"\"\\\narray(data = %(data)s,\n mask = %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n without_mask = \"\"\"array(\n %(data)s)\"\"\"\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n\n n = len(self.shape)\n if self._mask is None:\n if n <=1:\n return without_mask1 % {'data':str(self.filled())}\n return without_mask % {'data':str(self.filled())}\n else:\n if n <=1:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n if self._mask is None:\n return without_mask % {'data':str(self.filled())}\n else:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n\n def __float__(self):\n \"Convert self to float.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python float.'\n return float(self.data.item())\n\n def __int__(self):\n \"Convert self to int.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python int.'\n return int(self.data.item())\n\n def __getitem__(self, i):\n \"Get item described by i. Not a copy as in previous versions.\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i]\n if m is None:\n return dout\n mi = m[i]\n if mi.size == 1:\n if mi: \n return masked\n else:\n return dout\n else:\n return masked_array(dout, mi, fill_value=self._fill_value)\n\n def __getslice__(self, i, j):\n \"Get slice described by i, j\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i:j]\n if m is None:\n return masked_array(dout, fill_value=self._fill_value)\n else:\n return masked_array(dout, mask = m[i:j], fill_value=self._fill_value)\n\n# --------\n# setitem and setslice notes\n# note that if value is masked, it means to mask those locations.\n# setting a value changes the mask to match the value in those locations.\n\n def __setitem__(self, index, value):\n \"Set item described by index. If value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, 'Cannot alter the masked element.'\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n else:\n self.unshare_mask()\n self._mask[index] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[index] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[index] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = True\n else:\n self.unshare_mask()\n self._mask[index] = m\n\n def __setslice__(self, i, j, value):\n \"Set slice i:j; if value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, \"Cannot alter the 'masked' object.\"\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n self._mask[i:j] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[i:j] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[i:j] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(self._data.shape)\n self._shared_mask = False\n self._mask[i:j] = m\n\n def __nonzero__(self):\n \"\"\"returns true if any element is non-zero or masked\n\n \"\"\"\n # XXX: This changes bool conversion logic from MA.\n # XXX: In MA bool(a) == len(a) != 0, but in numpy\n # XXX: scalars do not have len \n m = self._mask\n d = self._data\n return bool(m is not None and m.any()\n or d is not None and d.any())\n \n def __len__ (self):\n \"\"\"Return length of first dimension. This is weird but Python's\n slicing behavior depends on it.\"\"\"\n return len(self._data)\n\n def __and__(self, other):\n \"Return bitwise_and\"\n return bitwise_and(self, other)\n\n def __or__(self, other):\n \"Return bitwise_or\"\n return bitwise_or(self, other)\n\n def __xor__(self, other):\n \"Return bitwise_xor\"\n return bitwise_xor(self, other)\n\n __rand__ = __and__\n __ror__ = __or__\n __rxor__ = __xor__\n\n def __abs__(self):\n \"Return absolute(self)\"\n return absolute(self)\n\n def __neg__(self):\n \"Return negative(self)\"\n return negative(self)\n\n def __pos__(self):\n \"Return array(self)\"\n return array(self)\n\n def __add__(self, other):\n \"Return add(self, other)\"\n return add(self, other)\n\n __radd__ = __add__\n\n def __mod__ (self, other):\n \"Return remainder(self, other)\"\n return remainder(self, other)\n\n def __rmod__ (self, other):\n \"Return remainder(other, self)\"\n return remainder(other, self)\n\n def __lshift__ (self, n):\n return left_shift(self, n)\n\n def __rshift__ (self, n):\n return right_shift(self, n)\n\n def __sub__(self, other):\n \"Return subtract(self, other)\"\n return subtract(self, other)\n\n def __rsub__(self, other):\n \"Return subtract(other, self)\"\n return subtract(other, self)\n\n def __mul__(self, other):\n \"Return multiply(self, other)\"\n return multiply(self, other)\n\n __rmul__ = __mul__\n\n def __div__(self, other):\n \"Return divide(self, other)\"\n return divide(self, other)\n\n def __rdiv__(self, other):\n \"Return divide(other, self)\"\n return divide(other, self)\n\n def __truediv__(self, other):\n \"Return divide(self, other)\"\n return true_divide(self, other)\n\n def __rtruediv__(self, other):\n \"Return divide(other, self)\"\n return true_divide(other, self)\n\n def __floordiv__(self, other):\n \"Return divide(self, other)\"\n return floor_divide(self, other)\n\n def __rfloordiv__(self, other):\n \"Return divide(other, self)\"\n return floor_divide(other, self)\n\n def __pow__(self,other, third=None):\n \"Return power(self, other, third)\"\n return power(self, other, third)\n\n def __sqrt__(self):\n \"Return sqrt(self)\"\n return sqrt(self)\n\n def __iadd__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data += f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = add(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __imul__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data *= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = multiply(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __isub__(self, other):\n \"Subtract other from self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data -= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = subtract(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n\n\n def __idiv__(self, other):\n \"Divide self by other in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n mo = getmask(other)\n result = divide(self, masked_array(f, mask=mo))\n self._data = result.data\n dm = result.raw_mask()\n if dm is not self._mask:\n self._mask = dm\n self._shared_mask = 1\n return self\n\n def __eq__(self,other):\n return equal(self,other)\n\n def __ne__(self,other):\n return not_equal(self,other)\n\n def __lt__(self,other):\n return less(self,other)\n\n def __le__(self,other):\n return less_equal(self,other)\n\n def __gt__(self,other):\n return greater(self,other)\n\n def __ge__(self,other):\n return greater_equal(self,other)\n\n def astype (self, tc):\n \"return self as array of given type.\"\n d = self._data.astype(tc)\n return array(d, mask=self._mask)\n\n def byte_swapped(self):\n \"\"\"Returns the raw data field, byte_swapped. Included for consistency\n with numeric but doesn't make sense in this context.\n \"\"\"\n return self._data.byte_swapped()\n\n def compressed (self):\n \"A 1-D array of all the non-masked data.\"\n d = oldnumeric.ravel(self._data)\n if self._mask is None:\n return array(d)\n else:\n m = 1 - oldnumeric.ravel(self._mask)\n c = oldnumeric.compress(m, d)\n return array(c, copy=0)\n\n def count (self, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n m = self._mask\n s = self._data.shape\n ls = len(s)\n if m is None:\n if ls == 0:\n return 1\n if ls == 1:\n return s[0]\n if axis is None:\n return reduce(lambda x,y:x*y, s)\n else:\n n = s[axis]\n t = list(s)\n del t[axis]\n return ones(t) * n\n if axis is None:\n w = oldnumeric.ravel(m).astype(int) \n n1 = size(w)\n if n1 == 1:\n n2 = w[0]\n else:\n n2 = umath.add.reduce(w)\n return n1 - n2\n else:\n n1 = size(m, axis)\n n2 = sum(m.astype(int), axis)\n return n1 - n2\n\n def dot (self, other):\n \"s.dot(other) = innerproduct(s, other)\"\n return innerproduct(self, other)\n\n def fill_value(self):\n \"Get the current fill value.\"\n return self._fill_value\n\n def filled (self, fill_value=None):\n \"\"\"A numeric array with masked values filled. If fill_value is None,\n use self.fill_value().\n\n If mask is None, copy data only if not contiguous.\n Result is always a contiguous, numeric array.\n# Is contiguous really necessary now?\n \"\"\"\n d = self._data\n m = self._mask\n if m is None:\n if d.flags['CONTIGUOUS']:\n return d\n else:\n return d.copy()\n else:\n if fill_value is None:\n value = self._fill_value\n else:\n value = fill_value\n\n if self is masked:\n result = numeric.array(value).reshape(*d.shape)\n else:\n try:\n result = numeric.array(d, dtype=d.dtype, copy=1)\n result[m] = value\n except:\n #ok, can't put that value in here\n value = numeric.array(value, dtype=object)\n d = d.astype(object)\n result = oldnumeric.choose(m, (d, value))\n return result\n\n def ids (self):\n \"\"\"Return the ids of the data and mask areas\"\"\"\n return (id(self._data), id(self._mask))\n\n def iscontiguous (self):\n \"Is the data contiguous?\"\n return self._data.flags['CONTIGUOUS']\n\n def itemsize(self):\n \"Item size of each data item.\"\n return self._data.itemsize\n\n\n def outer(self, other):\n \"s.outer(other) = outerproduct(s, other)\"\n return outerproduct(self, other)\n\n def put (self, values):\n \"\"\"Set the non-masked entries of self to filled(values).\n No change to mask\n \"\"\"\n iota = numeric.arange(self.size)\n d = self._data\n if self._mask is None:\n ind = iota\n else:\n ind = oldnumeric.compress(1 - self._mask, iota)\n d[ind] = filled(values).astype(d.dtype)\n\n def putmask (self, values):\n \"\"\"Set the masked entries of self to filled(values).\n Mask changed to None.\n \"\"\"\n d = self._data\n if self._mask is not None:\n d[self._mask] = filled(values).astype(d.dtype)\n self._shared_mask = 0\n self._mask = None\n\n def ravel (self):\n \"\"\"Return a 1-D view of self.\"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel())\n else:\n return masked_array(self._data.ravel(), self._mask.ravel())\n\n def raw_data (self):\n \"\"\" Obsolete; use data property instead.\n The raw data; portions may be meaningless.\n May be noncontiguous. Expert use only.\"\"\"\n return self._data\n data = property(fget=raw_data, \n doc=\"The data, but values at masked locations are meaningless.\")\n\n def raw_mask (self):\n \"\"\" Obsolete; use mask property instead.\n May be noncontiguous. Expert use only.\n \"\"\"\n return self._mask\n mask = property(fget=raw_mask, \n doc=\"The mask, may be None. Values where mask true are meaningless.\")\n\n def reshape (self, *s):\n \"\"\"This array reshaped to shape s\"\"\"\n d = self._data.reshape(*s)\n if self._mask is None:\n return masked_array(d)\n else:\n m = self._mask.reshape(*s)\n return masked_array(d, m)\n\n def set_fill_value (self, v=None):\n \"Set the fill value to v. Omit v to restore default.\"\n if v is None:\n v = default_fill_value (self.raw_data())\n self._fill_value = v\n\n def _get_size (self):\n return self._data.size\n size = property(fget=_get_size, doc=\"Number of elements in the array.\")\n## CHECK THIS: signature of numeric.array.size?\n \n def _get_dtypechar(self):\n return self._data.dtypechar\n dtypechar = property(fget=_get_dtypechar, doc=\"type character of the array.\")\n\n def _get_dtype(self):\n return self._data.dtype\n dtype = property(fget=_get_dtype, doc=\"type of the array elements.\")\n\n def item(self):\n \"Return Python scalar if possible.\"\n if self._mask is not None:\n m = oldnumeric.ravel(self._mask)\n try:\n if m[0]:\n return masked\n except IndexError:\n return masked\n return self._data.item()\n\n def tolist(self, fill_value=None):\n \"Convert to list\"\n return self.filled(fill_value).tolist()\n\n def tostring(self, fill_value=None):\n \"Convert to string\"\n return self.filled(fill_value).tostring()\n\n def unmask (self):\n \"Replace the mask by None if possible.\"\n if self._mask is None: return\n m = make_mask(self._mask, flag=1)\n if m is None:\n self._mask = None\n self._shared_mask = 0\n\n def unshare_mask (self):\n \"If currently sharing mask, make a copy.\"\n if self._shared_mask:\n self._mask = make_mask (self._mask, copy=1, flag=0)\n self._shared_mask = 0\n\n shape = property(_get_shape, _set_shape,\n doc = 'tuple giving the shape of the array')\n\n flat = property(_get_flat, _set_flat,\n doc = 'Access array in flat form.')\n\n real = property(_get_real, _set_real,\n doc = 'Access the real part of the array')\n\n imaginary = property(_get_imaginary, _set_imaginary,\n doc = 'Access the imaginary part of the array')\n\n imag = imaginary\n\n#end class MaskedArray\n\narray = MaskedArray\n\ndef isMaskedArray (x):\n \"Is x a masked array, that is, an instance of MaskedArray?\"\n return isinstance(x, MaskedArray)\n\nisarray = isMaskedArray\nisMA = isMaskedArray #backward compatibility\n\ndef allclose (a, b, fill_value=1, rtol=1.e-5, atol=1.e-8):\n \"\"\" Returns true if all components of a and b are equal\n subject to given tolerances.\n If fill_value is 1, masked values considered equal.\n If fill_value is 0, masked values considered unequal.\n The relative error rtol should be positive and << 1.0\n The absolute error atol comes into play for those elements\n of b that are very small or zero; it says how small a must be also.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a)\n d2 = filled(b)\n x = filled(array(d1, copy=0, mask=m), fill_value).astype(float)\n y = filled(array(d2, copy=0, mask=m), 1).astype(float)\n d = umath.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y))\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n\ndef allequal (a, b, fill_value=1):\n \"\"\"\n True if all entries of a and b are equal, using\n fill_value as a truth value where either or both are masked.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n if m is None:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n elif fill_value:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n dm = array(d, mask=m, copy=0)\n return oldnumeric.alltrue(oldnumeric.ravel(filled(dm, 1)))\n else:\n return 0\n\ndef masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1):\n \"\"\"\n masked_values(data, value, rtol=1.e-5, atol=1.e-8)\n Create a masked array; mask is None if possible.\n If copy==0, and otherwise possible, result\n may share data values with original array.\n Let d = filled(data, value). Returns d\n masked where abs(data-value)<= atol + rtol * abs(value)\n if d is of a floating point type. Otherwise returns\n masked_object(d, value, copy)\n \"\"\"\n abs = umath.absolute\n d = filled(data, value)\n if issubclass(d.dtype, numeric.floating):\n m = umath.less_equal(abs(d-value), atol+rtol*abs(value))\n m = make_mask(m, flag=1)\n return array(d, mask = m, copy=copy,\n fill_value=value)\n else:\n return masked_object(d, value, copy=copy)\n\ndef masked_object (data, value, copy=1):\n \"Create array masked where exactly data equal to value\"\n d = filled(data, value)\n dm = make_mask(umath.equal(d, value), flag=1)\n return array(d, mask=dm, copy=copy, fill_value=value)\n\ndef arrayrange(start, stop=None, step=1, dtype=None):\n \"\"\"Just like range() except it returns a array whose type can be specified\n by the keyword argument dtypechar.\n \"\"\"\n return array(numeric.arrayrange(start, stop, step, dtype))\n\narange = arrayrange\n\ndef fromstring (s, t):\n \"Construct a masked array from a string. Result will have no mask.\"\n return masked_array(numeric.fromstring(s, t))\n\ndef left_shift (a, n):\n \"Left shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.left_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.left_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef right_shift (a, n):\n \"Right shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.right_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.right_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef resize (a, new_shape):\n \"\"\"resize(a, new_shape) returns a new array with the specified shape.\n The original array's total size can be any size.\"\"\"\n m = getmask(a)\n if m is not None:\n m = oldnumeric.resize(m, new_shape)\n result = array(oldnumeric.resize(filled(a), new_shape), mask=m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef repeat(a, repeats, axis=0):\n \"\"\"repeat elements of a repeats times along axis\n repeats is a sequence of length a.shape[axis]\n telling how many times to repeat each element.\n \"\"\"\n af = filled(a)\n if isinstance(repeats, types.IntType):\n repeats = tuple([repeats]*(shape(af)[axis]))\n\n m = getmask(a)\n if m is not None:\n m = oldnumeric.repeat(m, repeats, axis)\n d = oldnumeric.repeat(af, repeats, axis)\n result = masked_array(d, m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef identity(n):\n \"\"\"identity(n) returns the identity matrix of shape n x n.\n \"\"\"\n return array(numeric.identity(n))\n\ndef indices (dimensions, dtype=None):\n \"\"\"indices(dimensions,dtype=None) returns an array representing a grid\n of indices with row-only, and column-only variation.\n \"\"\"\n return array(numeric.indices(dimensions, dtype))\n\ndef zeros (shape, dtype=int):\n \"\"\"zeros(n, dtype=int) =\n an array of all zeros of the given length or shape.\"\"\"\n return array(numeric.zeros(shape, dtype))\n\ndef ones (shape, dtype=int):\n \"\"\"ones(n, dtype=int) =\n an array of all ones of the given length or shape.\"\"\"\n return array(numeric.ones(shape, dtype))\n\n\ndef count (a, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n a = masked_array(a)\n return a.count(axis)\n\ndef power (a, b, third=None):\n \"a**b\"\n if third is not None:\n raise MAError, \"3-argument power not supported.\"\n ma = getmask(a)\n mb = getmask(b)\n m = mask_or(ma, mb)\n fa = filled(a, 1)\n fb = filled(b, 1)\n if fb.dtypechar in typecodes[\"Integer\"]:\n return masked_array(umath.power(fa, fb), m)\n md = make_mask(umath.less_equal (fa, 0), flag=1)\n m = mask_or(m, md)\n if m is None:\n return masked_array(umath.power(fa, fb))\n else:\n fa = numeric.where(m, 1, fa)\n return masked_array(umath.power(fa, fb), m)\n\ndef masked_array (a, mask=None, fill_value=None):\n \"\"\"masked_array(a, mask=None) =\n array(a, mask=mask, copy=0, fill_value=fill_value)\n \"\"\"\n return array(a, mask=mask, copy=0, fill_value=fill_value)\n\nsum = add.reduce\nproduct = multiply.reduce\n\ndef average (a, axis=0, weights=None, returned = 0):\n \"\"\"average(a, axis=0, weights=None)\n Computes average along indicated axis.\n If axis is None, average over the entire array\n Inputs can be integer or floating types; result is of type float.\n\n If weights are given, result is sum(a*weights)/(sum(weights)*1.0)\n weights must have a's shape or be the 1-d with length the size\n of a in the given axis.\n\n If returned, return a tuple: the result and the sum of the weights\n or count of values. Results will have the same shape.\n\n masked values in the weights will be set to 0.0\n \"\"\"\n a = masked_array(a)\n mask = a.mask\n ash = a.shape\n if ash == ():\n ash = (1,)\n if axis is None:\n if mask is None:\n if weights is None:\n n = add.reduce(a.raw_data().ravel())\n d = reduce(lambda x, y: x * y, ash, 1.0)\n else:\n w = filled(weights, 0.0).ravel()\n n = umath.add.reduce(a.raw_data().ravel() * w)\n d = umath.add.reduce(w)\n del w\n else:\n if weights is None:\n n = add.reduce(a.ravel())\n w = oldnumeric.choose(mask, (1.0,0.0)).ravel()\n d = umath.add.reduce(w)\n del w\n else:\n w = array(filled(weights, 0.0), float, mask=mask).ravel()\n n = add.reduce(a.ravel() * w)\n d = add.reduce(w)\n del w\n else:\n if mask is None:\n if weights is None:\n d = ash[axis] * 1.0\n n = umath.add.reduce(a.raw_data(), axis)\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = numeric.array(w, float, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * ones(ash, float)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w, r\n else:\n raise ValueError, 'average: weights wrong shape.'\n else:\n if weights is None:\n n = add.reduce(a, axis)\n w = numeric.choose(mask, (1.0, 0.0))\n d = umath.add.reduce(w, axis)\n del w\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = array(w, float, mask=mask, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * masked_array(ones(ash, float), mask)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n else:\n raise ValueError, 'average: weights wrong shape.'\n del w\n #print n, d, repr(mask), repr(weights)\n if n is masked or d is masked: return masked\n result = divide (n, d)\n del n\n\n if isinstance(result, MaskedArray):\n result.unmask()\n if returned:\n if not isinstance(d, MaskedArray):\n d = masked_array(d)\n if not d.shape == result.shape:\n d = ones(result.shape, float) * d\n d.unmask()\n if returned:\n return result, d\n else:\n return result\n\ndef where (condition, x, y):\n \"\"\"where(condition, x, y) is x where condition is nonzero, y otherwise.\n condition must be convertible to an integer array.\n Answer is always the shape of condition.\n The type depends on x and y. It is integer if both x and y are\n the value masked.\n \"\"\"\n fc = filled(not_equal(condition,0), 0)\n if x is masked:\n xv = 0\n xm = 1\n else:\n xv = filled(x)\n xm = getmask(x)\n if xm is None: xm = 0\n if y is masked:\n yv = 0\n ym = 1\n else:\n yv = filled(y)\n ym = getmask(y)\n if ym is None: ym = 0\n d = numeric.choose(fc, (yv, xv))\n md = numeric.choose(fc, (ym, xm))\n m = getmask(condition)\n m = make_mask(mask_or(m, md), copy=0, flag=1)\n return masked_array(d, m)\n\ndef choose (indices, t):\n \"Returns array shaped like indices with elements chosen from t\"\n def fmask (x):\n if x is masked: return 1\n return filled(x)\n def nmask (x):\n if x is masked: return 1\n m = getmask(x)\n if m is None: return 0\n return m\n c = filled(indices,0)\n masks = [nmask(x) for x in t]\n a = [fmask(x) for x in t]\n d = numeric.choose(c, a)\n m = numeric.choose(c, masks)\n m = make_mask(mask_or(m, getmask(indices)), copy=0, flag=1)\n return masked_array(d, m)\n\ndef masked_where(condition, x, copy=1):\n \"\"\"Return x as an array masked where condition is true.\n Also masked where x or condition masked.\n \"\"\"\n cm = filled(condition,1)\n m = mask_or(getmask(x), cm)\n return array(filled(x), copy=copy, mask=m)\n\ndef masked_greater(x, value, copy=1):\n \"masked_greater(x, value) = x masked where x > value\"\n return masked_where(greater(x, value), x, copy)\n\ndef masked_greater_equal(x, value, copy=1):\n \"masked_greater_equal(x, value) = x masked where x >= value\"\n return masked_where(greater_equal(x, value), x, copy)\n\ndef masked_less(x, value, copy=1):\n \"masked_less(x, value) = x masked where x < value\"\n return masked_where(less(x, value), x, copy)\n\ndef masked_less_equal(x, value, copy=1):\n \"masked_less_equal(x, value) = x masked where x <= value\"\n return masked_where(less_equal(x, value), x, copy)\n\ndef masked_not_equal(x, value, copy=1):\n \"masked_not_equal(x, value) = x masked where x != value\"\n d = filled(x,0)\n c = umath.not_equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_equal(x, value, copy=1):\n \"\"\"masked_equal(x, value) = x masked where x == value\n For floating point consider masked_values(x, value) instead.\n \"\"\"\n d = filled(x,0)\n c = umath.equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_inside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are inside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d=filled(x, 0)\n c = umath.logical_and(umath.less_equal(d, v2), umath.greater_equal(d, v1))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef masked_outside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are outside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d = filled(x,0)\n c = umath.logical_or(umath.less(d, v1), umath.greater(d, v2))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef reshape (a, *newshape):\n \"Copy of a with a new shape.\"\n m = getmask(a)\n d = filled(a).reshape(*newshape)\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.reshape(m, *newshape))\n\ndef ravel (a):\n \"a as one-dimensional, may share data and mask\"\n m = getmask(a)\n d = oldnumeric.ravel(filled(a))\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.ravel(m))\n\ndef concatenate (arrays, axis=0):\n \"Concatenate the arrays along the given axis\"\n d = []\n for x in arrays:\n d.append(filled(x))\n d = numeric.concatenate(d, axis)\n for x in arrays:\n if getmask(x) is not None: break\n else:\n return masked_array(d)\n dm = []\n for x in arrays:\n dm.append(getmaskarray(x))\n dm = numeric.concatenate(dm, axis)\n return masked_array(d, mask=dm)\n\ndef take (a, indices, axis=0):\n \"take(a, indices, axis=0) returns selection of items from a.\"\n m = getmask(a)\n d = masked_array(a).raw_data()\n if m is None:\n return masked_array(numeric.take(d, indices, axis))\n else:\n return masked_array(numeric.take(d, indices, axis),\n mask = numeric.take(m, indices, axis))\n\ndef transpose(a, axes=None):\n \"transpose(a, axes=None) reorder dimensions per tuple axes\"\n m = getmask(a)\n d = filled(a)\n if m is None:\n return masked_array(numeric.transpose(d, axes))\n else:\n return masked_array(numeric.transpose(d, axes),\n mask = numeric.transpose(m, axes))\n\n\ndef put(a, indices, values):\n \"\"\"put(a, indices, values) sets storage-indexed locations to corresponding values.\n\n Values and indices are filled if necessary.\n\n \"\"\"\n d = a.raw_data()\n ind = filled(indices)\n v = filled(values)\n numeric.put (d, ind, v)\n m = getmask(a)\n if m is not None:\n a.unshare_mask()\n numeric.put(a.raw_mask(), ind, 0)\n\ndef putmask(a, mask, values):\n \"putmask(a, mask, values) sets a where mask is true.\"\n if mask is None:\n return\n numeric.putmask(a.raw_data(), mask, values)\n m = getmask(a)\n if m is None: return\n a.unshare_mask()\n numeric.putmask(a.raw_mask(), mask, 0)\n\ndef innerproduct(a,b):\n \"\"\"innerproduct(a,b) returns the dot product of two arrays, which has\n shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the\n product of the elements from the last dimensions of a and b.\n Masked elements are replace by zeros.\n \"\"\"\n fa = filled(a, 0)\n fb = filled(b, 0)\n if len(fa.shape) == 0: fa.shape = (1,)\n if len(fb.shape) == 0: fb.shape = (1,)\n return masked_array(numeric.innerproduct(fa, fb))\n\ndef outerproduct(a, b):\n \"\"\"outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))\"\"\"\n fa = filled(a,0).ravel()\n fb = filled(b,0).ravel()\n d = numeric.outerproduct(fa, fb)\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n return masked_array(d)\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = make_mask(1-numeric.outerproduct(1-ma,1-mb), copy=0)\n return masked_array(d, m)\n\ndef dot(a, b):\n \"\"\"dot(a,b) returns matrix-multiplication between a and b. The product-sum\n is over the last dimension of a and the second-to-last dimension of b.\n Masked values are replaced by zeros. See also innerproduct.\n \"\"\"\n return innerproduct(filled(a,0), numeric.swapaxes(filled(b,0), -1, -2))\n\ndef compress(condition, x, dimension=-1):\n \"\"\"Select those parts of x for which condition is true.\n Masked values in condition are considered false.\n \"\"\"\n c = filled(condition, 0)\n m = getmask(x)\n if m is not None:\n m=numeric.compress(c, m, dimension)\n d = numeric.compress(c, filled(x), dimension)\n return masked_array(d, m)\n\nclass _minimum_operation:\n \"Object to calculate minima\"\n def __init__ (self):\n \"\"\"minimum(a, b) or minimum(a)\n In one argument case returns the scalar minimum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amin(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amin(ac.raw_data())\n else:\n return where(less(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.minimum.reduce (t, axis))\n else:\n t = umath.minimum.reduce(filled(target, minimum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.minimum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nminimum = _minimum_operation ()\n\nclass _maximum_operation:\n \"Object to calculate maxima\"\n def __init__ (self):\n \"\"\"maximum(a, b) or maximum(a)\n In one argument case returns the scalar maximum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amax(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amax(ac.raw_data())\n else:\n return where(greater(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.maximum.reduce (t, axis))\n else:\n t = umath.maximum.reduce(filled(target, maximum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.maximum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nmaximum = _maximum_operation ()\n\ndef sort (x, axis = -1, fill_value=None):\n \"\"\"If x does not have a mask, return a masked array formed from the\n result of numeric.sort(x, axis).\n Otherwise, fill x with fill_value. Sort it.\n Set a mask where the result is equal to fill_value.\n Note that this may have unintended consequences if the data contains the\n fill value at a non-masked site.\n\n If fill_value is not given the default fill value for x's type will be\n used.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n d = filled(x, fill_value)\n s = oldnumeric.sort(d, axis)\n if getmask(x) is None:\n return masked_array(s)\n return masked_values(s, fill_value, copy=0)\n\ndef diagonal(a, k = 0, axis1=0, axis2=1):\n \"\"\"diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a\"\"\"\n d = oldnumeric.diagonal(filled(a), k, axis1, axis2)\n m = getmask(a)\n if m is None:\n return masked_array(d, m)\n else:\n return masked_array(d, oldnumeric.diagonal(m, k, axis1, axis2))\n\ndef argsort (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for sorting along given axis.\n if fill_value is None, use get_fill_value(x)\n Returns a numpy array.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argsort(d, axis)\n\ndef argmin (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return indices for minimum values along given axis.\n if fill_value is None, use get_fill_value(x).\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argmin(d, axis)\n\ndef argmax (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for maximum along given axis.\n if fill_value is None, use -get_fill_value(x) if it exists.\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n try:\n fill_value = - fill_value\n except:\n pass\n d = filled(x, fill_value)\n return oldnumeric.argmax(d, axis)\n\ndef fromfunction (f, s):\n \"\"\"apply f to s to create array as in umath.\"\"\"\n return masked_array(numeric.fromfunction(f,s))\n\ndef asarray(data, dtype=None):\n \"\"\"asarray(data, dtype) = array(data, dtype, copy=0)\n \"\"\"\n if isinstance(data, MaskedArray) and \\\n (dtype is None or dtype == data.dtype):\n return data\n return array(data, dtype=dtype, copy=0)\n\nmasked = MaskedArray([0], int, mask=[1])[0:0]\nmasked = masked[0:0]\n", + "source_code_before": "\"\"\"MA: a facility for dealing with missing observations\nMA is generally used as a numpy.array look-alike.\nby Paul F. Dubois.\n\nCopyright 1999, 2000, 2001 Regents of the University of California.\nReleased for unlimited redistribution.\nAdapted for numpy_core 2005 by Travis Oliphant and\n(mainly) Paul Dubois.\n\"\"\"\nimport string, types, sys\n\nimport umath\nimport oldnumeric\nfrom numeric import e, pi, newaxis, ndarray, inf\nfrom oldnumeric import typecodes, amax, amin\nfrom numerictypes import *\nimport numeric\n\n \nMaskType=bool_\ndivide_tolerance = 1.e-35\n\nclass MAError (Exception):\n def __init__ (self, args=None):\n \"Create an exception\"\n self.args = args\n def __str__(self):\n \"Calculate the string representation\"\n return str(self.args)\n __repr__ = __str__\n\nclass _MaskedPrintOption:\n \"One instance of this class, masked_print_option, is created.\"\n def __init__ (self, display):\n \"Create the masked print option object.\"\n self.set_display(display)\n self._enabled = 1\n\n def display (self):\n \"Show what prints for masked values.\"\n return self._display\n\n def set_display (self, s):\n \"set_display(s) sets what prints for masked values.\"\n self._display = s\n\n def enabled (self):\n \"Is the use of the display value enabled?\"\n return self._enabled\n\n def enable(self, flag=1):\n \"Set the enabling flag to flag.\"\n self._enabled = flag\n\n def __str__ (self):\n return str(self._display)\n\n#if you single index into a masked location you get this object.\nmasked_print_option = _MaskedPrintOption('--')\n\n# Use single element arrays or scalars.\ndefault_real_fill_value = 1.e20\ndefault_complex_fill_value = 1.e20 + 0.0j\ndefault_character_fill_value = '-'\ndefault_integer_fill_value = 999999\ndefault_object_fill_value = '?'\n\ndef default_fill_value (obj):\n \"Function to calculate default fill value for an object.\"\n if isinstance(obj, types.FloatType):\n return default_real_fill_value\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return default_integer_fill_value\n elif isinstance(obj, types.StringType):\n return default_character_fill_value\n elif isinstance(obj, types.ComplexType):\n return default_complex_fill_value\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return default_real_fill_value\n if x in typecodes['Integer']:\n return default_integer_fill_value\n if x in typecodes['Complex']:\n return default_complex_fill_value\n if x in typecodes['Character']:\n return default_character_fill_value\n if x in typecodes['UnsignedInteger']:\n return umath.absolute(default_integer_fill_value)\n return default_object_fill_value\n else:\n return default_object_fill_value\n\ndef minimum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking minima.\"\n if isinstance(obj, types.FloatType):\n return numeric.inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return numeric.inf\n if x in typecodes['Integer']:\n return sys.maxint\n if x in typecodes['UnsignedInteger']:\n return sys.maxint\n else:\n raise TypeError, 'Unsuitable type for calculating minimum.'\n\ndef maximum_fill_value (obj):\n \"Function to calculate default fill value suitable for taking maxima.\"\n if isinstance(obj, types.FloatType):\n return -inf\n elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType):\n return -sys.maxint\n elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray):\n x = obj.dtypechar\n if x in typecodes['Float']:\n return -inf\n if x in typecodes['Integer']:\n return -sys.maxint\n if x in typecodes['UnsignedInteger']:\n return 0\n else:\n raise TypeError, 'Unsuitable type for calculating maximum.'\n\ndef set_fill_value (a, fill_value):\n \"Set fill value of a if it is a masked array.\"\n if isMaskedArray(a):\n a.set_fill_value (fill_value)\n\ndef getmask (a):\n \"\"\"Mask of values in a; could be None.\n Returns None if a is not a masked array.\n To get an array for sure use getmaskarray.\"\"\"\n if isinstance(a, MaskedArray):\n return a.raw_mask()\n else:\n return None\n\ndef getmaskarray (a):\n \"\"\"Mask of values in a; an array of zeros if mask is None\n or not a masked array, and is a byte-sized integer.\n Do not try to add up entries, for example.\n \"\"\"\n m = getmask(a)\n if m is None:\n return make_mask_none(shape(a))\n else:\n return m\n\ndef is_mask (m):\n \"\"\"Is m a legal mask? Does not check contents, only type.\n \"\"\"\n if m is None or (isinstance(m, ndarray) and \\\n m.dtype is MaskType):\n return 1\n else:\n return 0\n\ndef make_mask (m, copy=0, flag=0):\n \"\"\"make_mask(m, copy=0, flag=0)\n return m as a mask, creating a copy if necessary or requested.\n Can accept any sequence of integers or None. Does not check\n that contents must be 0s and 1s.\n if flag, return None if m contains no true elements.\n \"\"\"\n if m is None:\n return None\n elif isinstance(m, ndarray):\n if m.dtype is MaskType:\n if copy:\n result = numeric.array(m, dtype=MaskType, copy=copy)\n else:\n result = m\n else:\n result = m.astype(MaskType)\n else:\n result = filled(m,True).astype(MaskType)\n\n if flag and not oldnumeric.sometrue(oldnumeric.ravel(result)):\n return None\n else:\n return result\n\ndef make_mask_none (s):\n \"Return a mask of all zeros of shape s.\"\n result = numeric.zeros(s, dtype=MaskType)\n result.shape = s\n return result\n\ndef mask_or (m1, m2):\n \"\"\"Logical or of the mask candidates m1 and m2, treating None as false.\n Result may equal m1 or m2 if the other is None.\n \"\"\"\n if m1 is None: return make_mask(m2)\n if m2 is None: return make_mask(m1)\n if m1 is m2 and is_mask(m1): return m1\n return make_mask(umath.logical_or(m1, m2))\n\ndef filled (a, value = None):\n \"\"\"a as a contiguous numeric array with any masked areas replaced by value\n if value is None or the special element \"masked\", get_fill_value(a)\n is used instead.\n\n If a is already a contiguous numeric array, a itself is returned.\n\n filled(a) can be used to be sure that the result is numeric when\n passing an object a to other software ignorant of MA, in particular to\n numeric itself.\n \"\"\"\n if isinstance(a, MaskedArray):\n return a.filled(value)\n elif isinstance(a, ndarray) and a.flags['CONTIGUOUS']:\n return a\n elif isinstance(a, types.DictType):\n return numeric.array(a, 'O')\n else:\n return numeric.array(a)\n\ndef get_fill_value (a):\n \"\"\"\n The fill value of a, if it has one; otherwise, the default fill value\n for that type.\n \"\"\"\n if isMaskedArray(a):\n result = a.fill_value()\n else:\n result = default_fill_value(a)\n return result\n\ndef common_fill_value (a, b):\n \"The common fill_value of a and b, if there is one, or None\"\n t1 = get_fill_value(a)\n t2 = get_fill_value(b)\n if t1 == t2: return t1\n return None\n\n# Domain functions return 1 where the argument(s) are not in the domain.\nclass domain_check_interval:\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n def __init__(self, y1, y2):\n \"domain_check_interval(a,b)(x) = true where x < a or y > b\"\n self.y1 = y1\n self.y2 = y2\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.logical_or(umath.greater (x, self.y2),\n umath.less(x, self.y1)\n )\n\nclass domain_tan:\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n def __init__(self, eps):\n \"domain_tan(eps) = true where abs(cos(x)) < eps)\"\n self.eps = eps\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less(umath.absolute(umath.cos(x)), self.eps)\n\nclass domain_greater:\n \"domain_greater(v)(x) = true where x <= v\"\n def __init__(self, critical_value):\n \"domain_greater(v)(x) = true where x <= v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less_equal (x, self.critical_value)\n\nclass domain_greater_equal:\n \"domain_greater_equal(v)(x) = true where x < v\"\n def __init__(self, critical_value):\n \"domain_greater_equal(v)(x) = true where x < v\"\n self.critical_value = critical_value\n\n def __call__ (self, x):\n \"Execute the call behavior.\"\n return umath.less (x, self.critical_value)\n\nclass masked_unary_operation:\n def __init__ (self, aufunc, fill=0, domain=None):\n \"\"\" masked_unary_operation(aufunc, fill=0, domain=None)\n aufunc(fill) must be defined\n self(x) returns aufunc(x)\n with masked values where domain(x) is true or getmask(x) is true.\n \"\"\"\n self.f = aufunc\n self.fill = fill\n self.domain = domain\n self.__doc__ = getattr(aufunc, \"__doc__\", str(aufunc))\n\n def __call__ (self, a, *args, **kwargs):\n \"Execute the call behavior.\"\n# numeric tries to return scalars rather than arrays when given scalars.\n m = getmask(a)\n d1 = filled(a, self.fill)\n if self.domain is not None:\n m = mask_or(m, self.domain(d1))\n result = self.f(d1, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\n\nclass domain_safe_divide:\n def __init__ (self, tolerance=divide_tolerance):\n self.tolerance = tolerance\n def __call__ (self, a, b):\n return umath.absolute(a) * self.tolerance >= umath.absolute(b)\n\nclass domained_binary_operation:\n \"\"\"Binary operations that have a domain, like divide. These are complicated so they\n are a separate class. They have no reduce, outer or accumulate.\n \"\"\"\n def __init__ (self, abfunc, domain, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.domain = domain\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__(self, a, b):\n \"Execute the call behavior.\"\n ma = getmask(a)\n mb = getmask(b)\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n t = self.domain(d1, d2)\n\n if oldnumeric.sometrue(t, None):\n d2 = where(t, self.filly, d2)\n mb = mask_or(mb, t)\n m = mask_or(ma, mb)\n result = self.f(d1, d2)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n \n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nclass masked_binary_operation:\n def __init__ (self, abfunc, fillx=0, filly=0):\n \"\"\"abfunc(fillx, filly) must be defined.\n abfunc(x, filly) = x for all x to enable reduce.\n \"\"\"\n self.f = abfunc\n self.fillx = fillx\n self.filly = filly\n self.__doc__ = getattr(abfunc, \"__doc__\", str(abfunc))\n\n def __call__ (self, a, b, *args, **kwargs):\n \"Execute the call behavior.\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a, self.fillx)\n d2 = filled(b, self.filly)\n result = self.f(d1, d2, *args, **kwargs)\n if m is not None:\n try:\n shape = result.shape\n except AttributeError:\n pass\n else:\n if m.shape != shape:\n m = mask_or(getmaskarray(a), getmaskarray(b))\n return masked_array(result, m)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis with this function.\"\"\"\n m = getmask(target)\n t = filled(target, self.filly)\n if t.shape == ():\n t = t.reshape(1)\n if m is not None:\n m = make_mask(m, copy=1)\n m.shape = (1,)\n if m is None:\n return masked_array (self.f.reduce (t, axis))\n else:\n t = masked_array (t, m)\n t = self.f.reduce(filled(t, self.filly), axis)\n m = umath.logical_and.reduce(m, axis)\n if isinstance(t, ndarray):\n return masked_array(t, m, get_fill_value(target))\n elif m:\n return masked\n else:\n return t\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = self.f.outer(filled(a, self.fillx), filled(b, self.filly))\n return masked_array(d, m)\n\n def accumulate (self, target, axis=0):\n \"\"\"Accumulate target along axis after filling with y fill value.\"\"\"\n t = filled(target, self.filly)\n return masked_array (self.f.accumulate (t, axis))\n def __str__ (self):\n return \"Masked version of \" + str(self.f)\n\nsqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0))\nlog = masked_unary_operation(umath.log, 1.0, domain_greater(0.0))\nlog10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0))\nexp = masked_unary_operation(umath.exp)\nconjugate = masked_unary_operation(umath.conjugate)\nsin = masked_unary_operation(umath.sin)\ncos = masked_unary_operation(umath.cos)\ntan = masked_unary_operation(umath.tan, 0.0, domain_tan(1.e-35))\narcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-1.0, 1.0))\narccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-1.0, 1.0))\narctan = masked_unary_operation(umath.arctan)\n# Missing from numeric\narcsinh = masked_unary_operation(umath.arcsinh)\narccosh = masked_unary_operation(umath.arccosh)\narctanh = masked_unary_operation(umath.arctanh)\nsinh = masked_unary_operation(umath.sinh)\ncosh = masked_unary_operation(umath.cosh)\ntanh = masked_unary_operation(umath.tanh)\nabsolute = masked_unary_operation(umath.absolute)\nfabs = masked_unary_operation(umath.fabs)\nnegative = masked_unary_operation(umath.negative)\nnonzero = masked_unary_operation(oldnumeric.nonzero)\naround = masked_unary_operation(oldnumeric.round_)\nfloor = masked_unary_operation(umath.floor)\nceil = masked_unary_operation(umath.ceil)\nsometrue = masked_unary_operation(oldnumeric.sometrue)\nalltrue = masked_unary_operation(oldnumeric.alltrue, 1)\nlogical_not = masked_unary_operation(umath.logical_not)\n\nadd = masked_binary_operation(umath.add)\nsubtract = masked_binary_operation(umath.subtract)\nsubtract.reduce = None\nmultiply = masked_binary_operation(umath.multiply, 1, 1)\ndivide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1)\ntrue_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1)\nfloor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1)\nremainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1)\nfmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1)\nhypot = masked_binary_operation(umath.hypot)\narctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0)\narctan2.reduce = None\nequal = masked_binary_operation(umath.equal)\nequal.reduce = None\nnot_equal = masked_binary_operation(umath.not_equal)\nnot_equal.reduce = None\nless_equal = masked_binary_operation(umath.less_equal)\nless_equal.reduce = None\ngreater_equal = masked_binary_operation(umath.greater_equal)\ngreater_equal.reduce = None\nless = masked_binary_operation(umath.less)\nless.reduce = None\ngreater = masked_binary_operation(umath.greater)\ngreater.reduce = None\nlogical_and = masked_binary_operation(umath.logical_and)\nlogical_or = masked_binary_operation(umath.logical_or)\nlogical_xor = masked_binary_operation(umath.logical_xor)\nbitwise_and = masked_binary_operation(umath.bitwise_and)\nbitwise_or = masked_binary_operation(umath.bitwise_or)\nbitwise_xor = masked_binary_operation(umath.bitwise_xor)\n\ndef rank (object):\n return oldnumeric.rank(filled(object))\n\ndef shape (object):\n return oldnumeric.shape(filled(object))\n\ndef size (object, axis=None):\n return oldnumeric.size(filled(object), axis)\n\nclass MaskedArray (object):\n \"\"\"Arrays with possibly masked values.\n Masked values of 1 exclude the corresponding element from \n any computation.\n\n Construction:\n x = array(data, dtype=None, copy=True, fortran=False,\n mask = None, fill_value=None)\n\n If copy=False, every effort is made not to copy the data:\n If data is a MaskedArray, and argument mask=None,\n then the candidate data is data.data and the\n mask used is data.mask. If data is a numeric array,\n it is used as the candidate raw data.\n If dtypechar is not None and\n is != data.dtypechar then a data copy is required.\n Otherwise, the candidate is used.\n\n If a data copy is required, raw data stored is the result of:\n numeric.array(data, dtype=dtypechar, copy=copy)\n\n If mask is None there are no masked values. Otherwise mask must\n be convertible to an array of booleans with the same shape as x.\n\n fill_value is used to fill in masked values when necessary,\n such as when printing and in method/function filled().\n The fill_value is not used for computation within this module.\n \"\"\"\n def __init__(self, data, dtype=None, copy=True, fortran=False, \n mask=None, fill_value=None):\n \"\"\"array(data, dtype=None, copy=True, fortran=False, mask=None, fill_value=None)\n If data already a numeric array, its dtype becomes the default value of dtype.\n \"\"\"\n tc = dtype\n need_data_copied = copy\n if isinstance(data, MaskedArray):\n c = data.data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n if mask is None:\n mask = data.mask\n elif mask is not None: #attempting to change the mask\n need_data_copied = True\n\n elif isinstance(data, ndarray):\n c = data\n ctc = c.dtypechar\n if tc is None:\n tc = ctc\n elif dtype2char(tc) != ctc:\n need_data_copied = True\n else:\n need_data_copied = False #because I'll do it now\n c = numeric.array(data, dtype=tc, copy=True, fortran=fortran)\n\n if need_data_copied:\n if tc == ctc:\n self._data = numeric.array(c, dtype=tc, copy=True, fortran=fortran)\n else:\n self._data = c.astype(tc)\n else:\n self._data = c\n\n if mask is None:\n self._mask = None\n self._shared_mask = 0\n else:\n self._mask = make_mask (mask)\n if self._mask is None:\n self._shared_mask = 0\n else:\n self._shared_mask = (self._mask is mask)\n nm = size(self._mask)\n nd = size(self._data)\n if nm != nd:\n if nm == 1:\n self._mask = oldnumeric.resize(self._mask, self._data.shape)\n self._shared_mask = 0\n elif nd == 1:\n self._data = oldnumeric.resize(self._data, self._mask.shape)\n self._data.shape = self._mask.shape\n else:\n raise MAError, \"Mask and data not compatible.\"\n elif nm == 1 and shape(self._mask) != shape(self._data):\n self.unshare_mask()\n self._mask.shape = self._data.shape\n\n self.set_fill_value(fill_value)\n\n def __array__ (self, t = None):\n \"Special hook for numeric. Converts to numeric if possible.\"\n if self._mask is not None:\n if oldnumeric.ravel(self._mask).any():\n raise MAError, \\\n \"\"\"Cannot automatically convert masked array to numeric because data\n is masked in one or more locations.\n \"\"\"\n else: # Mask is all false\n # Optimize to avoid future invocations of this section.\n self._mask = None\n self._shared_mask = 0\n if t:\n return self._data.astype(t)\n else:\n return self._data\n\n def _get_shape(self):\n \"Return the current shape.\"\n return self._data.shape\n\n def _set_shape (self, newshape):\n \"Set the array's shape.\"\n self._data.shape = newshape\n if self._mask is not None:\n self._mask = self._mask.copy()\n self._mask.shape = newshape\n\n def _get_flat(self):\n \"\"\"Calculate the flat value.\n \"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel(), mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.ravel(),\n mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_flat (self, value):\n \"x.flat = value\"\n y = self.ravel()\n y[:] = value\n\n def _get_real(self):\n \"Get the real part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.real, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.real, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_real (self, value):\n \"x.real = value\"\n y = self.real\n y[...] = value\n\n def _get_imaginary(self):\n \"Get the imaginary part of a complex array.\"\n if self._mask is None:\n return masked_array(self._data.imag, mask=None,\n fill_value = self.fill_value())\n else:\n return masked_array(self._data.imag, mask=self._mask.ravel(),\n fill_value = self.fill_value())\n\n def _set_imaginary (self, value):\n \"x.imaginary = value\"\n y = self.imaginary\n y[...] = value\n\n def __str__(self):\n \"\"\"Calculate the str representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n if masked_print_option.enabled():\n f = masked_print_option\n else:\n f = self.fill_value()\n res = self.filled(f)\n return str(res)\n\n def __repr__(self):\n \"\"\"Calculate the repr representation, using masked for fill if\n it is enabled. Otherwise fill with fill value.\n \"\"\"\n with_mask = \"\"\"\\\narray(data =\n %(data)s,\n mask =\n %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n with_mask1 = \"\"\"\\\narray(data = %(data)s,\n mask = %(mask)s,\n fill_value=%(fill)s)\n\"\"\"\n without_mask = \"\"\"array(\n %(data)s)\"\"\"\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n\n n = len(self.shape)\n if self._mask is None:\n if n <=1:\n return without_mask1 % {'data':str(self.filled())}\n return without_mask % {'data':str(self.filled())}\n else:\n if n <=1:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n without_mask1 = \"\"\"array(%(data)s)\"\"\"\n if self._mask is None:\n return without_mask % {'data':str(self.filled())}\n else:\n return with_mask % {\n 'data': str(self.filled()),\n 'mask': str(self._mask),\n 'fill': str(self.fill_value())\n }\n\n def __float__(self):\n \"Convert self to float.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python float.'\n return float(self.data.item())\n\n def __int__(self):\n \"Convert self to int.\"\n self.unmask()\n if self._mask is not None:\n raise MAError, 'Cannot convert masked element to a Python int.'\n return int(self.data.item())\n\n def __getitem__(self, i):\n \"Get item described by i. Not a copy as in previous versions.\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i]\n if m is None:\n return dout\n mi = m[i]\n if mi.size == 1:\n if mi: \n return masked\n else:\n return dout\n else:\n return masked_array(dout, mi, fill_value=self._fill_value)\n\n def __getslice__(self, i, j):\n \"Get slice described by i, j\"\n self.unshare_mask()\n m = self._mask\n dout = self._data[i:j]\n if m is None:\n return masked_array(dout, fill_value=self._fill_value)\n else:\n return masked_array(dout, mask = m[i:j], fill_value=self._fill_value)\n\n# --------\n# setitem and setslice notes\n# note that if value is masked, it means to mask those locations.\n# setting a value changes the mask to match the value in those locations.\n\n def __setitem__(self, index, value):\n \"Set item described by index. If value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, 'Cannot alter the masked element.'\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n else:\n self.unshare_mask()\n self._mask[index] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[index] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[index] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = True\n else:\n self.unshare_mask()\n self._mask[index] = m\n\n def __setslice__(self, i, j, value):\n \"Set slice i:j; if value is masked, mask those locations.\"\n d = self._data\n if self is masked:\n raise MAError, \"Cannot alter the 'masked' object.\"\n if value is masked:\n if self._mask is None:\n self._mask = make_mask_none(d.shape)\n self._shared_mask = False\n self._mask[i:j] = True\n return\n m = getmask(value)\n value = filled(value).astype(d.dtype)\n d[i:j] = value\n if m is None:\n if self._mask is not None:\n self.unshare_mask()\n self._mask[i:j] = False\n else:\n if self._mask is None:\n self._mask = make_mask_none(self._data.shape)\n self._shared_mask = False\n self._mask[i:j] = m\n\n def __nonzero__(self):\n \"\"\"returns true if any element is non-zero or masked\n\n \"\"\"\n # XXX: This changes bool conversion logic from MA.\n # XXX: In MA bool(a) == len(a) != 0, but in scipy\n # XXX: scalars do not have len \n m = self._mask\n d = self._data\n return bool(m is not None and m.any()\n or d is not None and d.any())\n \n def __len__ (self):\n \"\"\"Return length of first dimension. This is weird but Python's\n slicing behavior depends on it.\"\"\"\n return len(self._data)\n\n def __and__(self, other):\n \"Return bitwise_and\"\n return bitwise_and(self, other)\n\n def __or__(self, other):\n \"Return bitwise_or\"\n return bitwise_or(self, other)\n\n def __xor__(self, other):\n \"Return bitwise_xor\"\n return bitwise_xor(self, other)\n\n __rand__ = __and__\n __ror__ = __or__\n __rxor__ = __xor__\n\n def __abs__(self):\n \"Return absolute(self)\"\n return absolute(self)\n\n def __neg__(self):\n \"Return negative(self)\"\n return negative(self)\n\n def __pos__(self):\n \"Return array(self)\"\n return array(self)\n\n def __add__(self, other):\n \"Return add(self, other)\"\n return add(self, other)\n\n __radd__ = __add__\n\n def __mod__ (self, other):\n \"Return remainder(self, other)\"\n return remainder(self, other)\n\n def __rmod__ (self, other):\n \"Return remainder(other, self)\"\n return remainder(other, self)\n\n def __lshift__ (self, n):\n return left_shift(self, n)\n\n def __rshift__ (self, n):\n return right_shift(self, n)\n\n def __sub__(self, other):\n \"Return subtract(self, other)\"\n return subtract(self, other)\n\n def __rsub__(self, other):\n \"Return subtract(other, self)\"\n return subtract(other, self)\n\n def __mul__(self, other):\n \"Return multiply(self, other)\"\n return multiply(self, other)\n\n __rmul__ = __mul__\n\n def __div__(self, other):\n \"Return divide(self, other)\"\n return divide(self, other)\n\n def __rdiv__(self, other):\n \"Return divide(other, self)\"\n return divide(other, self)\n\n def __truediv__(self, other):\n \"Return divide(self, other)\"\n return true_divide(self, other)\n\n def __rtruediv__(self, other):\n \"Return divide(other, self)\"\n return true_divide(other, self)\n\n def __floordiv__(self, other):\n \"Return divide(self, other)\"\n return floor_divide(self, other)\n\n def __rfloordiv__(self, other):\n \"Return divide(other, self)\"\n return floor_divide(other, self)\n\n def __pow__(self,other, third=None):\n \"Return power(self, other, third)\"\n return power(self, other, third)\n\n def __sqrt__(self):\n \"Return sqrt(self)\"\n return sqrt(self)\n\n def __iadd__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data += f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = add(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __imul__(self, other):\n \"Add other to self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data *= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = multiply(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n def __isub__(self, other):\n \"Subtract other from self in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n\n if self._mask is None:\n self._data -= f\n m = getmask(other)\n self._mask = m\n self._shared_mask = m is not None\n else:\n result = subtract(self, masked_array(f, mask=getmask(other)))\n self._data = result.data\n self._mask = result.mask\n self._shared_mask = 1\n return self\n\n\n\n def __idiv__(self, other):\n \"Divide self by other in place.\"\n t = self._data.dtypechar\n f = filled(other,0)\n t1 = f.dtypechar\n if t == t1:\n pass\n elif t in typecodes['Integer']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Float']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n elif t in typecodes['Complex']:\n if t1 in typecodes['Integer']:\n f = f.astype(t)\n elif t1 in typecodes['Float']:\n f = f.astype(t)\n elif t1 in typecodes['Complex']:\n f = f.astype(t)\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n else:\n raise TypeError, 'Incorrect type for in-place operation.'\n mo = getmask(other)\n result = divide(self, masked_array(f, mask=mo))\n self._data = result.data\n dm = result.raw_mask()\n if dm is not self._mask:\n self._mask = dm\n self._shared_mask = 1\n return self\n\n def __eq__(self,other):\n return equal(self,other)\n\n def __ne__(self,other):\n return not_equal(self,other)\n\n def __lt__(self,other):\n return less(self,other)\n\n def __le__(self,other):\n return less_equal(self,other)\n\n def __gt__(self,other):\n return greater(self,other)\n\n def __ge__(self,other):\n return greater_equal(self,other)\n\n def astype (self, tc):\n \"return self as array of given type.\"\n d = self._data.astype(tc)\n return array(d, mask=self._mask)\n\n def byte_swapped(self):\n \"\"\"Returns the raw data field, byte_swapped. Included for consistency\n with numeric but doesn't make sense in this context.\n \"\"\"\n return self._data.byte_swapped()\n\n def compressed (self):\n \"A 1-D array of all the non-masked data.\"\n d = oldnumeric.ravel(self._data)\n if self._mask is None:\n return array(d)\n else:\n m = 1 - oldnumeric.ravel(self._mask)\n c = oldnumeric.compress(m, d)\n return array(c, copy=0)\n\n def count (self, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n m = self._mask\n s = self._data.shape\n ls = len(s)\n if m is None:\n if ls == 0:\n return 1\n if ls == 1:\n return s[0]\n if axis is None:\n return reduce(lambda x,y:x*y, s)\n else:\n n = s[axis]\n t = list(s)\n del t[axis]\n return ones(t) * n\n if axis is None:\n w = oldnumeric.ravel(m).astype(int) \n n1 = size(w)\n if n1 == 1:\n n2 = w[0]\n else:\n n2 = umath.add.reduce(w)\n return n1 - n2\n else:\n n1 = size(m, axis)\n n2 = sum(m.astype(int), axis)\n return n1 - n2\n\n def dot (self, other):\n \"s.dot(other) = innerproduct(s, other)\"\n return innerproduct(self, other)\n\n def fill_value(self):\n \"Get the current fill value.\"\n return self._fill_value\n\n def filled (self, fill_value=None):\n \"\"\"A numeric array with masked values filled. If fill_value is None,\n use self.fill_value().\n\n If mask is None, copy data only if not contiguous.\n Result is always a contiguous, numeric array.\n# Is contiguous really necessary now?\n \"\"\"\n d = self._data\n m = self._mask\n if m is None:\n if d.flags['CONTIGUOUS']:\n return d\n else:\n return d.copy()\n else:\n if fill_value is None:\n value = self._fill_value\n else:\n value = fill_value\n\n if self is masked:\n result = numeric.array(value).reshape(*d.shape)\n else:\n try:\n result = numeric.array(d, dtype=d.dtype, copy=1)\n result[m] = value\n except:\n #ok, can't put that value in here\n value = numeric.array(value, dtype=object)\n d = d.astype(object)\n result = oldnumeric.choose(m, (d, value))\n return result\n\n def ids (self):\n \"\"\"Return the ids of the data and mask areas\"\"\"\n return (id(self._data), id(self._mask))\n\n def iscontiguous (self):\n \"Is the data contiguous?\"\n return self._data.flags['CONTIGUOUS']\n\n def itemsize(self):\n \"Item size of each data item.\"\n return self._data.itemsize\n\n\n def outer(self, other):\n \"s.outer(other) = outerproduct(s, other)\"\n return outerproduct(self, other)\n\n def put (self, values):\n \"\"\"Set the non-masked entries of self to filled(values).\n No change to mask\n \"\"\"\n iota = numeric.arange(self.size)\n d = self._data\n if self._mask is None:\n ind = iota\n else:\n ind = oldnumeric.compress(1 - self._mask, iota)\n d[ind] = filled(values).astype(d.dtype)\n\n def putmask (self, values):\n \"\"\"Set the masked entries of self to filled(values).\n Mask changed to None.\n \"\"\"\n d = self._data\n if self._mask is not None:\n d[self._mask] = filled(values).astype(d.dtype)\n self._shared_mask = 0\n self._mask = None\n\n def ravel (self):\n \"\"\"Return a 1-D view of self.\"\"\"\n if self._mask is None:\n return masked_array(self._data.ravel())\n else:\n return masked_array(self._data.ravel(), self._mask.ravel())\n\n def raw_data (self):\n \"\"\" Obsolete; use data property instead.\n The raw data; portions may be meaningless.\n May be noncontiguous. Expert use only.\"\"\"\n return self._data\n data = property(fget=raw_data, \n doc=\"The data, but values at masked locations are meaningless.\")\n\n def raw_mask (self):\n \"\"\" Obsolete; use mask property instead.\n May be noncontiguous. Expert use only.\n \"\"\"\n return self._mask\n mask = property(fget=raw_mask, \n doc=\"The mask, may be None. Values where mask true are meaningless.\")\n\n def reshape (self, *s):\n \"\"\"This array reshaped to shape s\"\"\"\n d = self._data.reshape(*s)\n if self._mask is None:\n return masked_array(d)\n else:\n m = self._mask.reshape(*s)\n return masked_array(d, m)\n\n def set_fill_value (self, v=None):\n \"Set the fill value to v. Omit v to restore default.\"\n if v is None:\n v = default_fill_value (self.raw_data())\n self._fill_value = v\n\n def _get_size (self):\n return self._data.size\n size = property(fget=_get_size, doc=\"Number of elements in the array.\")\n## CHECK THIS: signature of numeric.array.size?\n \n def _get_dtypechar(self):\n return self._data.dtypechar\n dtypechar = property(fget=_get_dtypechar, doc=\"type character of the array.\")\n\n def _get_dtype(self):\n return self._data.dtype\n dtype = property(fget=_get_dtype, doc=\"type of the array elements.\")\n\n def item(self):\n \"Return Python scalar if possible.\"\n if self._mask is not None:\n m = oldnumeric.ravel(self._mask)\n try:\n if m[0]:\n return masked\n except IndexError:\n return masked\n return self._data.item()\n\n def tolist(self, fill_value=None):\n \"Convert to list\"\n return self.filled(fill_value).tolist()\n\n def tostring(self, fill_value=None):\n \"Convert to string\"\n return self.filled(fill_value).tostring()\n\n def unmask (self):\n \"Replace the mask by None if possible.\"\n if self._mask is None: return\n m = make_mask(self._mask, flag=1)\n if m is None:\n self._mask = None\n self._shared_mask = 0\n\n def unshare_mask (self):\n \"If currently sharing mask, make a copy.\"\n if self._shared_mask:\n self._mask = make_mask (self._mask, copy=1, flag=0)\n self._shared_mask = 0\n\n shape = property(_get_shape, _set_shape,\n doc = 'tuple giving the shape of the array')\n\n flat = property(_get_flat, _set_flat,\n doc = 'Access array in flat form.')\n\n real = property(_get_real, _set_real,\n doc = 'Access the real part of the array')\n\n imaginary = property(_get_imaginary, _set_imaginary,\n doc = 'Access the imaginary part of the array')\n\n imag = imaginary\n\n#end class MaskedArray\n\narray = MaskedArray\n\ndef isMaskedArray (x):\n \"Is x a masked array, that is, an instance of MaskedArray?\"\n return isinstance(x, MaskedArray)\n\nisarray = isMaskedArray\nisMA = isMaskedArray #backward compatibility\n\ndef allclose (a, b, fill_value=1, rtol=1.e-5, atol=1.e-8):\n \"\"\" Returns true if all components of a and b are equal\n subject to given tolerances.\n If fill_value is 1, masked values considered equal.\n If fill_value is 0, masked values considered unequal.\n The relative error rtol should be positive and << 1.0\n The absolute error atol comes into play for those elements\n of b that are very small or zero; it says how small a must be also.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n d1 = filled(a)\n d2 = filled(b)\n x = filled(array(d1, copy=0, mask=m), fill_value).astype(float)\n y = filled(array(d2, copy=0, mask=m), 1).astype(float)\n d = umath.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y))\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n\ndef allequal (a, b, fill_value=1):\n \"\"\"\n True if all entries of a and b are equal, using\n fill_value as a truth value where either or both are masked.\n \"\"\"\n m = mask_or(getmask(a), getmask(b))\n if m is None:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n return oldnumeric.alltrue(oldnumeric.ravel(d))\n elif fill_value:\n x = filled(a)\n y = filled(b)\n d = umath.equal(x, y)\n dm = array(d, mask=m, copy=0)\n return oldnumeric.alltrue(oldnumeric.ravel(filled(dm, 1)))\n else:\n return 0\n\ndef masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1):\n \"\"\"\n masked_values(data, value, rtol=1.e-5, atol=1.e-8)\n Create a masked array; mask is None if possible.\n If copy==0, and otherwise possible, result\n may share data values with original array.\n Let d = filled(data, value). Returns d\n masked where abs(data-value)<= atol + rtol * abs(value)\n if d is of a floating point type. Otherwise returns\n masked_object(d, value, copy)\n \"\"\"\n abs = umath.absolute\n d = filled(data, value)\n if issubclass(d.dtype, numeric.floating):\n m = umath.less_equal(abs(d-value), atol+rtol*abs(value))\n m = make_mask(m, flag=1)\n return array(d, mask = m, copy=copy,\n fill_value=value)\n else:\n return masked_object(d, value, copy=copy)\n\ndef masked_object (data, value, copy=1):\n \"Create array masked where exactly data equal to value\"\n d = filled(data, value)\n dm = make_mask(umath.equal(d, value), flag=1)\n return array(d, mask=dm, copy=copy, fill_value=value)\n\ndef arrayrange(start, stop=None, step=1, dtype=None):\n \"\"\"Just like range() except it returns a array whose type can be specified\n by the keyword argument dtypechar.\n \"\"\"\n return array(numeric.arrayrange(start, stop, step, dtype))\n\narange = arrayrange\n\ndef fromstring (s, t):\n \"Construct a masked array from a string. Result will have no mask.\"\n return masked_array(numeric.fromstring(s, t))\n\ndef left_shift (a, n):\n \"Left shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.left_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.left_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef right_shift (a, n):\n \"Right shift n bits\"\n m = getmask(a)\n if m is None:\n d = umath.right_shift(filled(a), n)\n return masked_array(d)\n else:\n d = umath.right_shift(filled(a,0), n)\n return masked_array(d, m)\n\ndef resize (a, new_shape):\n \"\"\"resize(a, new_shape) returns a new array with the specified shape.\n The original array's total size can be any size.\"\"\"\n m = getmask(a)\n if m is not None:\n m = oldnumeric.resize(m, new_shape)\n result = array(oldnumeric.resize(filled(a), new_shape), mask=m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef repeat(a, repeats, axis=0):\n \"\"\"repeat elements of a repeats times along axis\n repeats is a sequence of length a.shape[axis]\n telling how many times to repeat each element.\n \"\"\"\n af = filled(a)\n if isinstance(repeats, types.IntType):\n repeats = tuple([repeats]*(shape(af)[axis]))\n\n m = getmask(a)\n if m is not None:\n m = oldnumeric.repeat(m, repeats, axis)\n d = oldnumeric.repeat(af, repeats, axis)\n result = masked_array(d, m)\n result.set_fill_value(get_fill_value(a))\n return result\n\ndef identity(n):\n \"\"\"identity(n) returns the identity matrix of shape n x n.\n \"\"\"\n return array(numeric.identity(n))\n\ndef indices (dimensions, dtype=None):\n \"\"\"indices(dimensions,dtype=None) returns an array representing a grid\n of indices with row-only, and column-only variation.\n \"\"\"\n return array(numeric.indices(dimensions, dtype))\n\ndef zeros (shape, dtype=int):\n \"\"\"zeros(n, dtype=int) =\n an array of all zeros of the given length or shape.\"\"\"\n return array(numeric.zeros(shape, dtype))\n\ndef ones (shape, dtype=int):\n \"\"\"ones(n, dtype=int) =\n an array of all ones of the given length or shape.\"\"\"\n return array(numeric.ones(shape, dtype))\n\n\ndef count (a, axis = None):\n \"Count of the non-masked elements in a, or along a certain axis.\"\n a = masked_array(a)\n return a.count(axis)\n\ndef power (a, b, third=None):\n \"a**b\"\n if third is not None:\n raise MAError, \"3-argument power not supported.\"\n ma = getmask(a)\n mb = getmask(b)\n m = mask_or(ma, mb)\n fa = filled(a, 1)\n fb = filled(b, 1)\n if fb.dtypechar in typecodes[\"Integer\"]:\n return masked_array(umath.power(fa, fb), m)\n md = make_mask(umath.less_equal (fa, 0), flag=1)\n m = mask_or(m, md)\n if m is None:\n return masked_array(umath.power(fa, fb))\n else:\n fa = numeric.where(m, 1, fa)\n return masked_array(umath.power(fa, fb), m)\n\ndef masked_array (a, mask=None, fill_value=None):\n \"\"\"masked_array(a, mask=None) =\n array(a, mask=mask, copy=0, fill_value=fill_value)\n \"\"\"\n return array(a, mask=mask, copy=0, fill_value=fill_value)\n\nsum = add.reduce\nproduct = multiply.reduce\n\ndef average (a, axis=0, weights=None, returned = 0):\n \"\"\"average(a, axis=0, weights=None)\n Computes average along indicated axis.\n If axis is None, average over the entire array\n Inputs can be integer or floating types; result is of type float.\n\n If weights are given, result is sum(a*weights)/(sum(weights)*1.0)\n weights must have a's shape or be the 1-d with length the size\n of a in the given axis.\n\n If returned, return a tuple: the result and the sum of the weights\n or count of values. Results will have the same shape.\n\n masked values in the weights will be set to 0.0\n \"\"\"\n a = masked_array(a)\n mask = a.mask\n ash = a.shape\n if ash == ():\n ash = (1,)\n if axis is None:\n if mask is None:\n if weights is None:\n n = add.reduce(a.raw_data().ravel())\n d = reduce(lambda x, y: x * y, ash, 1.0)\n else:\n w = filled(weights, 0.0).ravel()\n n = umath.add.reduce(a.raw_data().ravel() * w)\n d = umath.add.reduce(w)\n del w\n else:\n if weights is None:\n n = add.reduce(a.ravel())\n w = oldnumeric.choose(mask, (1.0,0.0)).ravel()\n d = umath.add.reduce(w)\n del w\n else:\n w = array(filled(weights, 0.0), float, mask=mask).ravel()\n n = add.reduce(a.ravel() * w)\n d = add.reduce(w)\n del w\n else:\n if mask is None:\n if weights is None:\n d = ash[axis] * 1.0\n n = umath.add.reduce(a.raw_data(), axis)\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = numeric.array(w, float, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * ones(ash, float)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n del w, r\n else:\n raise ValueError, 'average: weights wrong shape.'\n else:\n if weights is None:\n n = add.reduce(a, axis)\n w = numeric.choose(mask, (1.0, 0.0))\n d = umath.add.reduce(w, axis)\n del w\n else:\n w = filled(weights, 0.0)\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n w = array(w, float, mask=mask, copy=0)\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*len(ash)\n r[axis] = slice(None,None,1)\n w = eval (\"w[\"+ repr(tuple(r)) + \"] * masked_array(ones(ash, float), mask)\")\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis)\n else:\n raise ValueError, 'average: weights wrong shape.'\n del w\n #print n, d, repr(mask), repr(weights)\n if n is masked or d is masked: return masked\n result = divide (n, d)\n del n\n\n if isinstance(result, MaskedArray):\n result.unmask()\n if returned:\n if not isinstance(d, MaskedArray):\n d = masked_array(d)\n if not d.shape == result.shape:\n d = ones(result.shape, float) * d\n d.unmask()\n if returned:\n return result, d\n else:\n return result\n\ndef where (condition, x, y):\n \"\"\"where(condition, x, y) is x where condition is nonzero, y otherwise.\n condition must be convertible to an integer array.\n Answer is always the shape of condition.\n The type depends on x and y. It is integer if both x and y are\n the value masked.\n \"\"\"\n fc = filled(not_equal(condition,0), 0)\n if x is masked:\n xv = 0\n xm = 1\n else:\n xv = filled(x)\n xm = getmask(x)\n if xm is None: xm = 0\n if y is masked:\n yv = 0\n ym = 1\n else:\n yv = filled(y)\n ym = getmask(y)\n if ym is None: ym = 0\n d = numeric.choose(fc, (yv, xv))\n md = numeric.choose(fc, (ym, xm))\n m = getmask(condition)\n m = make_mask(mask_or(m, md), copy=0, flag=1)\n return masked_array(d, m)\n\ndef choose (indices, t):\n \"Returns array shaped like indices with elements chosen from t\"\n def fmask (x):\n if x is masked: return 1\n return filled(x)\n def nmask (x):\n if x is masked: return 1\n m = getmask(x)\n if m is None: return 0\n return m\n c = filled(indices,0)\n masks = [nmask(x) for x in t]\n a = [fmask(x) for x in t]\n d = numeric.choose(c, a)\n m = numeric.choose(c, masks)\n m = make_mask(mask_or(m, getmask(indices)), copy=0, flag=1)\n return masked_array(d, m)\n\ndef masked_where(condition, x, copy=1):\n \"\"\"Return x as an array masked where condition is true.\n Also masked where x or condition masked.\n \"\"\"\n cm = filled(condition,1)\n m = mask_or(getmask(x), cm)\n return array(filled(x), copy=copy, mask=m)\n\ndef masked_greater(x, value, copy=1):\n \"masked_greater(x, value) = x masked where x > value\"\n return masked_where(greater(x, value), x, copy)\n\ndef masked_greater_equal(x, value, copy=1):\n \"masked_greater_equal(x, value) = x masked where x >= value\"\n return masked_where(greater_equal(x, value), x, copy)\n\ndef masked_less(x, value, copy=1):\n \"masked_less(x, value) = x masked where x < value\"\n return masked_where(less(x, value), x, copy)\n\ndef masked_less_equal(x, value, copy=1):\n \"masked_less_equal(x, value) = x masked where x <= value\"\n return masked_where(less_equal(x, value), x, copy)\n\ndef masked_not_equal(x, value, copy=1):\n \"masked_not_equal(x, value) = x masked where x != value\"\n d = filled(x,0)\n c = umath.not_equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_equal(x, value, copy=1):\n \"\"\"masked_equal(x, value) = x masked where x == value\n For floating point consider masked_values(x, value) instead.\n \"\"\"\n d = filled(x,0)\n c = umath.equal(d, value)\n m = mask_or(c, getmask(x))\n return array(d, mask=m, copy=copy)\n\ndef masked_inside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are inside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d=filled(x, 0)\n c = umath.logical_and(umath.less_equal(d, v2), umath.greater_equal(d, v1))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef masked_outside(x, v1, v2, copy=1):\n \"\"\"x with mask of all values of x that are outside [v1,v2]\n v1 and v2 can be given in either order.\n \"\"\"\n if v2 < v1:\n t = v2\n v2 = v1\n v1 = t\n d = filled(x,0)\n c = umath.logical_or(umath.less(d, v1), umath.greater(d, v2))\n m = mask_or(c, getmask(x))\n return array(d, mask = m, copy=copy)\n\ndef reshape (a, *newshape):\n \"Copy of a with a new shape.\"\n m = getmask(a)\n d = filled(a).reshape(*newshape)\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.reshape(m, *newshape))\n\ndef ravel (a):\n \"a as one-dimensional, may share data and mask\"\n m = getmask(a)\n d = oldnumeric.ravel(filled(a))\n if m is None:\n return masked_array(d)\n else:\n return masked_array(d, mask=numeric.ravel(m))\n\ndef concatenate (arrays, axis=0):\n \"Concatenate the arrays along the given axis\"\n d = []\n for x in arrays:\n d.append(filled(x))\n d = numeric.concatenate(d, axis)\n for x in arrays:\n if getmask(x) is not None: break\n else:\n return masked_array(d)\n dm = []\n for x in arrays:\n dm.append(getmaskarray(x))\n dm = numeric.concatenate(dm, axis)\n return masked_array(d, mask=dm)\n\ndef take (a, indices, axis=0):\n \"take(a, indices, axis=0) returns selection of items from a.\"\n m = getmask(a)\n d = masked_array(a).raw_data()\n if m is None:\n return masked_array(numeric.take(d, indices, axis))\n else:\n return masked_array(numeric.take(d, indices, axis),\n mask = numeric.take(m, indices, axis))\n\ndef transpose(a, axes=None):\n \"transpose(a, axes=None) reorder dimensions per tuple axes\"\n m = getmask(a)\n d = filled(a)\n if m is None:\n return masked_array(numeric.transpose(d, axes))\n else:\n return masked_array(numeric.transpose(d, axes),\n mask = numeric.transpose(m, axes))\n\n\ndef put(a, indices, values):\n \"\"\"put(a, indices, values) sets storage-indexed locations to corresponding values.\n\n Values and indices are filled if necessary.\n\n \"\"\"\n d = a.raw_data()\n ind = filled(indices)\n v = filled(values)\n numeric.put (d, ind, v)\n m = getmask(a)\n if m is not None:\n a.unshare_mask()\n numeric.put(a.raw_mask(), ind, 0)\n\ndef putmask(a, mask, values):\n \"putmask(a, mask, values) sets a where mask is true.\"\n if mask is None:\n return\n numeric.putmask(a.raw_data(), mask, values)\n m = getmask(a)\n if m is None: return\n a.unshare_mask()\n numeric.putmask(a.raw_mask(), mask, 0)\n\ndef innerproduct(a,b):\n \"\"\"innerproduct(a,b) returns the dot product of two arrays, which has\n shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the\n product of the elements from the last dimensions of a and b.\n Masked elements are replace by zeros.\n \"\"\"\n fa = filled(a, 0)\n fb = filled(b, 0)\n if len(fa.shape) == 0: fa.shape = (1,)\n if len(fb.shape) == 0: fb.shape = (1,)\n return masked_array(numeric.innerproduct(fa, fb))\n\ndef outerproduct(a, b):\n \"\"\"outerproduct(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))\"\"\"\n fa = filled(a,0).ravel()\n fb = filled(b,0).ravel()\n d = numeric.outerproduct(fa, fb)\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n return masked_array(d)\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = make_mask(1-numeric.outerproduct(1-ma,1-mb), copy=0)\n return masked_array(d, m)\n\ndef dot(a, b):\n \"\"\"dot(a,b) returns matrix-multiplication between a and b. The product-sum\n is over the last dimension of a and the second-to-last dimension of b.\n Masked values are replaced by zeros. See also innerproduct.\n \"\"\"\n return innerproduct(filled(a,0), numeric.swapaxes(filled(b,0), -1, -2))\n\ndef compress(condition, x, dimension=-1):\n \"\"\"Select those parts of x for which condition is true.\n Masked values in condition are considered false.\n \"\"\"\n c = filled(condition, 0)\n m = getmask(x)\n if m is not None:\n m=numeric.compress(c, m, dimension)\n d = numeric.compress(c, filled(x), dimension)\n return masked_array(d, m)\n\nclass _minimum_operation:\n \"Object to calculate minima\"\n def __init__ (self):\n \"\"\"minimum(a, b) or minimum(a)\n In one argument case returns the scalar minimum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amin(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amin(ac.raw_data())\n else:\n return where(less(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.minimum.reduce (t, axis))\n else:\n t = umath.minimum.reduce(filled(target, minimum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.minimum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nminimum = _minimum_operation ()\n\nclass _maximum_operation:\n \"Object to calculate maxima\"\n def __init__ (self):\n \"\"\"maximum(a, b) or maximum(a)\n In one argument case returns the scalar maximum.\n \"\"\"\n pass\n\n def __call__ (self, a, b=None):\n \"Execute the call behavior.\"\n if b is None:\n m = getmask(a)\n if m is None:\n d = amax(filled(a).ravel())\n return d\n ac = a.compressed()\n if len(ac) == 0:\n return masked\n else:\n return amax(ac.raw_data())\n else:\n return where(greater(a, b), a, b)\n\n def reduce (self, target, axis=0):\n \"\"\"Reduce target along the given axis.\"\"\"\n m = getmask(target)\n if m is None:\n t = filled(target)\n return masked_array (umath.maximum.reduce (t, axis))\n else:\n t = umath.maximum.reduce(filled(target, maximum_fill_value(target)), axis)\n m = umath.logical_and.reduce(m, axis)\n return masked_array(t, m, get_fill_value(target))\n\n def outer (self, a, b):\n \"Return the function applied to the outer product of a and b.\"\n ma = getmask(a)\n mb = getmask(b)\n if ma is None and mb is None:\n m = None\n else:\n ma = getmaskarray(a)\n mb = getmaskarray(b)\n m = logical_or.outer(ma, mb)\n d = umath.maximum.outer(filled(a), filled(b))\n return masked_array(d, m)\n\nmaximum = _maximum_operation ()\n\ndef sort (x, axis = -1, fill_value=None):\n \"\"\"If x does not have a mask, return a masked array formed from the\n result of numeric.sort(x, axis).\n Otherwise, fill x with fill_value. Sort it.\n Set a mask where the result is equal to fill_value.\n Note that this may have unintended consequences if the data contains the\n fill value at a non-masked site.\n\n If fill_value is not given the default fill value for x's type will be\n used.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n d = filled(x, fill_value)\n s = oldnumeric.sort(d, axis)\n if getmask(x) is None:\n return masked_array(s)\n return masked_values(s, fill_value, copy=0)\n\ndef diagonal(a, k = 0, axis1=0, axis2=1):\n \"\"\"diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a\"\"\"\n d = oldnumeric.diagonal(filled(a), k, axis1, axis2)\n m = getmask(a)\n if m is None:\n return masked_array(d, m)\n else:\n return masked_array(d, oldnumeric.diagonal(m, k, axis1, axis2))\n\ndef argsort (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for sorting along given axis.\n if fill_value is None, use get_fill_value(x)\n Returns a numpy array.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argsort(d, axis)\n\ndef argmin (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return indices for minimum values along given axis.\n if fill_value is None, use get_fill_value(x).\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n d = filled(x, fill_value)\n return oldnumeric.argmin(d, axis)\n\ndef argmax (x, axis = -1, fill_value=None):\n \"\"\"Treating masked values as if they have the value fill_value,\n return sort indices for maximum along given axis.\n if fill_value is None, use -get_fill_value(x) if it exists.\n Returns a numpy array if x has more than one dimension.\n Otherwise, returns a scalar index.\n \"\"\"\n if fill_value is None:\n fill_value = default_fill_value (x)\n try:\n fill_value = - fill_value\n except:\n pass\n d = filled(x, fill_value)\n return oldnumeric.argmax(d, axis)\n\ndef fromfunction (f, s):\n \"\"\"apply f to s to create array as in umath.\"\"\"\n return masked_array(numeric.fromfunction(f,s))\n\ndef asarray(data, dtype=None):\n \"\"\"asarray(data, dtype) = array(data, dtype, copy=0)\n \"\"\"\n if isinstance(data, MaskedArray) and \\\n (dtype is None or dtype == data.dtype):\n return data\n return array(data, dtype=dtype, copy=0)\n\nmasked = MaskedArray([0], int, mask=[1])[0:0]\nmasked = masked[0:0]\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self , args = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "args" + ], + "start_line": 24, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , display )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "display" + ], + "start_line": 34, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "display", + "long_name": "display( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "set_display", + "long_name": "set_display( self , s )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "s" + ], + "start_line": 43, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enabled", + "long_name": "enabled( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enable", + "long_name": "enable( self , flag = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "flag" + ], + "start_line": 51, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "default_fill_value", + "long_name": "default_fill_value( obj )", + "filename": "ma.py", + "nloc": 25, + "complexity": 13, + "token_count": 144, + "parameters": [ + "obj" + ], + "start_line": 68, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "minimum_fill_value", + "long_name": "minimum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 105, + "parameters": [ + "obj" + ], + "start_line": 94, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "maximum_fill_value", + "long_name": "maximum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 103, + "parameters": [ + "obj" + ], + "start_line": 111, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( a , fill_value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 2, + "token_count": 20, + "parameters": [ + "a", + "fill_value" + ], + "start_line": 128, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getmask", + "long_name": "getmask( a )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 24, + "parameters": [ + "a" + ], + "start_line": 133, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "getmaskarray", + "long_name": "getmaskarray( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 142, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "is_mask", + "long_name": "is_mask( m )", + "filename": "ma.py", + "nloc": 6, + "complexity": 4, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 153, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "make_mask", + "long_name": "make_mask( m , copy = 0 , flag = 0 )", + "filename": "ma.py", + "nloc": 17, + "complexity": 7, + "token_count": 107, + "parameters": [ + "m", + "copy", + "flag" + ], + "start_line": 162, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "make_mask_none", + "long_name": "make_mask_none( s )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "s" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "mask_or", + "long_name": "mask_or( m1 , m2 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 5, + "token_count": 52, + "parameters": [ + "m1", + "m2" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "filled", + "long_name": "filled( a , value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 5, + "token_count": 70, + "parameters": [ + "a", + "value" + ], + "start_line": 202, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "get_fill_value", + "long_name": "get_fill_value( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 222, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "common_fill_value", + "long_name": "common_fill_value( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a", + "b" + ], + "start_line": 233, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , y1 , y2 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "y1", + "y2" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "x" + ], + "start_line": 248, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , eps )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "eps" + ], + "start_line": 256, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "x" + ], + "start_line": 260, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , aufunc , fill = 0 , domain = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "aufunc", + "fill", + "domain" + ], + "start_line": 285, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 16, + "complexity": 5, + "token_count": 112, + "parameters": [ + "self", + "a", + "args", + "kwargs" + ], + "start_line": 296, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 314, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , tolerance = divide_tolerance )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "tolerance" + ], + "start_line": 319, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 321, + "end_line": 322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , domain , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self", + "abfunc", + "domain", + "fillx", + "filly" + ], + "start_line": 328, + "end_line": 336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 147, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 338, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 361, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "abfunc", + "fillx", + "filly" + ], + "start_line": 365, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 113, + "parameters": [ + "self", + "a", + "b", + "args", + "kwargs" + ], + "start_line": 374, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 20, + "complexity": 6, + "token_count": 157, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 390, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 412, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "accumulate", + "long_name": "accumulate( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 425, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 430, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "rank", + "long_name": "rank( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 492, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "shape", + "long_name": "shape( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 495, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "size", + "long_name": "size( object , axis = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "object", + "axis" + ], + "start_line": 498, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , data , dtype = None , copy = True , fortran = False , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 56, + "complexity": 18, + "token_count": 379, + "parameters": [ + "self", + "data", + "dtype", + "copy", + "fortran", + "mask", + "fill_value" + ], + "start_line": 529, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 67, + "parameters": [ + "self", + "t" + ], + "start_line": 593, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "_get_shape", + "long_name": "_get_shape( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 610, + "end_line": 612, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_set_shape", + "long_name": "_set_shape( self , newshape )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "newshape" + ], + "start_line": 614, + "end_line": 619, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "_get_flat", + "long_name": "_get_flat( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 621, + "end_line": 630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "_set_flat", + "long_name": "_set_flat( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "value" + ], + "start_line": 632, + "end_line": 635, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_real", + "long_name": "_get_real( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 637, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_real", + "long_name": "_set_real( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 646, + "end_line": 649, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_imaginary", + "long_name": "_get_imaginary( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 651, + "end_line": 658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_imaginary", + "long_name": "_set_imaginary( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 660, + "end_line": 663, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 665, + "end_line": 674, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "ma.py", + "nloc": 42, + "complexity": 5, + "token_count": 207, + "parameters": [ + "self" + ], + "start_line": 676, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "__float__", + "long_name": "__float__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 723, + "end_line": 728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__int__", + "long_name": "__int__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 730, + "end_line": 735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , i )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 70, + "parameters": [ + "self", + "i" + ], + "start_line": 737, + "end_line": 751, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 68, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 753, + "end_line": 761, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , index , value )", + "filename": "ma.py", + "nloc": 27, + "complexity": 7, + "token_count": 157, + "parameters": [ + "self", + "index", + "value" + ], + "start_line": 768, + "end_line": 794, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__setslice__", + "long_name": "__setslice__( self , i , j , value )", + "filename": "ma.py", + "nloc": 23, + "complexity": 7, + "token_count": 155, + "parameters": [ + "self", + "i", + "j", + "value" + ], + "start_line": 796, + "end_line": 818, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "__nonzero__", + "long_name": "__nonzero__( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 820, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 832, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__and__", + "long_name": "__and__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 837, + "end_line": 839, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__or__", + "long_name": "__or__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 841, + "end_line": 843, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__xor__", + "long_name": "__xor__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 845, + "end_line": 847, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__abs__", + "long_name": "__abs__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 853, + "end_line": 855, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__neg__", + "long_name": "__neg__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 857, + "end_line": 859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pos__", + "long_name": "__pos__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 861, + "end_line": 863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 865, + "end_line": 867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mod__", + "long_name": "__mod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 871, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rmod__", + "long_name": "__rmod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__lshift__", + "long_name": "__lshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 879, + "end_line": 880, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__rshift__", + "long_name": "__rshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 882, + "end_line": 883, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 885, + "end_line": 887, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 889, + "end_line": 891, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 893, + "end_line": 895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 899, + "end_line": 901, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 903, + "end_line": 905, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__truediv__", + "long_name": "__truediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 907, + "end_line": 909, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rtruediv__", + "long_name": "__rtruediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 911, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__floordiv__", + "long_name": "__floordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 915, + "end_line": 917, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rfloordiv__", + "long_name": "__rfloordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 919, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other , third = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "other", + "third" + ], + "start_line": 923, + "end_line": 925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__sqrt__", + "long_name": "__sqrt__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 927, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__iadd__", + "long_name": "__iadd__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 931, + "end_line": 972, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 251, + "parameters": [ + "self", + "other" + ], + "start_line": 974, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__isub__", + "long_name": "__isub__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 1017, + "end_line": 1058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__idiv__", + "long_name": "__idiv__( self , other )", + "filename": "ma.py", + "nloc": 38, + "complexity": 12, + "token_count": 233, + "parameters": [ + "self", + "other" + ], + "start_line": 1062, + "end_line": 1099, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "__eq__", + "long_name": "__eq__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1101, + "end_line": 1102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ne__", + "long_name": "__ne__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1104, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__lt__", + "long_name": "__lt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1107, + "end_line": 1108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__le__", + "long_name": "__le__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1110, + "end_line": 1111, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__gt__", + "long_name": "__gt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1113, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ge__", + "long_name": "__ge__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1116, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "astype", + "long_name": "astype( self , tc )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "tc" + ], + "start_line": 1119, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "byte_swapped", + "long_name": "byte_swapped( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 1124, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "compressed", + "long_name": "compressed( self )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 1130, + "end_line": 1138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "count", + "long_name": "count( self , axis = None )", + "filename": "ma.py", + "nloc": 29, + "complexity": 7, + "token_count": 173, + "parameters": [ + "self", + "axis" + ], + "start_line": 1140, + "end_line": 1168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "dot", + "long_name": "dot( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1170, + "end_line": 1172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "fill_value", + "long_name": "fill_value( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1174, + "end_line": 1176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "filled", + "long_name": "filled( self , fill_value = None )", + "filename": "ma.py", + "nloc": 24, + "complexity": 6, + "token_count": 147, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1178, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "ids", + "long_name": "ids( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 1212, + "end_line": 1214, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "iscontiguous", + "long_name": "iscontiguous( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 1216, + "end_line": 1218, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "itemsize", + "long_name": "itemsize( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 1220, + "end_line": 1222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1225, + "end_line": 1227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "put", + "long_name": "put( self , values )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self", + "values" + ], + "start_line": 1229, + "end_line": 1239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "putmask", + "long_name": "putmask( self , values )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "values" + ], + "start_line": 1241, + "end_line": 1249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "ravel", + "long_name": "ravel( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 1251, + "end_line": 1256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "raw_data", + "long_name": "raw_data( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1258, + "end_line": 1262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "raw_mask", + "long_name": "raw_mask( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1266, + "end_line": 1270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "reshape", + "long_name": "reshape( self , * s )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self", + "s" + ], + "start_line": 1274, + "end_line": 1281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( self , v = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "v" + ], + "start_line": 1283, + "end_line": 1287, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "_get_size", + "long_name": "_get_size( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1289, + "end_line": 1290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtypechar", + "long_name": "_get_dtypechar( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1294, + "end_line": 1295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtype", + "long_name": "_get_dtype( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1298, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "item", + "long_name": "item( self )", + "filename": "ma.py", + "nloc": 10, + "complexity": 4, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 1302, + "end_line": 1311, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1313, + "end_line": 1315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "tostring", + "long_name": "tostring( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1317, + "end_line": 1319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unmask", + "long_name": "unmask( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 1321, + "end_line": 1327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "unshare_mask", + "long_name": "unshare_mask( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 1329, + "end_line": 1333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "isMaskedArray", + "long_name": "isMaskedArray( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "x" + ], + "start_line": 1353, + "end_line": 1355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "allclose", + "long_name": "allclose( a , b , fill_value = 1 , rtol = 1 . e - 5 , atol = 1 . e - 8 )", + "filename": "ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 140, + "parameters": [ + "a", + "b", + "fill_value", + "rtol", + "atol" + ], + "start_line": 1360, + "end_line": 1375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "allequal", + "long_name": "allequal( a , b , fill_value = 1 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 3, + "token_count": 125, + "parameters": [ + "a", + "b", + "fill_value" + ], + "start_line": 1377, + "end_line": 1395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "masked_values", + "long_name": "masked_values( data , value , rtol = 1 . e - 5 , atol = 1 . e - 8 , copy = 1 )", + "filename": "ma.py", + "nloc": 10, + "complexity": 2, + "token_count": 115, + "parameters": [ + "data", + "value", + "rtol", + "atol", + "copy" + ], + "start_line": 1397, + "end_line": 1416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "masked_object", + "long_name": "masked_object( data , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "data", + "value", + "copy" + ], + "start_line": 1418, + "end_line": 1422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arrayrange", + "long_name": "arrayrange( start , stop = None , step = 1 , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 1424, + "end_line": 1428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fromstring", + "long_name": "fromstring( s , t )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "s", + "t" + ], + "start_line": 1432, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "left_shift", + "long_name": "left_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1436, + "end_line": 1444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "right_shift", + "long_name": "right_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1446, + "end_line": 1454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "resize", + "long_name": "resize( a , new_shape )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "new_shape" + ], + "start_line": 1456, + "end_line": 1464, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "repeat", + "long_name": "repeat( a , repeats , axis = 0 )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 101, + "parameters": [ + "a", + "repeats", + "axis" + ], + "start_line": 1466, + "end_line": 1481, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "identity", + "long_name": "identity( n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "n" + ], + "start_line": 1483, + "end_line": 1486, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "indices", + "long_name": "indices( dimensions , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "dimensions", + "dtype" + ], + "start_line": 1488, + "end_line": 1492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "zeros", + "long_name": "zeros( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1494, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "ones", + "long_name": "ones( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1499, + "end_line": 1502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "count", + "long_name": "count( a , axis = None )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a", + "axis" + ], + "start_line": 1505, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( a , b , third = None )", + "filename": "ma.py", + "nloc": 18, + "complexity": 4, + "token_count": 152, + "parameters": [ + "a", + "b", + "third" + ], + "start_line": 1510, + "end_line": 1527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "masked_array", + "long_name": "masked_array( a , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "mask", + "fill_value" + ], + "start_line": 1529, + "end_line": 1533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = 0 )", + "filename": "ma.py", + "nloc": 92, + "complexity": 22, + "token_count": 741, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 1538, + "end_line": 1645, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "where", + "long_name": "where( condition , x , y )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 149, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 1647, + "end_line": 1673, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "choose.fmask", + "long_name": "choose.fmask( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "x" + ], + "start_line": 1677, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "choose.nmask", + "long_name": "choose.nmask( x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 3, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 1680, + "end_line": 1684, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "choose", + "long_name": "choose( indices , t )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 93, + "parameters": [ + "indices", + "t" + ], + "start_line": 1675, + "end_line": 1691, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "masked_where", + "long_name": "masked_where( condition , x , copy = 1 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 47, + "parameters": [ + "condition", + "x", + "copy" + ], + "start_line": 1693, + "end_line": 1699, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "masked_greater", + "long_name": "masked_greater( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1701, + "end_line": 1703, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_greater_equal", + "long_name": "masked_greater_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1705, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less", + "long_name": "masked_less( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1709, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less_equal", + "long_name": "masked_less_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1713, + "end_line": 1715, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_not_equal", + "long_name": "masked_not_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1717, + "end_line": 1722, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "masked_equal", + "long_name": "masked_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1724, + "end_line": 1731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "masked_inside", + "long_name": "masked_inside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1733, + "end_line": 1744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "masked_outside", + "long_name": "masked_outside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1746, + "end_line": 1757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "reshape", + "long_name": "reshape( a , * newshape )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "newshape" + ], + "start_line": 1759, + "end_line": 1766, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "ravel", + "long_name": "ravel( a )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a" + ], + "start_line": 1768, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "concatenate", + "long_name": "concatenate( arrays , axis = 0 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 5, + "token_count": 97, + "parameters": [ + "arrays", + "axis" + ], + "start_line": 1777, + "end_line": 1791, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "take", + "long_name": "take( a , indices , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "indices", + "axis" + ], + "start_line": 1793, + "end_line": 1801, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "transpose", + "long_name": "transpose( a , axes = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 64, + "parameters": [ + "a", + "axes" + ], + "start_line": 1803, + "end_line": 1811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "put", + "long_name": "put( a , indices , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 70, + "parameters": [ + "a", + "indices", + "values" + ], + "start_line": 1814, + "end_line": 1827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "putmask", + "long_name": "putmask( a , mask , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 61, + "parameters": [ + "a", + "mask", + "values" + ], + "start_line": 1829, + "end_line": 1837, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "innerproduct", + "long_name": "innerproduct( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 3, + "token_count": 72, + "parameters": [ + "a", + "b" + ], + "start_line": 1839, + "end_line": 1849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "outerproduct", + "long_name": "outerproduct( a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 110, + "parameters": [ + "a", + "b" + ], + "start_line": 1851, + "end_line": 1863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dot", + "long_name": "dot( a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 36, + "parameters": [ + "a", + "b" + ], + "start_line": 1865, + "end_line": 1870, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "compress", + "long_name": "compress( condition , x , dimension = - 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 67, + "parameters": [ + "condition", + "x", + "dimension" + ], + "start_line": 1872, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1885, + "end_line": 1889, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1891, + "end_line": 1904, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1906, + "end_line": 1915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1917, + "end_line": 1928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1934, + "end_line": 1938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1940, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1955, + "end_line": 1964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1966, + "end_line": 1977, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "sort", + "long_name": "sort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 8, + "complexity": 3, + "token_count": 68, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 1981, + "end_line": 1998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "diagonal", + "long_name": "diagonal( a , k = 0 , axis1 = 0 , axis2 = 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 73, + "parameters": [ + "a", + "k", + "axis1", + "axis2" + ], + "start_line": 2000, + "end_line": 2007, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argsort", + "long_name": "argsort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2009, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argmin", + "long_name": "argmin( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2018, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "argmax", + "long_name": "argmax( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2028, + "end_line": 2042, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "fromfunction", + "long_name": "fromfunction( f , s )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "f", + "s" + ], + "start_line": 2044, + "end_line": 2046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "asarray", + "long_name": "asarray( data , dtype = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 46, + "parameters": [ + "data", + "dtype" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self , args = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "args" + ], + "start_line": 24, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , display )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "display" + ], + "start_line": 34, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "display", + "long_name": "display( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "set_display", + "long_name": "set_display( self , s )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "s" + ], + "start_line": 43, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enabled", + "long_name": "enabled( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "enable", + "long_name": "enable( self , flag = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "flag" + ], + "start_line": 51, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "default_fill_value", + "long_name": "default_fill_value( obj )", + "filename": "ma.py", + "nloc": 25, + "complexity": 13, + "token_count": 144, + "parameters": [ + "obj" + ], + "start_line": 68, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "minimum_fill_value", + "long_name": "minimum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 105, + "parameters": [ + "obj" + ], + "start_line": 94, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "maximum_fill_value", + "long_name": "maximum_fill_value( obj )", + "filename": "ma.py", + "nloc": 16, + "complexity": 9, + "token_count": 103, + "parameters": [ + "obj" + ], + "start_line": 111, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( a , fill_value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 2, + "token_count": 20, + "parameters": [ + "a", + "fill_value" + ], + "start_line": 128, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "getmask", + "long_name": "getmask( a )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 24, + "parameters": [ + "a" + ], + "start_line": 133, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "getmaskarray", + "long_name": "getmaskarray( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 142, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "is_mask", + "long_name": "is_mask( m )", + "filename": "ma.py", + "nloc": 6, + "complexity": 4, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 153, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "make_mask", + "long_name": "make_mask( m , copy = 0 , flag = 0 )", + "filename": "ma.py", + "nloc": 17, + "complexity": 7, + "token_count": 107, + "parameters": [ + "m", + "copy", + "flag" + ], + "start_line": 162, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "make_mask_none", + "long_name": "make_mask_none( s )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "s" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "mask_or", + "long_name": "mask_or( m1 , m2 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 5, + "token_count": 52, + "parameters": [ + "m1", + "m2" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "filled", + "long_name": "filled( a , value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 5, + "token_count": 70, + "parameters": [ + "a", + "value" + ], + "start_line": 202, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "get_fill_value", + "long_name": "get_fill_value( a )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a" + ], + "start_line": 222, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "common_fill_value", + "long_name": "common_fill_value( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "a", + "b" + ], + "start_line": 233, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , y1 , y2 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "y1", + "y2" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "x" + ], + "start_line": 248, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , eps )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "eps" + ], + "start_line": 256, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "x" + ], + "start_line": 260, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , critical_value )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "critical_value" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "x" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , aufunc , fill = 0 , domain = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "aufunc", + "fill", + "domain" + ], + "start_line": 285, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 16, + "complexity": 5, + "token_count": 112, + "parameters": [ + "self", + "a", + "args", + "kwargs" + ], + "start_line": 296, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 314, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , tolerance = divide_tolerance )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "tolerance" + ], + "start_line": 319, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 321, + "end_line": 322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , domain , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self", + "abfunc", + "domain", + "fillx", + "filly" + ], + "start_line": 328, + "end_line": 336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 147, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 338, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 361, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , abfunc , fillx = 0 , filly = 0 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self", + "abfunc", + "fillx", + "filly" + ], + "start_line": 365, + "end_line": 372, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b , * args , ** kwargs )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 113, + "parameters": [ + "self", + "a", + "b", + "args", + "kwargs" + ], + "start_line": 374, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 20, + "complexity": 6, + "token_count": 157, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 390, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 412, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "accumulate", + "long_name": "accumulate( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 425, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 430, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "rank", + "long_name": "rank( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 492, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "shape", + "long_name": "shape( object )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "object" + ], + "start_line": 495, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "size", + "long_name": "size( object , axis = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "object", + "axis" + ], + "start_line": 498, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , data , dtype = None , copy = True , fortran = False , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 56, + "complexity": 18, + "token_count": 379, + "parameters": [ + "self", + "data", + "dtype", + "copy", + "fortran", + "mask", + "fill_value" + ], + "start_line": 529, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 67, + "parameters": [ + "self", + "t" + ], + "start_line": 593, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "_get_shape", + "long_name": "_get_shape( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 610, + "end_line": 612, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "_set_shape", + "long_name": "_set_shape( self , newshape )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "newshape" + ], + "start_line": 614, + "end_line": 619, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "_get_flat", + "long_name": "_get_flat( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self" + ], + "start_line": 621, + "end_line": 630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "_set_flat", + "long_name": "_set_flat( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "value" + ], + "start_line": 632, + "end_line": 635, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_real", + "long_name": "_get_real( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 637, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_real", + "long_name": "_set_real( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 646, + "end_line": 649, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "_get_imaginary", + "long_name": "_get_imaginary( self )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 651, + "end_line": 658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "_set_imaginary", + "long_name": "_set_imaginary( self , value )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "value" + ], + "start_line": 660, + "end_line": 663, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 665, + "end_line": 674, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "ma.py", + "nloc": 42, + "complexity": 5, + "token_count": 207, + "parameters": [ + "self" + ], + "start_line": 676, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "__float__", + "long_name": "__float__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 723, + "end_line": 728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__int__", + "long_name": "__int__( self )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 730, + "end_line": 735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , i )", + "filename": "ma.py", + "nloc": 15, + "complexity": 4, + "token_count": 70, + "parameters": [ + "self", + "i" + ], + "start_line": 737, + "end_line": 751, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 68, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 753, + "end_line": 761, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , index , value )", + "filename": "ma.py", + "nloc": 27, + "complexity": 7, + "token_count": 157, + "parameters": [ + "self", + "index", + "value" + ], + "start_line": 768, + "end_line": 794, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__setslice__", + "long_name": "__setslice__( self , i , j , value )", + "filename": "ma.py", + "nloc": 23, + "complexity": 7, + "token_count": 155, + "parameters": [ + "self", + "i", + "j", + "value" + ], + "start_line": 796, + "end_line": 818, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "__nonzero__", + "long_name": "__nonzero__( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 820, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self" + ], + "start_line": 832, + "end_line": 835, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__and__", + "long_name": "__and__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 837, + "end_line": 839, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__or__", + "long_name": "__or__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 841, + "end_line": 843, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__xor__", + "long_name": "__xor__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 845, + "end_line": 847, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__abs__", + "long_name": "__abs__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 853, + "end_line": 855, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__neg__", + "long_name": "__neg__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 857, + "end_line": 859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pos__", + "long_name": "__pos__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 861, + "end_line": 863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 865, + "end_line": 867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mod__", + "long_name": "__mod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 871, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rmod__", + "long_name": "__rmod__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__lshift__", + "long_name": "__lshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 879, + "end_line": 880, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__rshift__", + "long_name": "__rshift__( self , n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "n" + ], + "start_line": 882, + "end_line": 883, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 885, + "end_line": 887, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 889, + "end_line": 891, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 893, + "end_line": 895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 899, + "end_line": 901, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 903, + "end_line": 905, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__truediv__", + "long_name": "__truediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 907, + "end_line": 909, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rtruediv__", + "long_name": "__rtruediv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 911, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__floordiv__", + "long_name": "__floordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 915, + "end_line": 917, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rfloordiv__", + "long_name": "__rfloordiv__( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 919, + "end_line": 921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , other , third = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "other", + "third" + ], + "start_line": 923, + "end_line": 925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__sqrt__", + "long_name": "__sqrt__( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 927, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__iadd__", + "long_name": "__iadd__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 931, + "end_line": 972, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__imul__", + "long_name": "__imul__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 251, + "parameters": [ + "self", + "other" + ], + "start_line": 974, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__isub__", + "long_name": "__isub__( self , other )", + "filename": "ma.py", + "nloc": 41, + "complexity": 12, + "token_count": 250, + "parameters": [ + "self", + "other" + ], + "start_line": 1017, + "end_line": 1058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "__idiv__", + "long_name": "__idiv__( self , other )", + "filename": "ma.py", + "nloc": 38, + "complexity": 12, + "token_count": 233, + "parameters": [ + "self", + "other" + ], + "start_line": 1062, + "end_line": 1099, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "__eq__", + "long_name": "__eq__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1101, + "end_line": 1102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ne__", + "long_name": "__ne__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1104, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__lt__", + "long_name": "__lt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1107, + "end_line": 1108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__le__", + "long_name": "__le__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1110, + "end_line": 1111, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__gt__", + "long_name": "__gt__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1113, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__ge__", + "long_name": "__ge__( self , other )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "other" + ], + "start_line": 1116, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "astype", + "long_name": "astype( self , tc )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "tc" + ], + "start_line": 1119, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "byte_swapped", + "long_name": "byte_swapped( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 1124, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "compressed", + "long_name": "compressed( self )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 1130, + "end_line": 1138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "count", + "long_name": "count( self , axis = None )", + "filename": "ma.py", + "nloc": 29, + "complexity": 7, + "token_count": 173, + "parameters": [ + "self", + "axis" + ], + "start_line": 1140, + "end_line": 1168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 1 + }, + { + "name": "dot", + "long_name": "dot( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1170, + "end_line": 1172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "fill_value", + "long_name": "fill_value( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1174, + "end_line": 1176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "filled", + "long_name": "filled( self , fill_value = None )", + "filename": "ma.py", + "nloc": 24, + "complexity": 6, + "token_count": 147, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1178, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "ids", + "long_name": "ids( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 1212, + "end_line": 1214, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "iscontiguous", + "long_name": "iscontiguous( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self" + ], + "start_line": 1216, + "end_line": 1218, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "itemsize", + "long_name": "itemsize( self )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 1220, + "end_line": 1222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , other )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "other" + ], + "start_line": 1225, + "end_line": 1227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "put", + "long_name": "put( self , values )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self", + "values" + ], + "start_line": 1229, + "end_line": 1239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "putmask", + "long_name": "putmask( self , values )", + "filename": "ma.py", + "nloc": 6, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self", + "values" + ], + "start_line": 1241, + "end_line": 1249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "ravel", + "long_name": "ravel( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 1251, + "end_line": 1256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "raw_data", + "long_name": "raw_data( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1258, + "end_line": 1262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "raw_mask", + "long_name": "raw_mask( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 1266, + "end_line": 1270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "reshape", + "long_name": "reshape( self , * s )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self", + "s" + ], + "start_line": 1274, + "end_line": 1281, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "set_fill_value", + "long_name": "set_fill_value( self , v = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "v" + ], + "start_line": 1283, + "end_line": 1287, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "_get_size", + "long_name": "_get_size( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1289, + "end_line": 1290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtypechar", + "long_name": "_get_dtypechar( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1294, + "end_line": 1295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "_get_dtype", + "long_name": "_get_dtype( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 1298, + "end_line": 1299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "item", + "long_name": "item( self )", + "filename": "ma.py", + "nloc": 10, + "complexity": 4, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 1302, + "end_line": 1311, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "tolist", + "long_name": "tolist( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1313, + "end_line": 1315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "tostring", + "long_name": "tostring( self , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "fill_value" + ], + "start_line": 1317, + "end_line": 1319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unmask", + "long_name": "unmask( self )", + "filename": "ma.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 1321, + "end_line": 1327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "unshare_mask", + "long_name": "unshare_mask( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 1329, + "end_line": 1333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "isMaskedArray", + "long_name": "isMaskedArray( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [ + "x" + ], + "start_line": 1353, + "end_line": 1355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "allclose", + "long_name": "allclose( a , b , fill_value = 1 , rtol = 1 . e - 5 , atol = 1 . e - 8 )", + "filename": "ma.py", + "nloc": 8, + "complexity": 1, + "token_count": 140, + "parameters": [ + "a", + "b", + "fill_value", + "rtol", + "atol" + ], + "start_line": 1360, + "end_line": 1375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "allequal", + "long_name": "allequal( a , b , fill_value = 1 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 3, + "token_count": 125, + "parameters": [ + "a", + "b", + "fill_value" + ], + "start_line": 1377, + "end_line": 1395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "masked_values", + "long_name": "masked_values( data , value , rtol = 1 . e - 5 , atol = 1 . e - 8 , copy = 1 )", + "filename": "ma.py", + "nloc": 10, + "complexity": 2, + "token_count": 115, + "parameters": [ + "data", + "value", + "rtol", + "atol", + "copy" + ], + "start_line": 1397, + "end_line": 1416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "masked_object", + "long_name": "masked_object( data , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "data", + "value", + "copy" + ], + "start_line": 1418, + "end_line": 1422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arrayrange", + "long_name": "arrayrange( start , stop = None , step = 1 , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "start", + "stop", + "step", + "dtype" + ], + "start_line": 1424, + "end_line": 1428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "fromstring", + "long_name": "fromstring( s , t )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "s", + "t" + ], + "start_line": 1432, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "left_shift", + "long_name": "left_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1436, + "end_line": 1444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "right_shift", + "long_name": "right_shift( a , n )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n" + ], + "start_line": 1446, + "end_line": 1454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "resize", + "long_name": "resize( a , new_shape )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "new_shape" + ], + "start_line": 1456, + "end_line": 1464, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "repeat", + "long_name": "repeat( a , repeats , axis = 0 )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 101, + "parameters": [ + "a", + "repeats", + "axis" + ], + "start_line": 1466, + "end_line": 1481, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "identity", + "long_name": "identity( n )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "n" + ], + "start_line": 1483, + "end_line": 1486, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "indices", + "long_name": "indices( dimensions , dtype = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "dimensions", + "dtype" + ], + "start_line": 1488, + "end_line": 1492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "zeros", + "long_name": "zeros( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1494, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "ones", + "long_name": "ones( shape , dtype = int )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "shape", + "dtype" + ], + "start_line": 1499, + "end_line": 1502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "count", + "long_name": "count( a , axis = None )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a", + "axis" + ], + "start_line": 1505, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( a , b , third = None )", + "filename": "ma.py", + "nloc": 18, + "complexity": 4, + "token_count": 152, + "parameters": [ + "a", + "b", + "third" + ], + "start_line": 1510, + "end_line": 1527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "masked_array", + "long_name": "masked_array( a , mask = None , fill_value = None )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "mask", + "fill_value" + ], + "start_line": 1529, + "end_line": 1533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = 0 )", + "filename": "ma.py", + "nloc": 92, + "complexity": 22, + "token_count": 741, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 1538, + "end_line": 1645, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "where", + "long_name": "where( condition , x , y )", + "filename": "ma.py", + "nloc": 21, + "complexity": 5, + "token_count": 149, + "parameters": [ + "condition", + "x", + "y" + ], + "start_line": 1647, + "end_line": 1673, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "choose.fmask", + "long_name": "choose.fmask( x )", + "filename": "ma.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "x" + ], + "start_line": 1677, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "choose.nmask", + "long_name": "choose.nmask( x )", + "filename": "ma.py", + "nloc": 5, + "complexity": 3, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 1680, + "end_line": 1684, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "choose", + "long_name": "choose( indices , t )", + "filename": "ma.py", + "nloc": 11, + "complexity": 3, + "token_count": 93, + "parameters": [ + "indices", + "t" + ], + "start_line": 1675, + "end_line": 1691, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "masked_where", + "long_name": "masked_where( condition , x , copy = 1 )", + "filename": "ma.py", + "nloc": 4, + "complexity": 1, + "token_count": 47, + "parameters": [ + "condition", + "x", + "copy" + ], + "start_line": 1693, + "end_line": 1699, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "masked_greater", + "long_name": "masked_greater( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1701, + "end_line": 1703, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_greater_equal", + "long_name": "masked_greater_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1705, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less", + "long_name": "masked_less( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1709, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_less_equal", + "long_name": "masked_less_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1713, + "end_line": 1715, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "masked_not_equal", + "long_name": "masked_not_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 6, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1717, + "end_line": 1722, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "masked_equal", + "long_name": "masked_equal( x , value , copy = 1 )", + "filename": "ma.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "x", + "value", + "copy" + ], + "start_line": 1724, + "end_line": 1731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "masked_inside", + "long_name": "masked_inside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1733, + "end_line": 1744, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "masked_outside", + "long_name": "masked_outside( x , v1 , v2 , copy = 1 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 84, + "parameters": [ + "x", + "v1", + "v2", + "copy" + ], + "start_line": 1746, + "end_line": 1757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "reshape", + "long_name": "reshape( a , * newshape )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 56, + "parameters": [ + "a", + "newshape" + ], + "start_line": 1759, + "end_line": 1766, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "ravel", + "long_name": "ravel( a )", + "filename": "ma.py", + "nloc": 8, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a" + ], + "start_line": 1768, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "concatenate", + "long_name": "concatenate( arrays , axis = 0 )", + "filename": "ma.py", + "nloc": 15, + "complexity": 5, + "token_count": 97, + "parameters": [ + "arrays", + "axis" + ], + "start_line": 1777, + "end_line": 1791, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "take", + "long_name": "take( a , indices , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "indices", + "axis" + ], + "start_line": 1793, + "end_line": 1801, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "transpose", + "long_name": "transpose( a , axes = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 64, + "parameters": [ + "a", + "axes" + ], + "start_line": 1803, + "end_line": 1811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "put", + "long_name": "put( a , indices , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 70, + "parameters": [ + "a", + "indices", + "values" + ], + "start_line": 1814, + "end_line": 1827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "putmask", + "long_name": "putmask( a , mask , values )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 61, + "parameters": [ + "a", + "mask", + "values" + ], + "start_line": 1829, + "end_line": 1837, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "innerproduct", + "long_name": "innerproduct( a , b )", + "filename": "ma.py", + "nloc": 6, + "complexity": 3, + "token_count": 72, + "parameters": [ + "a", + "b" + ], + "start_line": 1839, + "end_line": 1849, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "outerproduct", + "long_name": "outerproduct( a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 110, + "parameters": [ + "a", + "b" + ], + "start_line": 1851, + "end_line": 1863, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "dot", + "long_name": "dot( a , b )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 36, + "parameters": [ + "a", + "b" + ], + "start_line": 1865, + "end_line": 1870, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "compress", + "long_name": "compress( condition , x , dimension = - 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 67, + "parameters": [ + "condition", + "x", + "dimension" + ], + "start_line": 1872, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1885, + "end_line": 1889, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1891, + "end_line": 1904, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1906, + "end_line": 1915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1917, + "end_line": 1928, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "self" + ], + "start_line": 1934, + "end_line": 1938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , a , b = None )", + "filename": "ma.py", + "nloc": 14, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1940, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "reduce", + "long_name": "reduce( self , target , axis = 0 )", + "filename": "ma.py", + "nloc": 9, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "target", + "axis" + ], + "start_line": 1955, + "end_line": 1964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "outer", + "long_name": "outer( self , a , b )", + "filename": "ma.py", + "nloc": 12, + "complexity": 3, + "token_count": 83, + "parameters": [ + "self", + "a", + "b" + ], + "start_line": 1966, + "end_line": 1977, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "sort", + "long_name": "sort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 8, + "complexity": 3, + "token_count": 68, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 1981, + "end_line": 1998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "diagonal", + "long_name": "diagonal( a , k = 0 , axis1 = 0 , axis2 = 1 )", + "filename": "ma.py", + "nloc": 7, + "complexity": 2, + "token_count": 73, + "parameters": [ + "a", + "k", + "axis1", + "axis2" + ], + "start_line": 2000, + "end_line": 2007, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argsort", + "long_name": "argsort( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2009, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "argmin", + "long_name": "argmin( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 3, + "complexity": 1, + "token_count": 32, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2018, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "argmax", + "long_name": "argmax( x , axis = - 1 , fill_value = None )", + "filename": "ma.py", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "x", + "axis", + "fill_value" + ], + "start_line": 2028, + "end_line": 2042, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "fromfunction", + "long_name": "fromfunction( f , s )", + "filename": "ma.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "f", + "s" + ], + "start_line": 2044, + "end_line": 2046, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "asarray", + "long_name": "asarray( data , dtype = None )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 46, + "parameters": [ + "data", + "dtype" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "__nonzero__", + "long_name": "__nonzero__( self )", + "filename": "ma.py", + "nloc": 5, + "complexity": 4, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 820, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "nloc": 1602, + "complexity": 446, + "token_count": 11100, + "diff_parsed": { + "added": [ + " # XXX: In MA bool(a) == len(a) != 0, but in numpy" + ], + "deleted": [ + " # XXX: In MA bool(a) == len(a) != 0, but in scipy" + ] + } + }, + { + "old_path": "numpy/dft/fftpack.py", + "new_path": "numpy/dft/fftpack.py", + "filename": "fftpack.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -19,12 +19,12 @@\n real_fft2d(a, s=None, axes=(-2,-1)) \n inverse_real_fft2d(a, s=None, axes=(-2, -1))\n \"\"\"\n-__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft', 'inverse_real_fft',\n- 'irefft', 'hfft', 'ihfft', 'refftn', 'irefftn', 'refft2', 'irefft2',\n- 'fft2', 'ifft2',\n- 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd','fft2d',\n- 'inverse_fft2d', 'real_fftnd', 'real_fft2d', 'inverse_real_fftnd',\n- 'inverse_real_fft2d',]\n+__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft',\n+ 'inverse_real_fft', 'irefft', 'hfft', 'ihfft', 'refftn',\n+ 'irefftn', 'refft2', 'irefft2', 'fft2', 'ifft2',\n+ 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd',\n+ 'fft2d', 'inverse_fft2d', 'real_fftnd', 'real_fft2d',\n+ 'inverse_real_fftnd', 'inverse_real_fft2d','fftn','ifftn']\n \n from numpy.core import *\n import fftpack_lite as fftpack\n", + "added_lines": 6, + "deleted_lines": 6, + "source_code": "\"\"\"\nDiscrete Fourier Transforms - FFT.py \n\nThe underlying code for these functions is an f2c translated and modified\nversion of the FFTPACK routines.\n\nfft(a, n=None, axis=-1) \ninverse_fft(a, n=None, axis=-1) \nreal_fft(a, n=None, axis=-1) \ninverse_real_fft(a, n=None, axis=-1)\nhermite_fft(a, n=None, axis=-1)\ninverse_hermite_fft(a, n=None, axis=-1)\nfftnd(a, s=None, axes=None)\ninverse_fftnd(a, s=None, axes=None)\nreal_fftnd(a, s=None, axes=None)\ninverse_real_fftnd(a, s=None, axes=None)\nfft2d(a, s=None, axes=(-2,-1)) \ninverse_fft2d(a, s=None, axes=(-2, -1))\nreal_fft2d(a, s=None, axes=(-2,-1)) \ninverse_real_fft2d(a, s=None, axes=(-2, -1))\n\"\"\"\n__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft',\n 'inverse_real_fft', 'irefft', 'hfft', 'ihfft', 'refftn',\n 'irefftn', 'refft2', 'irefft2', 'fft2', 'ifft2',\n 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd',\n 'fft2d', 'inverse_fft2d', 'real_fftnd', 'real_fft2d',\n 'inverse_real_fftnd', 'inverse_real_fft2d','fftn','ifftn']\n\nfrom numpy.core import *\nimport fftpack_lite as fftpack\nfrom helper import *\n\n_fft_cache = {}\n_real_fft_cache = {}\n\ndef _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti, \n work_function=fftpack.cfftf, fft_cache = _fft_cache ):\n a = asarray(a)\n\n if n == None: n = a.shape[axis]\n\n try:\n wsave = fft_cache[n]\n except(KeyError):\n wsave = init_function(n)\n fft_cache[n] = wsave\n\n if a.shape[axis] != n:\n s = list(a.shape)\n if s[axis] > n:\n index = [slice(None)]*len(s)\n index[axis] = slice(0,n)\n a = a[index]\n else:\n index = [slice(None)]*len(s)\n index[axis] = slice(0,s[axis])\n s[axis] = n\n z = zeros(s, a.dtypechar)\n z[index] = a\n a = z\n\n if axis != -1:\n a = swapaxes(a, axis, -1)\n r = work_function(a, wsave)\n if axis != -1:\n r = swapaxes(r, axis, -1)\n return r\n\n\ndef fft(a, n=None, axis=-1):\n \"\"\"fft(a, n=None, axis=-1) \n\n Will return the n point discrete Fourier transform of a. n defaults to the\n length of a. If n is larger than a, then a will be zero-padded to make up\n the difference. If n is smaller than a, the first n items in a will be\n used.\n\n The packing of the result is \"standard\": If A = fft(a, n), then A[0]\n contains the zero-frequency term, A[1:n/2+1] contains the\n positive-frequency terms, and A[n/2+1:] contains the negative-frequency\n terms, in order of decreasingly negative frequency. So for an 8-point\n transform, the frequencies of the result are [ 0, 1, 2, 3, 4, -3, -2, -1].\n\n This is most efficient for n a power of two. This also stores a cache of\n working memory for different sizes of fft's, so you could theoretically\n run into memory problems if you call this too many times with too many\n different n's.\"\"\"\n\n return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftf, _fft_cache)\n\n\ndef inverse_fft(a, n=None, axis=-1):\n \"\"\"inverse_fft(a, n=None, axis=-1) \n\n Will return the n point inverse discrete Fourier transform of a. n\n defaults to the length of a. If n is larger than a, then a will be\n zero-padded to make up the difference. If n is smaller than a, then a will\n be truncated to reduce its size.\n\n The input array is expected to be packed the same way as the output of\n fft, as discussed in it's documentation.\n\n This is the inverse of fft: inverse_fft(fft(a)) == a within numerical\n accuracy.\n\n This is most efficient for n a power of two. This also stores a cache of\n working memory for different sizes of fft's, so you could theoretically\n run into memory problems if you call this too many times with too many\n different n's.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = shape(a)[axis]\n return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftb, _fft_cache) / n\n\n\ndef real_fft(a, n=None, axis=-1):\n \"\"\"real_fft(a, n=None, axis=-1) \n\n Will return the n point discrete Fourier transform of the real valued\n array a. n defaults to the length of a. n is the length of the input, not\n the output.\n\n The returned array will be the nonnegative frequency terms of the\n Hermite-symmetric, complex transform of the real array. So for an 8-point\n transform, the frequencies in the result are [ 0, 1, 2, 3, 4]. The first\n term will be real, as will the last if n is even. The negative frequency\n terms are not needed because they are the complex conjugates of the\n positive frequency terms. (This is what I mean when I say\n Hermite-symmetric.)\n\n This is most efficient for n a power of two.\"\"\"\n\n a = asarray(a).astype(Float)\n return _raw_fft(a, n, axis, fftpack.rffti, fftpack.rfftf, _real_fft_cache)\n\n\ndef inverse_real_fft(a, n=None, axis=-1):\n \"\"\"inverse_real_fft(a, n=None, axis=-1)\n \n Will return the real valued n point inverse discrete Fourier transform of\n a, where a contains the nonnegative frequency terms of a Hermite-symmetric\n sequence. n is the length of the result, not the input. If n is not\n supplied, the default is 2*(len(a)-1). If you want the length of the\n result to be odd, you have to say so.\n\n If you specify an n such that a must be zero-padded or truncated, the\n extra/removed values will be added/removed at high frequencies. One can\n thus resample a series to m points via Fourier interpolation by: a_resamp\n = inverse_real_fft(real_fft(a), m).\n\n This is the inverse of real_fft:\n inverse_real_fft(real_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = (shape(a)[axis] - 1) * 2\n return _raw_fft(a, n, axis, fftpack.rffti, fftpack.rfftb,\n _real_fft_cache) / n\n\n\ndef hermite_fft(a, n=None, axis=-1):\n \"\"\"hermite_fft(a, n=None, axis=-1)\n inverse_hermite_fft(a, n=None, axis=-1)\n\n These are a pair analogous to real_fft/inverse_real_fft, but for the\n opposite case: here the signal is real in the frequency domain and has\n Hermite symmetry in the time domain. So here it's hermite_fft for which\n you must supply the length of the result if it is to be odd.\n\n inverse_hermite_fft(hermite_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = (shape(a)[axis] - 1) * 2\n return inverse_real_fft(conjugate(a), n, axis) * n\n\n\ndef inverse_hermite_fft(a, n=None, axis=-1):\n \"\"\"hermite_fft(a, n=None, axis=-1)\n inverse_hermite_fft(a, n=None, axis=-1)\n\n These are a pair analogous to real_fft/inverse_real_fft, but for the\n opposite case: here the signal is real in the frequency domain and has\n Hermite symmetry in the time domain. So here it's hermite_fft for which\n you must supply the length of the result if it is to be odd.\n\n inverse_hermite_fft(hermite_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n \n a = asarray(a).astype(Float)\n if n == None:\n n = shape(a)[axis]\n return conjugate(real_fft(a, n, axis))/n\n\n\ndef _cook_nd_args(a, s=None, axes=None, invreal=0):\n if s is None:\n shapeless = 1\n if axes == None:\n s = list(a.shape)\n else:\n s = take(a.shape, axes)\n else:\n shapeless = 0\n s = list(s)\n if axes == None:\n axes = range(-len(s), 0)\n if len(s) != len(axes):\n raise ValueError, \"Shape and axes have different lengths.\"\n if invreal and shapeless:\n s[axes[-1]] = (s[axes[-1]] - 1) * 2\n return s, axes\n\n\ndef _raw_fftnd(a, s=None, axes=None, function=fft):\n a = asarray(a)\n s, axes = _cook_nd_args(a, s, axes)\n itl = range(len(axes))\n itl.reverse()\n for ii in itl:\n a = function(a, n=s[ii], axis=axes[ii])\n return a\n\n\ndef fftnd(a, s=None, axes=None):\n \"\"\"fftnd(a, s=None, axes=None)\n\n The n-dimensional fft of a. s is a sequence giving the shape of the input\n an result along the transformed axes, as n for fft. Results are packed\n analogously to fft: the term for zero frequency in all axes is in the\n low-order corner, while the term for the Nyquist frequency in all axes is\n in the middle.\n\n If neither s nor axes is specified, the transform is taken along all\n axes. If s is specified and axes is not, the last len(s) axes are used.\n If axes are specified and s is not, the input shape along the specified\n axes is used. If s and axes are both specified and are not the same\n length, an exception is raised.\"\"\"\n\n return _raw_fftnd(a,s,axes,fft)\n\ndef inverse_fftnd(a, s=None, axes=None):\n \"\"\"inverse_fftnd(a, s=None, axes=None)\n \n The inverse of fftnd.\"\"\"\n \n return _raw_fftnd(a, s, axes, inverse_fft)\n\n\ndef fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"fft2d(a, s=None, axes=(-2,-1)) \n \n The 2d fft of a. This is really just fftnd with different default\n behavior.\"\"\"\n\n return _raw_fftnd(a,s,axes,fft)\n\n\ndef inverse_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"inverse_fft2d(a, s=None, axes=(-2, -1))\n\n The inverse of fft2d. This is really just inverse_fftnd with different\n default behavior.\"\"\"\n\n return _raw_fftnd(a, s, axes, inverse_fft)\n\n\ndef real_fftnd(a, s=None, axes=None):\n \"\"\"real_fftnd(a, s=None, axes=None)\n\n The n-dimensional discrete Fourier transform of a real array a. A real\n transform as real_fft is performed along the axis specified by the last\n element of axes, then complex transforms as fft are performed along the\n other axes.\"\"\"\n \n a = asarray(a).astype(Float)\n s, axes = _cook_nd_args(a, s, axes)\n a = real_fft(a, s[-1], axes[-1])\n for ii in range(len(axes)-1):\n a = fft(a, s[ii], axes[ii])\n return a\n\n\ndef real_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"real_fft2d(a, s=None, axes=(-2,-1)) \n\n The 2d fft of the real valued array a. This is really just real_fftnd with\n different default behavior.\"\"\"\n \n return real_fftnd(a, s, axes)\n\n\ndef inverse_real_fftnd(a, s=None, axes=None):\n \"\"\"inverse_real_fftnd(a, s=None, axes=None)\n\n The inverse of real_fftnd. The transform implemented in inverse_fft is\n applied along all axes but the last, then the transform implemented in\n inverse_real_fft is performed along the last axis. As with\n inverse_real_fft, the length of the result along that axis must be\n specified if it is to be odd.\"\"\"\n \n a = asarray(a).astype(Complex)\n s, axes = _cook_nd_args(a, s, axes, invreal=1)\n for ii in range(len(axes)-1):\n a = inverse_fft(a, s[ii], axes[ii])\n a = inverse_real_fft(a, s[-1], axes[-1])\n return a\n\n\ndef inverse_real_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"inverse_real_fft2d(a, s=None, axes=(-2, -1))\n\n The inverse of real_fft2d. This is really just inverse_real_fftnd with\n different default behavior.\"\"\"\n \n return inverse_real_fftnd(a, s, axes)\n\nifft = inverse_fft\nrefft = real_fft\nirefft = inverse_real_fft\nhfft = hermite_fft\nihfft = inverse_hermite_fft\n\nfftn = fftnd\nifftn = inverse_fftnd\nrefftn = real_fftnd\nirefftn = inverse_real_fftnd\n\nfft2 = fft2d\nifft2 = inverse_fft2d\nrefft2 = real_fft2d\nirefft2 = inverse_real_fft2d\n", + "source_code_before": "\"\"\"\nDiscrete Fourier Transforms - FFT.py \n\nThe underlying code for these functions is an f2c translated and modified\nversion of the FFTPACK routines.\n\nfft(a, n=None, axis=-1) \ninverse_fft(a, n=None, axis=-1) \nreal_fft(a, n=None, axis=-1) \ninverse_real_fft(a, n=None, axis=-1)\nhermite_fft(a, n=None, axis=-1)\ninverse_hermite_fft(a, n=None, axis=-1)\nfftnd(a, s=None, axes=None)\ninverse_fftnd(a, s=None, axes=None)\nreal_fftnd(a, s=None, axes=None)\ninverse_real_fftnd(a, s=None, axes=None)\nfft2d(a, s=None, axes=(-2,-1)) \ninverse_fft2d(a, s=None, axes=(-2, -1))\nreal_fft2d(a, s=None, axes=(-2,-1)) \ninverse_real_fft2d(a, s=None, axes=(-2, -1))\n\"\"\"\n__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft', 'inverse_real_fft',\n 'irefft', 'hfft', 'ihfft', 'refftn', 'irefftn', 'refft2', 'irefft2',\n 'fft2', 'ifft2',\n 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd','fft2d',\n 'inverse_fft2d', 'real_fftnd', 'real_fft2d', 'inverse_real_fftnd',\n 'inverse_real_fft2d',]\n\nfrom numpy.core import *\nimport fftpack_lite as fftpack\nfrom helper import *\n\n_fft_cache = {}\n_real_fft_cache = {}\n\ndef _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti, \n work_function=fftpack.cfftf, fft_cache = _fft_cache ):\n a = asarray(a)\n\n if n == None: n = a.shape[axis]\n\n try:\n wsave = fft_cache[n]\n except(KeyError):\n wsave = init_function(n)\n fft_cache[n] = wsave\n\n if a.shape[axis] != n:\n s = list(a.shape)\n if s[axis] > n:\n index = [slice(None)]*len(s)\n index[axis] = slice(0,n)\n a = a[index]\n else:\n index = [slice(None)]*len(s)\n index[axis] = slice(0,s[axis])\n s[axis] = n\n z = zeros(s, a.dtypechar)\n z[index] = a\n a = z\n\n if axis != -1:\n a = swapaxes(a, axis, -1)\n r = work_function(a, wsave)\n if axis != -1:\n r = swapaxes(r, axis, -1)\n return r\n\n\ndef fft(a, n=None, axis=-1):\n \"\"\"fft(a, n=None, axis=-1) \n\n Will return the n point discrete Fourier transform of a. n defaults to the\n length of a. If n is larger than a, then a will be zero-padded to make up\n the difference. If n is smaller than a, the first n items in a will be\n used.\n\n The packing of the result is \"standard\": If A = fft(a, n), then A[0]\n contains the zero-frequency term, A[1:n/2+1] contains the\n positive-frequency terms, and A[n/2+1:] contains the negative-frequency\n terms, in order of decreasingly negative frequency. So for an 8-point\n transform, the frequencies of the result are [ 0, 1, 2, 3, 4, -3, -2, -1].\n\n This is most efficient for n a power of two. This also stores a cache of\n working memory for different sizes of fft's, so you could theoretically\n run into memory problems if you call this too many times with too many\n different n's.\"\"\"\n\n return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftf, _fft_cache)\n\n\ndef inverse_fft(a, n=None, axis=-1):\n \"\"\"inverse_fft(a, n=None, axis=-1) \n\n Will return the n point inverse discrete Fourier transform of a. n\n defaults to the length of a. If n is larger than a, then a will be\n zero-padded to make up the difference. If n is smaller than a, then a will\n be truncated to reduce its size.\n\n The input array is expected to be packed the same way as the output of\n fft, as discussed in it's documentation.\n\n This is the inverse of fft: inverse_fft(fft(a)) == a within numerical\n accuracy.\n\n This is most efficient for n a power of two. This also stores a cache of\n working memory for different sizes of fft's, so you could theoretically\n run into memory problems if you call this too many times with too many\n different n's.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = shape(a)[axis]\n return _raw_fft(a, n, axis, fftpack.cffti, fftpack.cfftb, _fft_cache) / n\n\n\ndef real_fft(a, n=None, axis=-1):\n \"\"\"real_fft(a, n=None, axis=-1) \n\n Will return the n point discrete Fourier transform of the real valued\n array a. n defaults to the length of a. n is the length of the input, not\n the output.\n\n The returned array will be the nonnegative frequency terms of the\n Hermite-symmetric, complex transform of the real array. So for an 8-point\n transform, the frequencies in the result are [ 0, 1, 2, 3, 4]. The first\n term will be real, as will the last if n is even. The negative frequency\n terms are not needed because they are the complex conjugates of the\n positive frequency terms. (This is what I mean when I say\n Hermite-symmetric.)\n\n This is most efficient for n a power of two.\"\"\"\n\n a = asarray(a).astype(Float)\n return _raw_fft(a, n, axis, fftpack.rffti, fftpack.rfftf, _real_fft_cache)\n\n\ndef inverse_real_fft(a, n=None, axis=-1):\n \"\"\"inverse_real_fft(a, n=None, axis=-1)\n \n Will return the real valued n point inverse discrete Fourier transform of\n a, where a contains the nonnegative frequency terms of a Hermite-symmetric\n sequence. n is the length of the result, not the input. If n is not\n supplied, the default is 2*(len(a)-1). If you want the length of the\n result to be odd, you have to say so.\n\n If you specify an n such that a must be zero-padded or truncated, the\n extra/removed values will be added/removed at high frequencies. One can\n thus resample a series to m points via Fourier interpolation by: a_resamp\n = inverse_real_fft(real_fft(a), m).\n\n This is the inverse of real_fft:\n inverse_real_fft(real_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = (shape(a)[axis] - 1) * 2\n return _raw_fft(a, n, axis, fftpack.rffti, fftpack.rfftb,\n _real_fft_cache) / n\n\n\ndef hermite_fft(a, n=None, axis=-1):\n \"\"\"hermite_fft(a, n=None, axis=-1)\n inverse_hermite_fft(a, n=None, axis=-1)\n\n These are a pair analogous to real_fft/inverse_real_fft, but for the\n opposite case: here the signal is real in the frequency domain and has\n Hermite symmetry in the time domain. So here it's hermite_fft for which\n you must supply the length of the result if it is to be odd.\n\n inverse_hermite_fft(hermite_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n\n a = asarray(a).astype(Complex)\n if n == None:\n n = (shape(a)[axis] - 1) * 2\n return inverse_real_fft(conjugate(a), n, axis) * n\n\n\ndef inverse_hermite_fft(a, n=None, axis=-1):\n \"\"\"hermite_fft(a, n=None, axis=-1)\n inverse_hermite_fft(a, n=None, axis=-1)\n\n These are a pair analogous to real_fft/inverse_real_fft, but for the\n opposite case: here the signal is real in the frequency domain and has\n Hermite symmetry in the time domain. So here it's hermite_fft for which\n you must supply the length of the result if it is to be odd.\n\n inverse_hermite_fft(hermite_fft(a), len(a)) == a\n within numerical accuracy.\"\"\"\n \n a = asarray(a).astype(Float)\n if n == None:\n n = shape(a)[axis]\n return conjugate(real_fft(a, n, axis))/n\n\n\ndef _cook_nd_args(a, s=None, axes=None, invreal=0):\n if s is None:\n shapeless = 1\n if axes == None:\n s = list(a.shape)\n else:\n s = take(a.shape, axes)\n else:\n shapeless = 0\n s = list(s)\n if axes == None:\n axes = range(-len(s), 0)\n if len(s) != len(axes):\n raise ValueError, \"Shape and axes have different lengths.\"\n if invreal and shapeless:\n s[axes[-1]] = (s[axes[-1]] - 1) * 2\n return s, axes\n\n\ndef _raw_fftnd(a, s=None, axes=None, function=fft):\n a = asarray(a)\n s, axes = _cook_nd_args(a, s, axes)\n itl = range(len(axes))\n itl.reverse()\n for ii in itl:\n a = function(a, n=s[ii], axis=axes[ii])\n return a\n\n\ndef fftnd(a, s=None, axes=None):\n \"\"\"fftnd(a, s=None, axes=None)\n\n The n-dimensional fft of a. s is a sequence giving the shape of the input\n an result along the transformed axes, as n for fft. Results are packed\n analogously to fft: the term for zero frequency in all axes is in the\n low-order corner, while the term for the Nyquist frequency in all axes is\n in the middle.\n\n If neither s nor axes is specified, the transform is taken along all\n axes. If s is specified and axes is not, the last len(s) axes are used.\n If axes are specified and s is not, the input shape along the specified\n axes is used. If s and axes are both specified and are not the same\n length, an exception is raised.\"\"\"\n\n return _raw_fftnd(a,s,axes,fft)\n\ndef inverse_fftnd(a, s=None, axes=None):\n \"\"\"inverse_fftnd(a, s=None, axes=None)\n \n The inverse of fftnd.\"\"\"\n \n return _raw_fftnd(a, s, axes, inverse_fft)\n\n\ndef fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"fft2d(a, s=None, axes=(-2,-1)) \n \n The 2d fft of a. This is really just fftnd with different default\n behavior.\"\"\"\n\n return _raw_fftnd(a,s,axes,fft)\n\n\ndef inverse_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"inverse_fft2d(a, s=None, axes=(-2, -1))\n\n The inverse of fft2d. This is really just inverse_fftnd with different\n default behavior.\"\"\"\n\n return _raw_fftnd(a, s, axes, inverse_fft)\n\n\ndef real_fftnd(a, s=None, axes=None):\n \"\"\"real_fftnd(a, s=None, axes=None)\n\n The n-dimensional discrete Fourier transform of a real array a. A real\n transform as real_fft is performed along the axis specified by the last\n element of axes, then complex transforms as fft are performed along the\n other axes.\"\"\"\n \n a = asarray(a).astype(Float)\n s, axes = _cook_nd_args(a, s, axes)\n a = real_fft(a, s[-1], axes[-1])\n for ii in range(len(axes)-1):\n a = fft(a, s[ii], axes[ii])\n return a\n\n\ndef real_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"real_fft2d(a, s=None, axes=(-2,-1)) \n\n The 2d fft of the real valued array a. This is really just real_fftnd with\n different default behavior.\"\"\"\n \n return real_fftnd(a, s, axes)\n\n\ndef inverse_real_fftnd(a, s=None, axes=None):\n \"\"\"inverse_real_fftnd(a, s=None, axes=None)\n\n The inverse of real_fftnd. The transform implemented in inverse_fft is\n applied along all axes but the last, then the transform implemented in\n inverse_real_fft is performed along the last axis. As with\n inverse_real_fft, the length of the result along that axis must be\n specified if it is to be odd.\"\"\"\n \n a = asarray(a).astype(Complex)\n s, axes = _cook_nd_args(a, s, axes, invreal=1)\n for ii in range(len(axes)-1):\n a = inverse_fft(a, s[ii], axes[ii])\n a = inverse_real_fft(a, s[-1], axes[-1])\n return a\n\n\ndef inverse_real_fft2d(a, s=None, axes=(-2,-1)):\n \"\"\"inverse_real_fft2d(a, s=None, axes=(-2, -1))\n\n The inverse of real_fft2d. This is really just inverse_real_fftnd with\n different default behavior.\"\"\"\n \n return inverse_real_fftnd(a, s, axes)\n\nifft = inverse_fft\nrefft = real_fft\nirefft = inverse_real_fft\nhfft = hermite_fft\nihfft = inverse_hermite_fft\n\nfftn = fftnd\nifftn = inverse_fftnd\nrefftn = real_fftnd\nirefftn = inverse_real_fftnd\n\nfft2 = fft2d\nifft2 = inverse_fft2d\nrefft2 = real_fft2d\nirefft2 = inverse_real_fft2d\n", + "methods": [ + { + "name": "_raw_fft", + "long_name": "_raw_fft( a , n = None , axis = - 1 , init_function = fftpack . cffti , work_function = fftpack . cfftf , fft_cache = _fft_cache )", + "filename": "fftpack.py", + "nloc": 28, + "complexity": 7, + "token_count": 228, + "parameters": [ + "a", + "n", + "axis", + "init_function", + "work_function", + "fft_cache" + ], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "fft", + "long_name": "fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 70, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "inverse_fft", + "long_name": "inverse_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 92, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "real_fft", + "long_name": "real_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 3, + "complexity": 1, + "token_count": 45, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 117, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fft", + "long_name": "inverse_real_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 2, + "token_count": 67, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 138, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "hermite_fft", + "long_name": "hermite_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 60, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 163, + "end_line": 178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "inverse_hermite_fft", + "long_name": "inverse_hermite_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 54, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 181, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "_cook_nd_args", + "long_name": "_cook_nd_args( a , s = None , axes = None , invreal = 0 )", + "filename": "fftpack.py", + "nloc": 17, + "complexity": 7, + "token_count": 125, + "parameters": [ + "a", + "s", + "axes", + "invreal" + ], + "start_line": 199, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_raw_fftnd", + "long_name": "_raw_fftnd( a , s = None , axes = None , function = fft )", + "filename": "fftpack.py", + "nloc": 8, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "s", + "axes", + "function" + ], + "start_line": 218, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fftnd", + "long_name": "fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 228, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "inverse_fftnd", + "long_name": "inverse_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 245, + "end_line": 250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "fft2d", + "long_name": "fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 253, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "inverse_fft2d", + "long_name": "inverse_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 262, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "real_fftnd", + "long_name": "real_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 7, + "complexity": 2, + "token_count": 86, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 271, + "end_line": 284, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "real_fft2d", + "long_name": "real_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 287, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fftnd", + "long_name": "inverse_real_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 7, + "complexity": 2, + "token_count": 90, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 296, + "end_line": 310, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fft2d", + "long_name": "inverse_real_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 313, + "end_line": 319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_raw_fft", + "long_name": "_raw_fft( a , n = None , axis = - 1 , init_function = fftpack . cffti , work_function = fftpack . cfftf , fft_cache = _fft_cache )", + "filename": "fftpack.py", + "nloc": 28, + "complexity": 7, + "token_count": 228, + "parameters": [ + "a", + "n", + "axis", + "init_function", + "work_function", + "fft_cache" + ], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "fft", + "long_name": "fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 34, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 70, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "inverse_fft", + "long_name": "inverse_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 61, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 92, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "real_fft", + "long_name": "real_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 3, + "complexity": 1, + "token_count": 45, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 117, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fft", + "long_name": "inverse_real_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 2, + "token_count": 67, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 138, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "hermite_fft", + "long_name": "hermite_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 60, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 163, + "end_line": 178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "inverse_hermite_fft", + "long_name": "inverse_hermite_fft( a , n = None , axis = - 1 )", + "filename": "fftpack.py", + "nloc": 5, + "complexity": 2, + "token_count": 54, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 181, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "_cook_nd_args", + "long_name": "_cook_nd_args( a , s = None , axes = None , invreal = 0 )", + "filename": "fftpack.py", + "nloc": 17, + "complexity": 7, + "token_count": 125, + "parameters": [ + "a", + "s", + "axes", + "invreal" + ], + "start_line": 199, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "_raw_fftnd", + "long_name": "_raw_fftnd( a , s = None , axes = None , function = fft )", + "filename": "fftpack.py", + "nloc": 8, + "complexity": 2, + "token_count": 76, + "parameters": [ + "a", + "s", + "axes", + "function" + ], + "start_line": 218, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "fftnd", + "long_name": "fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 228, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "inverse_fftnd", + "long_name": "inverse_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 245, + "end_line": 250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "fft2d", + "long_name": "fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 253, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "inverse_fft2d", + "long_name": "inverse_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 31, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 262, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "real_fftnd", + "long_name": "real_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 7, + "complexity": 2, + "token_count": 86, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 271, + "end_line": 284, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "real_fft2d", + "long_name": "real_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 287, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fftnd", + "long_name": "inverse_real_fftnd( a , s = None , axes = None )", + "filename": "fftpack.py", + "nloc": 7, + "complexity": 2, + "token_count": 90, + "parameters": [ + "a", + "s", + "axes" + ], + "start_line": 296, + "end_line": 310, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "inverse_real_fft2d", + "long_name": "inverse_real_fft2d( a , s = None , axes = ( - 2 , - 1 )", + "filename": "fftpack.py", + "nloc": 6, + "complexity": 1, + "token_count": 29, + "parameters": [ + "a", + "s", + "axes", + "1" + ], + "start_line": 313, + "end_line": 319, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 166, + "complexity": 36, + "token_count": 1232, + "diff_parsed": { + "added": [ + "__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft',", + " 'inverse_real_fft', 'irefft', 'hfft', 'ihfft', 'refftn',", + " 'irefftn', 'refft2', 'irefft2', 'fft2', 'ifft2',", + " 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd',", + " 'fft2d', 'inverse_fft2d', 'real_fftnd', 'real_fft2d',", + " 'inverse_real_fftnd', 'inverse_real_fft2d','fftn','ifftn']" + ], + "deleted": [ + "__all__ = ['fft','inverse_fft', 'ifft', 'real_fft', 'refft', 'inverse_real_fft',", + " 'irefft', 'hfft', 'ihfft', 'refftn', 'irefftn', 'refft2', 'irefft2',", + " 'fft2', 'ifft2',", + " 'hermite_fft','inverse_hermite_fft','fftnd','inverse_fftnd','fft2d',", + " 'inverse_fft2d', 'real_fftnd', 'real_fft2d', 'inverse_real_fftnd',", + " 'inverse_real_fft2d',]" + ] + } + }, + { + "old_path": "numpy/dual.py", + "new_path": "numpy/dual.py", + "filename": "dual.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -5,7 +5,7 @@\n \n __all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n- 'pinv','cholesky']\n+ 'pinv','cholesky','i0']\n \n try:\n import scipy.linalg as linpkg\n@@ -17,6 +17,10 @@\n except ImportError:\n import numpy.dft as fftpkg\n \n+try:\n+ from scipy.special import i0\n+except ImportError:\n+ from numpy.lib import i0\n \n fft = fftpkg.fft\n ifft = fftpkg.ifft\n@@ -35,6 +39,3 @@\n pinv = linpkg.pinv\n cholesky = linpkg.cholesky\n \n-del linpkg\n-del fftpkg\n- \n", + "added_lines": 5, + "deleted_lines": 4, + "source_code": "# This module should be used for functions both in numpy and scipy if\n# you want to use the numpy version if available but the scipy version\n# otherwise.\n# Usage --- from numpy.dual import fft, inv\n\n__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n 'pinv','cholesky','i0']\n\ntry:\n import scipy.linalg as linpkg\nexcept ImportError:\n import numpy.linalg as linpkg\n\ntry:\n import scipy.fftpack as fftpkg\nexcept ImportError:\n import numpy.dft as fftpkg\n\ntry:\n from scipy.special import i0\nexcept ImportError:\n from numpy.lib import i0\n\nfft = fftpkg.fft\nifft = fftpkg.ifft\nfftn = fftpkg.fftn\nifftn = fftpkg.ifftn\nfft2 = fftpkg.fft2\nifft2 = fftpkg.ifft2\n\ninv = linpkg.inv\nsvd = linpkg.svd\nsolve = linpkg.solve\ndet = linpkg.det\neig = linpkg.eig\neigvals = linpkg.eigvals\nlstsq = linpkg.lstsq\npinv = linpkg.pinv\ncholesky = linpkg.cholesky\n\n", + "source_code_before": "# This module should be used for functions both in numpy and scipy if\n# you want to use the numpy version if available but the scipy version\n# otherwise.\n# Usage --- from numpy.dual import fft, inv\n\n__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',\n 'inv','svd','solve','det','eig','eigvals','lstsq',\n 'pinv','cholesky']\n\ntry:\n import scipy.linalg as linpkg\nexcept ImportError:\n import numpy.linalg as linpkg\n\ntry:\n import scipy.fftpack as fftpkg\nexcept ImportError:\n import numpy.dft as fftpkg\n\n\nfft = fftpkg.fft\nifft = fftpkg.ifft\nfftn = fftpkg.fftn\nifftn = fftpkg.ifftn\nfft2 = fftpkg.fft2\nifft2 = fftpkg.ifft2\n\ninv = linpkg.inv\nsvd = linpkg.svd\nsolve = linpkg.solve\ndet = linpkg.det\neig = linpkg.eig\neigvals = linpkg.eigvals\nlstsq = linpkg.lstsq\npinv = linpkg.pinv\ncholesky = linpkg.cholesky\n\ndel linpkg\ndel fftpkg\n \n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 30, + "complexity": 0, + "token_count": 161, + "diff_parsed": { + "added": [ + " 'pinv','cholesky','i0']", + "try:", + " from scipy.special import i0", + "except ImportError:", + " from numpy.lib import i0" + ], + "deleted": [ + " 'pinv','cholesky']", + "del linpkg", + "del fftpkg", + "" + ] + } + }, + { + "old_path": "numpy/lib/function_base.py", + "new_path": "numpy/lib/function_base.py", + "filename": "function_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,16 +7,17 @@\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n- 'kaiser', 'trapz'\n+ 'kaiser', 'trapz', 'i0'\n ]\n \n import types\n import math\n import numpy.core.numeric as _nx\n-from numpy.core.numeric import ones, zeros, arange, concatenate, array, asarray, empty\n+from numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n+ asarray, empty, empty_like\n from numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\n-from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, frompyfunc, \\\n- isnan, absolute, cos, less_equal, sqrt, sin, mod\n+from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n+ frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\n from numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\n@@ -167,9 +168,6 @@ def asarray_chkfinite(a):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n \n-\n-\n-\n def piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n \n@@ -694,12 +692,102 @@ def hamming(M):\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n \n+## Code from cephes for i0\n+\n+_i0A = [\n+-4.41534164647933937950E-18,\n+ 3.33079451882223809783E-17,\n+-2.43127984654795469359E-16,\n+ 1.71539128555513303061E-15,\n+-1.16853328779934516808E-14,\n+ 7.67618549860493561688E-14,\n+-4.85644678311192946090E-13,\n+ 2.95505266312963983461E-12,\n+-1.72682629144155570723E-11,\n+ 9.67580903537323691224E-11,\n+-5.18979560163526290666E-10,\n+ 2.65982372468238665035E-9,\n+-1.30002500998624804212E-8,\n+ 6.04699502254191894932E-8,\n+-2.67079385394061173391E-7,\n+ 1.11738753912010371815E-6,\n+-4.41673835845875056359E-6,\n+ 1.64484480707288970893E-5,\n+-5.75419501008210370398E-5,\n+ 1.88502885095841655729E-4,\n+-5.76375574538582365885E-4,\n+ 1.63947561694133579842E-3,\n+-4.32430999505057594430E-3,\n+ 1.05464603945949983183E-2,\n+-2.37374148058994688156E-2,\n+ 4.93052842396707084878E-2,\n+-9.49010970480476444210E-2,\n+ 1.71620901522208775349E-1,\n+-3.04682672343198398683E-1,\n+ 6.76795274409476084995E-1]\n+\n+_i0B = [\n+-7.23318048787475395456E-18,\n+-4.83050448594418207126E-18,\n+ 4.46562142029675999901E-17,\n+ 3.46122286769746109310E-17,\n+-2.82762398051658348494E-16,\n+-3.42548561967721913462E-16,\n+ 1.77256013305652638360E-15,\n+ 3.81168066935262242075E-15,\n+-9.55484669882830764870E-15,\n+-4.15056934728722208663E-14,\n+ 1.54008621752140982691E-14,\n+ 3.85277838274214270114E-13,\n+ 7.18012445138366623367E-13,\n+-1.79417853150680611778E-12,\n+-1.32158118404477131188E-11,\n+-3.14991652796324136454E-11,\n+ 1.18891471078464383424E-11,\n+ 4.94060238822496958910E-10,\n+ 3.39623202570838634515E-9,\n+ 2.26666899049817806459E-8,\n+ 2.04891858946906374183E-7,\n+ 2.89137052083475648297E-6,\n+ 6.88975834691682398426E-5,\n+ 3.36911647825569408990E-3,\n+ 8.04490411014108831608E-1]\n+\n+def _chbevl(x, vals):\n+ b0 = vals[0]\n+ b1 = 0.0\n+\n+ for i in xrange(1,len(vals)):\n+ b2 = b1\n+ b1 = b0\n+ b0 = x*b1 - b2 + vals[i]\n+\n+ return 0.5*(b0 - b2)\n+ \n+\n+def _i0_1(x):\n+ return exp(x) * _chbevl(x/2.0-2, _i0A)\n+\n+def _i0_2(x):\n+ return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n+\n+def i0(x):\n+ x = atleast_1d(x)\n+ y = empty_like(x)\n+ ind = (x<0)\n+ x[ind] = -x[ind]\n+ ind = (x<=8.0)\n+ y[ind] = _i0_1(x[ind])\n+ ind2 = ~ind\n+ y[ind2] = _i0_2(x[ind2])\n+ return y.squeeze() \n+\n def kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n- from numpy.special import i0\n+ from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n", + "added_lines": 96, + "deleted_lines": 8, + "source_code": "\nl__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', 'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz', 'i0'\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n asarray, empty, empty_like\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\n## Code from cephes for i0\n\n_i0A = [\n-4.41534164647933937950E-18,\n 3.33079451882223809783E-17,\n-2.43127984654795469359E-16,\n 1.71539128555513303061E-15,\n-1.16853328779934516808E-14,\n 7.67618549860493561688E-14,\n-4.85644678311192946090E-13,\n 2.95505266312963983461E-12,\n-1.72682629144155570723E-11,\n 9.67580903537323691224E-11,\n-5.18979560163526290666E-10,\n 2.65982372468238665035E-9,\n-1.30002500998624804212E-8,\n 6.04699502254191894932E-8,\n-2.67079385394061173391E-7,\n 1.11738753912010371815E-6,\n-4.41673835845875056359E-6,\n 1.64484480707288970893E-5,\n-5.75419501008210370398E-5,\n 1.88502885095841655729E-4,\n-5.76375574538582365885E-4,\n 1.63947561694133579842E-3,\n-4.32430999505057594430E-3,\n 1.05464603945949983183E-2,\n-2.37374148058994688156E-2,\n 4.93052842396707084878E-2,\n-9.49010970480476444210E-2,\n 1.71620901522208775349E-1,\n-3.04682672343198398683E-1,\n 6.76795274409476084995E-1]\n\n_i0B = [\n-7.23318048787475395456E-18,\n-4.83050448594418207126E-18,\n 4.46562142029675999901E-17,\n 3.46122286769746109310E-17,\n-2.82762398051658348494E-16,\n-3.42548561967721913462E-16,\n 1.77256013305652638360E-15,\n 3.81168066935262242075E-15,\n-9.55484669882830764870E-15,\n-4.15056934728722208663E-14,\n 1.54008621752140982691E-14,\n 3.85277838274214270114E-13,\n 7.18012445138366623367E-13,\n-1.79417853150680611778E-12,\n-1.32158118404477131188E-11,\n-3.14991652796324136454E-11,\n 1.18891471078464383424E-11,\n 4.94060238822496958910E-10,\n 3.39623202570838634515E-9,\n 2.26666899049817806459E-8,\n 2.04891858946906374183E-7,\n 2.89137052083475648297E-6,\n 6.88975834691682398426E-5,\n 3.36911647825569408990E-3,\n 8.04490411014108831608E-1]\n\ndef _chbevl(x, vals):\n b0 = vals[0]\n b1 = 0.0\n\n for i in xrange(1,len(vals)):\n b2 = b1\n b1 = b0\n b0 = x*b1 - b2 + vals[i]\n\n return 0.5*(b0 - b2)\n \n\ndef _i0_1(x):\n return exp(x) * _chbevl(x/2.0-2, _i0A)\n\ndef _i0_2(x):\n return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n\ndef i0(x):\n x = atleast_1d(x)\n y = empty_like(x)\n ind = (x<0)\n x[ind] = -x[ind]\n ind = (x<=8.0)\n y[ind] = _i0_1(x[ind])\n ind2 = ~ind\n y[ind2] = _i0_2(x[ind2])\n return y.squeeze() \n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n", + "source_code_before": "\nl__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', 'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz'\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, asarray, empty\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, frompyfunc, \\\n isnan, absolute, cos, less_equal, sqrt, sin, mod\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\n\n\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.special import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n", + "methods": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 32, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 54, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 69, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 90, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 171, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 224, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 280, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 287, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 362, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 382, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 398, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 415, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 433, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 455, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 464, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 472, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 487, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 495, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 503, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 519, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 564, + "end_line": 589, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 591, + "end_line": 621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 623, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 664, + "end_line": 669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 671, + "end_line": 675, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 677, + "end_line": 681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 683, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 689, + "end_line": 693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 795, + "end_line": 799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 801, + "end_line": 804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 806, + "end_line": 815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 817, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 31, + "end_line": 51, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 53, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 63, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 68, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 89, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 161, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 173, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 226, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 274, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 282, + "end_line": 285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 289, + "end_line": 361, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 364, + "end_line": 382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 384, + "end_line": 398, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 400, + "end_line": 415, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 417, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 435, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 457, + "end_line": 464, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 466, + "end_line": 472, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 474, + "end_line": 479, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 481, + "end_line": 487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 489, + "end_line": 495, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 497, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 505, + "end_line": 511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 513, + "end_line": 519, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 521, + "end_line": 533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 566, + "end_line": 591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 593, + "end_line": 623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 625, + "end_line": 664, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 666, + "end_line": 671, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 673, + "end_line": 677, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 679, + "end_line": 683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 685, + "end_line": 689, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 691, + "end_line": 695, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 697, + "end_line": 705, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 707, + "end_line": 711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 713, + "end_line": 716, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 718, + "end_line": 727, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 729, + "end_line": 743, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "nloc": 548, + "complexity": 134, + "token_count": 4289, + "diff_parsed": { + "added": [ + " 'kaiser', 'trapz', 'i0'", + "from numpy.core.numeric import ones, zeros, arange, concatenate, array, \\", + " asarray, empty, empty_like", + "from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\", + " frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp", + "## Code from cephes for i0", + "", + "_i0A = [", + "-4.41534164647933937950E-18,", + " 3.33079451882223809783E-17,", + "-2.43127984654795469359E-16,", + " 1.71539128555513303061E-15,", + "-1.16853328779934516808E-14,", + " 7.67618549860493561688E-14,", + "-4.85644678311192946090E-13,", + " 2.95505266312963983461E-12,", + "-1.72682629144155570723E-11,", + " 9.67580903537323691224E-11,", + "-5.18979560163526290666E-10,", + " 2.65982372468238665035E-9,", + "-1.30002500998624804212E-8,", + " 6.04699502254191894932E-8,", + "-2.67079385394061173391E-7,", + " 1.11738753912010371815E-6,", + "-4.41673835845875056359E-6,", + " 1.64484480707288970893E-5,", + "-5.75419501008210370398E-5,", + " 1.88502885095841655729E-4,", + "-5.76375574538582365885E-4,", + " 1.63947561694133579842E-3,", + "-4.32430999505057594430E-3,", + " 1.05464603945949983183E-2,", + "-2.37374148058994688156E-2,", + " 4.93052842396707084878E-2,", + "-9.49010970480476444210E-2,", + " 1.71620901522208775349E-1,", + "-3.04682672343198398683E-1,", + " 6.76795274409476084995E-1]", + "", + "_i0B = [", + "-7.23318048787475395456E-18,", + "-4.83050448594418207126E-18,", + " 4.46562142029675999901E-17,", + " 3.46122286769746109310E-17,", + "-2.82762398051658348494E-16,", + "-3.42548561967721913462E-16,", + " 1.77256013305652638360E-15,", + " 3.81168066935262242075E-15,", + "-9.55484669882830764870E-15,", + "-4.15056934728722208663E-14,", + " 1.54008621752140982691E-14,", + " 3.85277838274214270114E-13,", + " 7.18012445138366623367E-13,", + "-1.79417853150680611778E-12,", + "-1.32158118404477131188E-11,", + "-3.14991652796324136454E-11,", + " 1.18891471078464383424E-11,", + " 4.94060238822496958910E-10,", + " 3.39623202570838634515E-9,", + " 2.26666899049817806459E-8,", + " 2.04891858946906374183E-7,", + " 2.89137052083475648297E-6,", + " 6.88975834691682398426E-5,", + " 3.36911647825569408990E-3,", + " 8.04490411014108831608E-1]", + "", + "def _chbevl(x, vals):", + " b0 = vals[0]", + " b1 = 0.0", + "", + " for i in xrange(1,len(vals)):", + " b2 = b1", + " b1 = b0", + " b0 = x*b1 - b2 + vals[i]", + "", + " return 0.5*(b0 - b2)", + "", + "", + "def _i0_1(x):", + " return exp(x) * _chbevl(x/2.0-2, _i0A)", + "", + "def _i0_2(x):", + " return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)", + "", + "def i0(x):", + " x = atleast_1d(x)", + " y = empty_like(x)", + " ind = (x<0)", + " x[ind] = -x[ind]", + " ind = (x<=8.0)", + " y[ind] = _i0_1(x[ind])", + " ind2 = ~ind", + " y[ind2] = _i0_2(x[ind2])", + " return y.squeeze()", + "", + " from numpy.dual import i0" + ], + "deleted": [ + " 'kaiser', 'trapz'", + "from numpy.core.numeric import ones, zeros, arange, concatenate, array, asarray, empty", + "from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, frompyfunc, \\", + " isnan, absolute, cos, less_equal, sqrt, sin, mod", + "", + "", + "", + " from numpy.special import i0" + ] + } + }, + { + "old_path": "numpy/lib/mlab.py", + "new_path": "numpy/lib/mlab.py", + "filename": "mlab.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -5,10 +5,11 @@\n from twodim_base import eye, tri, diag, fliplr, flipud, rot90, tril, triu\n from numpy.core.oldnumeric import amax as max\n from numpy.core.oldnumeric import amin as min\n-from function_base import msort, median, trapz, diff, cov, corrcoef, kaiser, blackman, \\\n- bartlett, hanning, hamming, sinc, angle\n-from numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, squeeze\n+from function_base import msort, median, trapz, diff, cov, corrcoef, \\\n+ kaiser, blackman, bartlett, hanning, hamming, sinc, angle\n+from numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, \\\n+ squeeze\n from polynomial import roots\n \n from numpy.random import rand, randn\n-from numpy.linalg import eig, svd\n+from numpy.dual import eig, svd\n", + "added_lines": 5, + "deleted_lines": 4, + "source_code": "# This module is for compatibility only. All functions are defined elsewhere.\n\nfrom numpy.core.numeric import *\n\nfrom twodim_base import eye, tri, diag, fliplr, flipud, rot90, tril, triu\nfrom numpy.core.oldnumeric import amax as max\nfrom numpy.core.oldnumeric import amin as min\nfrom function_base import msort, median, trapz, diff, cov, corrcoef, \\\n kaiser, blackman, bartlett, hanning, hamming, sinc, angle\nfrom numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, \\\n squeeze\nfrom polynomial import roots\n\nfrom numpy.random import rand, randn\nfrom numpy.dual import eig, svd\n", + "source_code_before": "# This module is for compatibility only. All functions are defined elsewhere.\n\nfrom numpy.core.numeric import *\n\nfrom twodim_base import eye, tri, diag, fliplr, flipud, rot90, tril, triu\nfrom numpy.core.oldnumeric import amax as max\nfrom numpy.core.oldnumeric import amin as min\nfrom function_base import msort, median, trapz, diff, cov, corrcoef, kaiser, blackman, \\\n bartlett, hanning, hamming, sinc, angle\nfrom numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, squeeze\nfrom polynomial import roots\n\nfrom numpy.random import rand, randn\nfrom numpy.linalg import eig, svd\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 11, + "complexity": 0, + "token_count": 116, + "diff_parsed": { + "added": [ + "from function_base import msort, median, trapz, diff, cov, corrcoef, \\", + " kaiser, blackman, bartlett, hanning, hamming, sinc, angle", + "from numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, \\", + " squeeze", + "from numpy.dual import eig, svd" + ], + "deleted": [ + "from function_base import msort, median, trapz, diff, cov, corrcoef, kaiser, blackman, \\", + " bartlett, hanning, hamming, sinc, angle", + "from numpy.core.oldnumeric import cumsum, ptp, mean, std, prod, cumprod, squeeze", + "from numpy.linalg import eig, svd" + ] + } + }, + { + "old_path": "numpy/lib/polynomial.py", + "new_path": "numpy/lib/polynomial.py", + "filename": "polynomial.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -19,7 +19,7 @@\n def get_linalg_funcs():\n \"Look for linear algebra functions in numpy\"\n global eigvals, lstsq\n- from numpy.linalg import eigvals, lstsq\n+ from numpy.dual import eigvals, lstsq\n return\n \n def _eigvals(arg):\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\"\nFunctions to operate on polynomials.\n\"\"\"\n\n__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',\n 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',\n 'polyfit']\n\nimport re\nimport numpy.core.numeric as NX\n\nfrom numpy.core import isscalar\nfrom twodim_base import diag, vander\nfrom shape_base import hstack, atleast_1d\nfrom function_base import trim_zeros, sort_complex\neigvals = None\nlstsq = None\n\ndef get_linalg_funcs():\n \"Look for linear algebra functions in numpy\"\n global eigvals, lstsq\n from numpy.dual import eigvals, lstsq\n return\n\ndef _eigvals(arg):\n \"Return the eigenvalues of the argument\"\n try:\n return eigvals(arg)\n except TypeError:\n get_linalg_funcs()\n return eigvals(arg)\n\ndef _lstsq(X, y):\n \"Do least squares on the arguments\"\n try:\n return lstsq(X, y)\n except TypeError:\n get_linalg_funcs()\n return lstsq(X, y)\n\ndef poly(seq_of_zeros):\n \"\"\" Return a sequence representing a polynomial given a sequence of roots.\n\n If the input is a matrix, return the characteristic polynomial.\n\n Example:\n\n >>> b = roots([1,3,1,5,6])\n >>> poly(b)\n array([1., 3., 1., 5., 6.])\n \"\"\"\n seq_of_zeros = atleast_1d(seq_of_zeros)\n sh = seq_of_zeros.shape\n if len(sh) == 2 and sh[0] == sh[1]:\n seq_of_zeros = _eigvals(seq_of_zeros)\n elif len(sh) ==1:\n pass\n else:\n raise ValueError, \"input must be 1d or square 2d array.\"\n\n if len(seq_of_zeros) == 0:\n return 1.0\n\n a = [1]\n for k in range(len(seq_of_zeros)):\n a = NX.convolve(a, [1, -seq_of_zeros[k]], mode='full')\n\n if issubclass(a.dtype, NX.complexfloating):\n # if complex roots are all complex conjugates, the roots are real.\n roots = NX.asarray(seq_of_zeros, complex)\n pos_roots = sort_complex(NX.compress(roots.imag > 0, roots))\n neg_roots = NX.conjugate(sort_complex(\n NX.compress(roots.imag < 0,roots)))\n if (len(pos_roots) == len(neg_roots) and\n NX.alltrue(neg_roots == pos_roots)):\n a = a.real.copy()\n\n return a\n\ndef roots(p):\n \"\"\" Return the roots of the polynomial coefficients in p.\n\n The values in the rank-1 array p are coefficients of a polynomial.\n If the length of p is n+1 then the polynomial is\n p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]\n \"\"\"\n # If input is scalar, this makes it an array\n p = atleast_1d(p)\n if len(p.shape) != 1:\n raise ValueError,\"Input must be a rank-1 array.\"\n\n # find non-zero array entries\n non_zero = NX.nonzero(NX.ravel(p))\n\n # find the number of trailing zeros -- this is the number of roots at 0.\n trailing_zeros = len(p) - non_zero[-1] - 1\n\n # strip leading and trailing zeros\n p = p[int(non_zero[0]):int(non_zero[-1])+1]\n\n # casting: if incoming array isn't floating point, make it floating point.\n if not issubclass(p.dtype, (NX.floating, NX.complexfloating)):\n p = p.astype(float)\n\n N = len(p)\n if N > 1:\n # build companion matrix and find its eigenvalues (the roots)\n A = diag(NX.ones((N-2,), p.dtype), -1)\n A[0, :] = -p[1:] / p[0]\n roots = _eigvals(A)\n else:\n return NX.array([])\n\n # tack any zeros onto the back of the array\n roots = hstack((roots, NX.zeros(trailing_zeros, roots.dtype)))\n return roots\n\ndef polyint(p, m=1, k=None):\n \"\"\"Return the mth analytical integral of the polynomial p.\n\n If k is None, then zero-valued constants of integration are used.\n otherwise, k should be a list of length m (or a scalar if m=1) to\n represent the constants of integration to use for each integration\n (starting with k[0])\n \"\"\"\n m = int(m)\n if m < 0:\n raise ValueError, \"Order of integral must be positive (see polyder)\"\n if k is None:\n k = NX.zeros(m, float)\n k = atleast_1d(k)\n if len(k) == 1 and m > 1:\n k = k[0]*NX.ones(m, float)\n if len(k) < m:\n raise ValueError, \\\n \"k must be a scalar or a rank-1 array of length 1 or >m.\"\n if m == 0:\n return p\n else:\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n y = NX.zeros(len(p)+1, float)\n y[:-1] = p*1.0/NX.arange(len(p), 0, -1)\n y[-1] = k[0]\n val = polyint(y, m-1, k=k[1:])\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyder(p, m=1):\n \"\"\"Return the mth derivative of the polynomial p.\n \"\"\"\n m = int(m)\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n n = len(p)-1\n y = p[:-1] * NX.arange(n, 0, -1)\n if m < 0:\n raise ValueError, \"Order of derivative must be positive (see polyint)\"\n if m == 0:\n return p\n else:\n val = polyder(y, m-1)\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyfit(x, y, N):\n \"\"\"\n\n Do a best fit polynomial of order N of y to x. Return value is a\n vector of polynomial coefficients [pk ... p1 p0]. Eg, for N=2\n\n p2*x0^2 + p1*x0 + p0 = y1\n p2*x1^2 + p1*x1 + p0 = y1\n p2*x2^2 + p1*x2 + p0 = y2\n .....\n p2*xk^2 + p1*xk + p0 = yk\n\n\n Method: if X is a the Vandermonde Matrix computed from x (see\n http://mathworld.wolfram.com/VandermondeMatrix.html), then the\n polynomial least squares solution is given by the 'p' in\n\n X*p = y\n\n where X is a len(x) x N+1 matrix, p is a N+1 length vector, and y\n is a len(x) x 1 vector\n\n This equation can be solved as\n\n p = (XT*X)^-1 * XT * y\n\n where XT is the transpose of X and -1 denotes the inverse.\n\n For more info, see\n http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html,\n but note that the k's and n's in the superscripts and subscripts\n on that page. The linear algebra is correct, however.\n\n See also polyval\n\n \"\"\"\n x = NX.asarray(x)+0.\n y = NX.asarray(y)+0.\n y = NX.reshape(y, (len(y), 1))\n X = vander(x, N+1)\n c, resids, rank, s = _lstsq(X, y)\n c.shape = (N+1,)\n return c\n\n\n\ndef polyval(p, x):\n \"\"\"Evaluate the polynomial p at x. If x is a polynomial then composition.\n\n Description:\n\n If p is of length N, this function returns the value:\n p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]\n\n x can be a sequence and p(x) will be returned for all elements of x.\n or x can be another polynomial and the composite polynomial p(x) will be\n returned.\n\n Notice: This can produce inaccurate results for polynomials with\n significant variability. Use carefully.\n \"\"\"\n p = NX.asarray(p)\n if isinstance(x, poly1d):\n y = 0\n else:\n x = NX.asarray(x)\n y = NX.zeros_like(x)\n for i in range(len(p)):\n y = x * y + p[i]\n return y\n\ndef polyadd(a1, a2):\n \"\"\"Adds two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 + a2\n elif diff > 0:\n zr = NX.zeros(diff, a1.dtype)\n val = NX.concatenate((zr, a1)) + a2\n else:\n zr = NX.zeros(abs(diff), a2.dtype)\n val = a1 + NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polysub(a1, a2):\n \"\"\"Subtracts two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 - a2\n elif diff > 0:\n zr = NX.zeros(diff, a1)\n val = NX.concatenate((zr, a1)) - a2\n else:\n zr = NX.zeros(abs(diff), a2)\n val = a1 - NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef polymul(a1, a2):\n \"\"\"Multiplies two polynomials represented as sequences.\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n val = NX.convolve(a1, a2)\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef deconvolve(signal, divisor):\n \"\"\"Deconvolves divisor out of signal. Requires numpy.signal library\n \"\"\"\n import scipy.signal\n num = atleast_1d(signal)\n den = atleast_1d(divisor)\n N = len(num)\n D = len(den)\n if D > N:\n quot = [];\n rem = num;\n else:\n input = NX.ones(N-D+1, float)\n input[1:] = 0\n quot = numpy.signal.lfilter(num, den, input)\n rem = num - NX.convolve(den, quot, mode='full')\n return quot, rem\n\ndef polydiv(u, v):\n \"\"\"Computes q and r polynomials so that u(s) = q(s)*v(s) + r(s)\n and deg r < deg v.\n \"\"\"\n truepoly = (isinstance(u, poly1d) or isinstance(u, poly1d))\n u = atleast_1d(u)\n v = atleast_1d(v)\n m = len(u) - 1\n n = len(v) - 1\n scale = 1. / v[0]\n q = NX.zeros((m-n+1,), float)\n r = u.copy()\n for k in range(0, m-n+1):\n d = scale * r[k]\n q[k] = d\n r[k:k+n+1] -= d*v\n while NX.allclose(r[0], 0, rtol=1e-14) and (r.shape[-1] > 1):\n r = r[1:]\n if truepoly:\n q = poly1d(q)\n r = poly1d(r)\n return q, r\n\n_poly_mat = re.compile(r\"[*][*]([0-9]*)\")\ndef _raise_power(astr, wrap=70):\n n = 0\n line1 = ''\n line2 = ''\n output = ' '\n while 1:\n mat = _poly_mat.search(astr, n)\n if mat is None:\n break\n span = mat.span()\n power = mat.groups()[0]\n partstr = astr[n:span[0]]\n n = span[1]\n toadd2 = partstr + ' '*(len(power)-1)\n toadd1 = ' '*(len(partstr)-1) + power\n if ((len(line2)+len(toadd2) > wrap) or \\\n (len(line1)+len(toadd1) > wrap)):\n output += line1 + \"\\n\" + line2 + \"\\n \"\n line1 = toadd1\n line2 = toadd2\n else:\n line2 += partstr + ' '*(len(power)-1)\n line1 += ' '*(len(partstr)-1) + power\n output += line1 + \"\\n\" + line2\n return output + astr[n:]\n\n\nclass poly1d(object):\n \"\"\"A one-dimensional polynomial class.\n\n p = poly1d([1,2,3]) constructs the polynomial x**2 + 2 x + 3\n\n p(0.5) evaluates the polynomial at the location\n p.r is a list of roots\n p.c is the coefficient array [1,2,3]\n p.order is the polynomial order (after leading zeros in p.c are removed)\n p[k] is the coefficient on the kth power of x (backwards from\n sequencing the coefficient array.\n\n polynomials can be added, substracted, multplied and divided (returns\n quotient and remainder).\n asarray(p) will also give the coefficient array, so polynomials can\n be used in all functions that accept arrays.\n\n p = poly1d([1,2,3], variable='lambda') will use lambda in the\n string representation of p.\n \"\"\"\n def __init__(self, c_or_r, r=0, variable=None):\n if isinstance(c_or_r, poly1d):\n for key in c_or_r.__dict__.keys():\n self.__dict__[key] = c_or_r.__dict__[key]\n if variable is not None:\n self.__dict__['variable'] = variable\n return\n if r:\n c_or_r = poly(c_or_r)\n c_or_r = atleast_1d(c_or_r)\n if len(c_or_r.shape) > 1:\n raise ValueError, \"Polynomial must be 1d only.\"\n c_or_r = trim_zeros(c_or_r, trim='f')\n if len(c_or_r) == 0:\n c_or_r = NX.array([0.])\n self.__dict__['coeffs'] = c_or_r\n self.__dict__['order'] = len(c_or_r) - 1\n if variable is None:\n variable = 'x'\n self.__dict__['variable'] = variable\n\n def __array__(self, t=None):\n if t:\n return NX.asarray(self.coeffs, t)\n else:\n return NX.asarray(self.coeffs)\n\n def __repr__(self):\n vals = repr(self.coeffs)\n vals = vals[6:-1]\n return \"poly1d(%s)\" % vals\n\n def __len__(self):\n return self.order\n\n def __str__(self):\n N = self.order\n thestr = \"0\"\n var = self.variable\n for k in range(len(self.coeffs)):\n coefstr ='%.4g' % abs(self.coeffs[k])\n if coefstr[-4:] == '0000':\n coefstr = coefstr[:-5]\n power = (N-k)\n if power == 0:\n if coefstr != '0':\n newstr = '%s' % (coefstr,)\n else:\n if k == 0:\n newstr = '0'\n else:\n newstr = ''\n elif power == 1:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = var\n else:\n newstr = '%s %s' % (coefstr, var)\n else:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = '%s**%d' % (var, power,)\n else:\n newstr = '%s %s**%d' % (coefstr, var, power)\n\n if k > 0:\n if newstr != '':\n if self.coeffs[k] < 0:\n thestr = \"%s - %s\" % (thestr, newstr)\n else:\n thestr = \"%s + %s\" % (thestr, newstr)\n elif (k == 0) and (newstr != '') and (self.coeffs[k] < 0):\n thestr = \"-%s\" % (newstr,)\n else:\n thestr = newstr\n return _raise_power(thestr)\n\n\n def __call__(self, val):\n return polyval(self.coeffs, val)\n\n def __mul__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs * other)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __rmul__(self, other):\n if isscalar(other):\n return poly1d(other * self.coeffs)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __add__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __radd__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __pow__(self, val):\n if not isscalar(val) or int(val) != val or val < 0:\n raise ValueError, \"Power to non-negative integers only.\"\n res = [1]\n for k in range(val):\n res = polymul(self.coeffs, res)\n return poly1d(res)\n\n def __sub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(self.coeffs, other.coeffs))\n\n def __rsub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(other.coeffs, self.coeffs))\n\n def __div__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs/other)\n else:\n other = poly1d(other)\n return polydiv(self, other)\n\n def __rdiv__(self, other):\n if isscalar(other):\n return poly1d(other/self.coeffs)\n else:\n other = poly1d(other)\n return polydiv(other, self)\n\n def __setattr__(self, key, val):\n raise ValueError, \"Attributes cannot be changed this way.\"\n\n def __getattr__(self, key):\n if key in ['r', 'roots']:\n return roots(self.coeffs)\n elif key in ['c','coef','coefficients']:\n return self.coeffs\n elif key in ['o']:\n return self.order\n else:\n return self.__dict__[key]\n\n def __getitem__(self, val):\n ind = self.order - val\n if val > self.order:\n return 0\n if val < 0:\n return 0\n return self.coeffs[ind]\n\n def __setitem__(self, key, val):\n ind = self.order - key\n if key < 0:\n raise ValueError, \"Does not support negative powers.\"\n if key > self.order:\n zr = NX.zeros(key-self.order, self.coeffs.dtype)\n self.__dict__['coeffs'] = NX.concatenate((zr, self.coeffs))\n self.__dict__['order'] = key\n ind = 0\n self.__dict__['coeffs'][ind] = val\n return\n\n def integ(self, m=1, k=0):\n \"\"\"Return the mth analytical integral of this polynomial.\n See the documentation for polyint.\n \"\"\"\n return poly1d(polyint(self.coeffs, m=m, k=k))\n\n def deriv(self, m=1):\n \"\"\"Return the mth derivative of this polynomial.\n \"\"\"\n return poly1d(polyder(self.coeffs, m=m))\n", + "source_code_before": "\"\"\"\nFunctions to operate on polynomials.\n\"\"\"\n\n__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',\n 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',\n 'polyfit']\n\nimport re\nimport numpy.core.numeric as NX\n\nfrom numpy.core import isscalar\nfrom twodim_base import diag, vander\nfrom shape_base import hstack, atleast_1d\nfrom function_base import trim_zeros, sort_complex\neigvals = None\nlstsq = None\n\ndef get_linalg_funcs():\n \"Look for linear algebra functions in numpy\"\n global eigvals, lstsq\n from numpy.linalg import eigvals, lstsq\n return\n\ndef _eigvals(arg):\n \"Return the eigenvalues of the argument\"\n try:\n return eigvals(arg)\n except TypeError:\n get_linalg_funcs()\n return eigvals(arg)\n\ndef _lstsq(X, y):\n \"Do least squares on the arguments\"\n try:\n return lstsq(X, y)\n except TypeError:\n get_linalg_funcs()\n return lstsq(X, y)\n\ndef poly(seq_of_zeros):\n \"\"\" Return a sequence representing a polynomial given a sequence of roots.\n\n If the input is a matrix, return the characteristic polynomial.\n\n Example:\n\n >>> b = roots([1,3,1,5,6])\n >>> poly(b)\n array([1., 3., 1., 5., 6.])\n \"\"\"\n seq_of_zeros = atleast_1d(seq_of_zeros)\n sh = seq_of_zeros.shape\n if len(sh) == 2 and sh[0] == sh[1]:\n seq_of_zeros = _eigvals(seq_of_zeros)\n elif len(sh) ==1:\n pass\n else:\n raise ValueError, \"input must be 1d or square 2d array.\"\n\n if len(seq_of_zeros) == 0:\n return 1.0\n\n a = [1]\n for k in range(len(seq_of_zeros)):\n a = NX.convolve(a, [1, -seq_of_zeros[k]], mode='full')\n\n if issubclass(a.dtype, NX.complexfloating):\n # if complex roots are all complex conjugates, the roots are real.\n roots = NX.asarray(seq_of_zeros, complex)\n pos_roots = sort_complex(NX.compress(roots.imag > 0, roots))\n neg_roots = NX.conjugate(sort_complex(\n NX.compress(roots.imag < 0,roots)))\n if (len(pos_roots) == len(neg_roots) and\n NX.alltrue(neg_roots == pos_roots)):\n a = a.real.copy()\n\n return a\n\ndef roots(p):\n \"\"\" Return the roots of the polynomial coefficients in p.\n\n The values in the rank-1 array p are coefficients of a polynomial.\n If the length of p is n+1 then the polynomial is\n p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]\n \"\"\"\n # If input is scalar, this makes it an array\n p = atleast_1d(p)\n if len(p.shape) != 1:\n raise ValueError,\"Input must be a rank-1 array.\"\n\n # find non-zero array entries\n non_zero = NX.nonzero(NX.ravel(p))\n\n # find the number of trailing zeros -- this is the number of roots at 0.\n trailing_zeros = len(p) - non_zero[-1] - 1\n\n # strip leading and trailing zeros\n p = p[int(non_zero[0]):int(non_zero[-1])+1]\n\n # casting: if incoming array isn't floating point, make it floating point.\n if not issubclass(p.dtype, (NX.floating, NX.complexfloating)):\n p = p.astype(float)\n\n N = len(p)\n if N > 1:\n # build companion matrix and find its eigenvalues (the roots)\n A = diag(NX.ones((N-2,), p.dtype), -1)\n A[0, :] = -p[1:] / p[0]\n roots = _eigvals(A)\n else:\n return NX.array([])\n\n # tack any zeros onto the back of the array\n roots = hstack((roots, NX.zeros(trailing_zeros, roots.dtype)))\n return roots\n\ndef polyint(p, m=1, k=None):\n \"\"\"Return the mth analytical integral of the polynomial p.\n\n If k is None, then zero-valued constants of integration are used.\n otherwise, k should be a list of length m (or a scalar if m=1) to\n represent the constants of integration to use for each integration\n (starting with k[0])\n \"\"\"\n m = int(m)\n if m < 0:\n raise ValueError, \"Order of integral must be positive (see polyder)\"\n if k is None:\n k = NX.zeros(m, float)\n k = atleast_1d(k)\n if len(k) == 1 and m > 1:\n k = k[0]*NX.ones(m, float)\n if len(k) < m:\n raise ValueError, \\\n \"k must be a scalar or a rank-1 array of length 1 or >m.\"\n if m == 0:\n return p\n else:\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n y = NX.zeros(len(p)+1, float)\n y[:-1] = p*1.0/NX.arange(len(p), 0, -1)\n y[-1] = k[0]\n val = polyint(y, m-1, k=k[1:])\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyder(p, m=1):\n \"\"\"Return the mth derivative of the polynomial p.\n \"\"\"\n m = int(m)\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n n = len(p)-1\n y = p[:-1] * NX.arange(n, 0, -1)\n if m < 0:\n raise ValueError, \"Order of derivative must be positive (see polyint)\"\n if m == 0:\n return p\n else:\n val = polyder(y, m-1)\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyfit(x, y, N):\n \"\"\"\n\n Do a best fit polynomial of order N of y to x. Return value is a\n vector of polynomial coefficients [pk ... p1 p0]. Eg, for N=2\n\n p2*x0^2 + p1*x0 + p0 = y1\n p2*x1^2 + p1*x1 + p0 = y1\n p2*x2^2 + p1*x2 + p0 = y2\n .....\n p2*xk^2 + p1*xk + p0 = yk\n\n\n Method: if X is a the Vandermonde Matrix computed from x (see\n http://mathworld.wolfram.com/VandermondeMatrix.html), then the\n polynomial least squares solution is given by the 'p' in\n\n X*p = y\n\n where X is a len(x) x N+1 matrix, p is a N+1 length vector, and y\n is a len(x) x 1 vector\n\n This equation can be solved as\n\n p = (XT*X)^-1 * XT * y\n\n where XT is the transpose of X and -1 denotes the inverse.\n\n For more info, see\n http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html,\n but note that the k's and n's in the superscripts and subscripts\n on that page. The linear algebra is correct, however.\n\n See also polyval\n\n \"\"\"\n x = NX.asarray(x)+0.\n y = NX.asarray(y)+0.\n y = NX.reshape(y, (len(y), 1))\n X = vander(x, N+1)\n c, resids, rank, s = _lstsq(X, y)\n c.shape = (N+1,)\n return c\n\n\n\ndef polyval(p, x):\n \"\"\"Evaluate the polynomial p at x. If x is a polynomial then composition.\n\n Description:\n\n If p is of length N, this function returns the value:\n p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]\n\n x can be a sequence and p(x) will be returned for all elements of x.\n or x can be another polynomial and the composite polynomial p(x) will be\n returned.\n\n Notice: This can produce inaccurate results for polynomials with\n significant variability. Use carefully.\n \"\"\"\n p = NX.asarray(p)\n if isinstance(x, poly1d):\n y = 0\n else:\n x = NX.asarray(x)\n y = NX.zeros_like(x)\n for i in range(len(p)):\n y = x * y + p[i]\n return y\n\ndef polyadd(a1, a2):\n \"\"\"Adds two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 + a2\n elif diff > 0:\n zr = NX.zeros(diff, a1.dtype)\n val = NX.concatenate((zr, a1)) + a2\n else:\n zr = NX.zeros(abs(diff), a2.dtype)\n val = a1 + NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polysub(a1, a2):\n \"\"\"Subtracts two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 - a2\n elif diff > 0:\n zr = NX.zeros(diff, a1)\n val = NX.concatenate((zr, a1)) - a2\n else:\n zr = NX.zeros(abs(diff), a2)\n val = a1 - NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef polymul(a1, a2):\n \"\"\"Multiplies two polynomials represented as sequences.\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n val = NX.convolve(a1, a2)\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef deconvolve(signal, divisor):\n \"\"\"Deconvolves divisor out of signal. Requires numpy.signal library\n \"\"\"\n import scipy.signal\n num = atleast_1d(signal)\n den = atleast_1d(divisor)\n N = len(num)\n D = len(den)\n if D > N:\n quot = [];\n rem = num;\n else:\n input = NX.ones(N-D+1, float)\n input[1:] = 0\n quot = numpy.signal.lfilter(num, den, input)\n rem = num - NX.convolve(den, quot, mode='full')\n return quot, rem\n\ndef polydiv(u, v):\n \"\"\"Computes q and r polynomials so that u(s) = q(s)*v(s) + r(s)\n and deg r < deg v.\n \"\"\"\n truepoly = (isinstance(u, poly1d) or isinstance(u, poly1d))\n u = atleast_1d(u)\n v = atleast_1d(v)\n m = len(u) - 1\n n = len(v) - 1\n scale = 1. / v[0]\n q = NX.zeros((m-n+1,), float)\n r = u.copy()\n for k in range(0, m-n+1):\n d = scale * r[k]\n q[k] = d\n r[k:k+n+1] -= d*v\n while NX.allclose(r[0], 0, rtol=1e-14) and (r.shape[-1] > 1):\n r = r[1:]\n if truepoly:\n q = poly1d(q)\n r = poly1d(r)\n return q, r\n\n_poly_mat = re.compile(r\"[*][*]([0-9]*)\")\ndef _raise_power(astr, wrap=70):\n n = 0\n line1 = ''\n line2 = ''\n output = ' '\n while 1:\n mat = _poly_mat.search(astr, n)\n if mat is None:\n break\n span = mat.span()\n power = mat.groups()[0]\n partstr = astr[n:span[0]]\n n = span[1]\n toadd2 = partstr + ' '*(len(power)-1)\n toadd1 = ' '*(len(partstr)-1) + power\n if ((len(line2)+len(toadd2) > wrap) or \\\n (len(line1)+len(toadd1) > wrap)):\n output += line1 + \"\\n\" + line2 + \"\\n \"\n line1 = toadd1\n line2 = toadd2\n else:\n line2 += partstr + ' '*(len(power)-1)\n line1 += ' '*(len(partstr)-1) + power\n output += line1 + \"\\n\" + line2\n return output + astr[n:]\n\n\nclass poly1d(object):\n \"\"\"A one-dimensional polynomial class.\n\n p = poly1d([1,2,3]) constructs the polynomial x**2 + 2 x + 3\n\n p(0.5) evaluates the polynomial at the location\n p.r is a list of roots\n p.c is the coefficient array [1,2,3]\n p.order is the polynomial order (after leading zeros in p.c are removed)\n p[k] is the coefficient on the kth power of x (backwards from\n sequencing the coefficient array.\n\n polynomials can be added, substracted, multplied and divided (returns\n quotient and remainder).\n asarray(p) will also give the coefficient array, so polynomials can\n be used in all functions that accept arrays.\n\n p = poly1d([1,2,3], variable='lambda') will use lambda in the\n string representation of p.\n \"\"\"\n def __init__(self, c_or_r, r=0, variable=None):\n if isinstance(c_or_r, poly1d):\n for key in c_or_r.__dict__.keys():\n self.__dict__[key] = c_or_r.__dict__[key]\n if variable is not None:\n self.__dict__['variable'] = variable\n return\n if r:\n c_or_r = poly(c_or_r)\n c_or_r = atleast_1d(c_or_r)\n if len(c_or_r.shape) > 1:\n raise ValueError, \"Polynomial must be 1d only.\"\n c_or_r = trim_zeros(c_or_r, trim='f')\n if len(c_or_r) == 0:\n c_or_r = NX.array([0.])\n self.__dict__['coeffs'] = c_or_r\n self.__dict__['order'] = len(c_or_r) - 1\n if variable is None:\n variable = 'x'\n self.__dict__['variable'] = variable\n\n def __array__(self, t=None):\n if t:\n return NX.asarray(self.coeffs, t)\n else:\n return NX.asarray(self.coeffs)\n\n def __repr__(self):\n vals = repr(self.coeffs)\n vals = vals[6:-1]\n return \"poly1d(%s)\" % vals\n\n def __len__(self):\n return self.order\n\n def __str__(self):\n N = self.order\n thestr = \"0\"\n var = self.variable\n for k in range(len(self.coeffs)):\n coefstr ='%.4g' % abs(self.coeffs[k])\n if coefstr[-4:] == '0000':\n coefstr = coefstr[:-5]\n power = (N-k)\n if power == 0:\n if coefstr != '0':\n newstr = '%s' % (coefstr,)\n else:\n if k == 0:\n newstr = '0'\n else:\n newstr = ''\n elif power == 1:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = var\n else:\n newstr = '%s %s' % (coefstr, var)\n else:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = '%s**%d' % (var, power,)\n else:\n newstr = '%s %s**%d' % (coefstr, var, power)\n\n if k > 0:\n if newstr != '':\n if self.coeffs[k] < 0:\n thestr = \"%s - %s\" % (thestr, newstr)\n else:\n thestr = \"%s + %s\" % (thestr, newstr)\n elif (k == 0) and (newstr != '') and (self.coeffs[k] < 0):\n thestr = \"-%s\" % (newstr,)\n else:\n thestr = newstr\n return _raise_power(thestr)\n\n\n def __call__(self, val):\n return polyval(self.coeffs, val)\n\n def __mul__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs * other)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __rmul__(self, other):\n if isscalar(other):\n return poly1d(other * self.coeffs)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __add__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __radd__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __pow__(self, val):\n if not isscalar(val) or int(val) != val or val < 0:\n raise ValueError, \"Power to non-negative integers only.\"\n res = [1]\n for k in range(val):\n res = polymul(self.coeffs, res)\n return poly1d(res)\n\n def __sub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(self.coeffs, other.coeffs))\n\n def __rsub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(other.coeffs, self.coeffs))\n\n def __div__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs/other)\n else:\n other = poly1d(other)\n return polydiv(self, other)\n\n def __rdiv__(self, other):\n if isscalar(other):\n return poly1d(other/self.coeffs)\n else:\n other = poly1d(other)\n return polydiv(other, self)\n\n def __setattr__(self, key, val):\n raise ValueError, \"Attributes cannot be changed this way.\"\n\n def __getattr__(self, key):\n if key in ['r', 'roots']:\n return roots(self.coeffs)\n elif key in ['c','coef','coefficients']:\n return self.coeffs\n elif key in ['o']:\n return self.order\n else:\n return self.__dict__[key]\n\n def __getitem__(self, val):\n ind = self.order - val\n if val > self.order:\n return 0\n if val < 0:\n return 0\n return self.coeffs[ind]\n\n def __setitem__(self, key, val):\n ind = self.order - key\n if key < 0:\n raise ValueError, \"Does not support negative powers.\"\n if key > self.order:\n zr = NX.zeros(key-self.order, self.coeffs.dtype)\n self.__dict__['coeffs'] = NX.concatenate((zr, self.coeffs))\n self.__dict__['order'] = key\n ind = 0\n self.__dict__['coeffs'][ind] = val\n return\n\n def integ(self, m=1, k=0):\n \"\"\"Return the mth analytical integral of this polynomial.\n See the documentation for polyint.\n \"\"\"\n return poly1d(polyint(self.coeffs, m=m, k=k))\n\n def deriv(self, m=1):\n \"\"\"Return the mth derivative of this polynomial.\n \"\"\"\n return poly1d(polyder(self.coeffs, m=m))\n", + "methods": [ + { + "name": "get_linalg_funcs", + "long_name": "get_linalg_funcs( )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [], + "start_line": 19, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_eigvals", + "long_name": "_eigvals( arg )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 24, + "parameters": [ + "arg" + ], + "start_line": 25, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_lstsq", + "long_name": "_lstsq( X , y )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 30, + "parameters": [ + "X", + "y" + ], + "start_line": 33, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "poly", + "long_name": "poly( seq_of_zeros )", + "filename": "polynomial.py", + "nloc": 23, + "complexity": 9, + "token_count": 200, + "parameters": [ + "seq_of_zeros" + ], + "start_line": 41, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "roots", + "long_name": "roots( p )", + "filename": "polynomial.py", + "nloc": 18, + "complexity": 4, + "token_count": 192, + "parameters": [ + "p" + ], + "start_line": 80, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "polyint", + "long_name": "polyint( p , m = 1 , k = None )", + "filename": "polynomial.py", + "nloc": 24, + "complexity": 8, + "token_count": 196, + "parameters": [ + "p", + "m", + "k" + ], + "start_line": 118, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "polyder", + "long_name": "polyder( p , m = 1 )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 4, + "token_count": 99, + "parameters": [ + "p", + "m" + ], + "start_line": 150, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polyfit", + "long_name": "polyfit( x , y , N )", + "filename": "polynomial.py", + "nloc": 8, + "complexity": 1, + "token_count": 85, + "parameters": [ + "x", + "y", + "N" + ], + "start_line": 168, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "polyval", + "long_name": "polyval( p , x )", + "filename": "polynomial.py", + "nloc": 10, + "complexity": 3, + "token_count": 68, + "parameters": [ + "p", + "x" + ], + "start_line": 214, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "polyadd", + "long_name": "polyadd( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 130, + "parameters": [ + "a1", + "a2" + ], + "start_line": 239, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polysub", + "long_name": "polysub( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 126, + "parameters": [ + "a1", + "a2" + ], + "start_line": 258, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polymul", + "long_name": "polymul( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 3, + "token_count": 46, + "parameters": [ + "a1", + "a2" + ], + "start_line": 278, + "end_line": 285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "deconvolve", + "long_name": "deconvolve( signal , divisor )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 2, + "token_count": 107, + "parameters": [ + "signal", + "divisor" + ], + "start_line": 288, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polydiv", + "long_name": "polydiv( u , v )", + "filename": "polynomial.py", + "nloc": 19, + "complexity": 6, + "token_count": 185, + "parameters": [ + "u", + "v" + ], + "start_line": 306, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_raise_power", + "long_name": "_raise_power( astr , wrap = 70 )", + "filename": "polynomial.py", + "nloc": 25, + "complexity": 5, + "token_count": 194, + "parameters": [ + "astr", + "wrap" + ], + "start_line": 330, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , c_or_r , r = 0 , variable = None )", + "filename": "polynomial.py", + "nloc": 20, + "complexity": 8, + "token_count": 157, + "parameters": [ + "self", + "c_or_r", + "r", + "variable" + ], + "start_line": 377, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "t" + ], + "start_line": 398, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "polynomial.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 404, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self" + ], + "start_line": 409, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "polynomial.py", + "nloc": 42, + "complexity": 17, + "token_count": 254, + "parameters": [ + "self" + ], + "start_line": 412, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "val" + ], + "start_line": 457, + "end_line": 458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 460, + "end_line": 465, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 467, + "end_line": 472, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 474, + "end_line": 476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__radd__", + "long_name": "__radd__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 478, + "end_line": 480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 5, + "token_count": 57, + "parameters": [ + "self", + "val" + ], + "start_line": 482, + "end_line": 488, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 490, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 494, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 498, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 505, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__setattr__", + "long_name": "__setattr__( self , key , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 512, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , key )", + "filename": "polynomial.py", + "nloc": 9, + "complexity": 4, + "token_count": 58, + "parameters": [ + "self", + "key" + ], + "start_line": 515, + "end_line": 523, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 3, + "token_count": 37, + "parameters": [ + "self", + "val" + ], + "start_line": 525, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , key , val )", + "filename": "polynomial.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 533, + "end_line": 543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "integ", + "long_name": "integ( self , m = 1 , k = 0 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "m", + "k" + ], + "start_line": 545, + "end_line": 549, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "deriv", + "long_name": "deriv( self , m = 1 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "m" + ], + "start_line": 551, + "end_line": 554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "get_linalg_funcs", + "long_name": "get_linalg_funcs( )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [], + "start_line": 19, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_eigvals", + "long_name": "_eigvals( arg )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 24, + "parameters": [ + "arg" + ], + "start_line": 25, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_lstsq", + "long_name": "_lstsq( X , y )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 30, + "parameters": [ + "X", + "y" + ], + "start_line": 33, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "poly", + "long_name": "poly( seq_of_zeros )", + "filename": "polynomial.py", + "nloc": 23, + "complexity": 9, + "token_count": 200, + "parameters": [ + "seq_of_zeros" + ], + "start_line": 41, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "roots", + "long_name": "roots( p )", + "filename": "polynomial.py", + "nloc": 18, + "complexity": 4, + "token_count": 192, + "parameters": [ + "p" + ], + "start_line": 80, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "polyint", + "long_name": "polyint( p , m = 1 , k = None )", + "filename": "polynomial.py", + "nloc": 24, + "complexity": 8, + "token_count": 196, + "parameters": [ + "p", + "m", + "k" + ], + "start_line": 118, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "polyder", + "long_name": "polyder( p , m = 1 )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 4, + "token_count": 99, + "parameters": [ + "p", + "m" + ], + "start_line": 150, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polyfit", + "long_name": "polyfit( x , y , N )", + "filename": "polynomial.py", + "nloc": 8, + "complexity": 1, + "token_count": 85, + "parameters": [ + "x", + "y", + "N" + ], + "start_line": 168, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "polyval", + "long_name": "polyval( p , x )", + "filename": "polynomial.py", + "nloc": 10, + "complexity": 3, + "token_count": 68, + "parameters": [ + "p", + "x" + ], + "start_line": 214, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "polyadd", + "long_name": "polyadd( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 130, + "parameters": [ + "a1", + "a2" + ], + "start_line": 239, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polysub", + "long_name": "polysub( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 126, + "parameters": [ + "a1", + "a2" + ], + "start_line": 258, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polymul", + "long_name": "polymul( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 3, + "token_count": 46, + "parameters": [ + "a1", + "a2" + ], + "start_line": 278, + "end_line": 285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "deconvolve", + "long_name": "deconvolve( signal , divisor )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 2, + "token_count": 107, + "parameters": [ + "signal", + "divisor" + ], + "start_line": 288, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polydiv", + "long_name": "polydiv( u , v )", + "filename": "polynomial.py", + "nloc": 19, + "complexity": 6, + "token_count": 185, + "parameters": [ + "u", + "v" + ], + "start_line": 306, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_raise_power", + "long_name": "_raise_power( astr , wrap = 70 )", + "filename": "polynomial.py", + "nloc": 25, + "complexity": 5, + "token_count": 194, + "parameters": [ + "astr", + "wrap" + ], + "start_line": 330, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , c_or_r , r = 0 , variable = None )", + "filename": "polynomial.py", + "nloc": 20, + "complexity": 8, + "token_count": 157, + "parameters": [ + "self", + "c_or_r", + "r", + "variable" + ], + "start_line": 377, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "t" + ], + "start_line": 398, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "polynomial.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 404, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self" + ], + "start_line": 409, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "polynomial.py", + "nloc": 42, + "complexity": 17, + "token_count": 254, + "parameters": [ + "self" + ], + "start_line": 412, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "val" + ], + "start_line": 457, + "end_line": 458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 460, + "end_line": 465, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 467, + "end_line": 472, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 474, + "end_line": 476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__radd__", + "long_name": "__radd__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 478, + "end_line": 480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 5, + "token_count": 57, + "parameters": [ + "self", + "val" + ], + "start_line": 482, + "end_line": 488, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 490, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 494, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 498, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 505, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__setattr__", + "long_name": "__setattr__( self , key , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 512, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , key )", + "filename": "polynomial.py", + "nloc": 9, + "complexity": 4, + "token_count": 58, + "parameters": [ + "self", + "key" + ], + "start_line": 515, + "end_line": 523, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 3, + "token_count": 37, + "parameters": [ + "self", + "val" + ], + "start_line": 525, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , key , val )", + "filename": "polynomial.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 533, + "end_line": 543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "integ", + "long_name": "integ( self , m = 1 , k = 0 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "m", + "k" + ], + "start_line": 545, + "end_line": 549, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "deriv", + "long_name": "deriv( self , m = 1 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "m" + ], + "start_line": 551, + "end_line": 554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "get_linalg_funcs", + "long_name": "get_linalg_funcs( )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [], + "start_line": 19, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "nloc": 400, + "complexity": 120, + "token_count": 2897, + "diff_parsed": { + "added": [ + " from numpy.dual import eigvals, lstsq" + ], + "deleted": [ + " from numpy.linalg import eigvals, lstsq" + ] + } + }, + { + "old_path": "numpy/random/mtrand/mtrand.c", + "new_path": "numpy/random/mtrand/mtrand.c", + "filename": "mtrand.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -1,4 +1,4 @@\n-/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */\n+/* Generated by Pyrex 0.9.3.1 on Thu Jan 5 00:40:10 2006 */\n \n #include \"Python.h\"\n #include \"structmember.h\"\n@@ -3942,7 +3942,7 @@ static PyObject *__pyx_k115p;\n static char (__pyx_k112[]) = \"mean must be 1 dimensional\";\n static char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\n static char (__pyx_k114[]) = \"mean and cov must have same length\";\n-static char (__pyx_k115[]) = \"numpy.linalg\";\n+static char (__pyx_k115[]) = \"numpy.dual\";\n \n static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\n static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "/* Generated by Pyrex 0.9.3.1 on Thu Jan 5 00:40:10 2006 */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n#ifndef PY_LONG_LONG\n #define PY_LONG_LONG LONG_LONG\n#endif\n#include \"string.h\"\n#include \"math.h\"\n#include \"numpy/arrayobject.h\"\n#include \"randomkit.h\"\n#include \"distributions.h\"\n#include \"initarray.h\"\n\n\ntypedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\ntypedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\nstatic PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\nstatic int __Pyx_EndUnpack(PyObject *, int); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\nstatic void __Pyx_WriteUnraisable(char *name); /*proto*/\nstatic void __Pyx_AddTraceback(char *funcname); /*proto*/\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n\nstatic PyObject *__pyx_m;\nstatic PyObject *__pyx_b;\nstatic int __pyx_lineno;\nstatic char *__pyx_filename;\nstaticforward char **__pyx_f;\n\n/* Declarations from mtrand */\n\nstaticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n\nstruct __pyx_obj_6mtrand_RandomState {\n PyObject_HEAD\n rk_state (*internal_state);\n};\n\nstatic PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\nstatic PyObject *__pyx_k2;\nstatic PyObject *__pyx_k3;\nstatic PyObject *__pyx_k4;\nstatic PyObject *__pyx_k5;\nstatic PyObject *__pyx_k6;\nstatic PyObject *__pyx_k7;\nstatic double __pyx_k8;\nstatic double __pyx_k9;\nstatic PyObject *__pyx_k10;\nstatic PyObject *__pyx_k11;\nstatic PyObject *__pyx_k12;\nstatic PyObject *__pyx_k13;\nstatic double __pyx_k14;\nstatic double __pyx_k15;\nstatic PyObject *__pyx_k16;\nstatic PyObject *__pyx_k17;\nstatic double __pyx_k18;\nstatic PyObject *__pyx_k19;\nstatic PyObject *__pyx_k20;\nstatic PyObject *__pyx_k21;\nstatic double __pyx_k22;\nstatic PyObject *__pyx_k23;\nstatic PyObject *__pyx_k24;\nstatic PyObject *__pyx_k25;\nstatic PyObject *__pyx_k26;\nstatic PyObject *__pyx_k27;\nstatic PyObject *__pyx_k28;\nstatic PyObject *__pyx_k29;\nstatic PyObject *__pyx_k30;\nstatic PyObject *__pyx_k31;\nstatic PyObject *__pyx_k32;\nstatic PyObject *__pyx_k33;\nstatic double __pyx_k34;\nstatic double __pyx_k35;\nstatic PyObject *__pyx_k36;\nstatic double __pyx_k37;\nstatic double __pyx_k38;\nstatic PyObject *__pyx_k39;\nstatic double __pyx_k40;\nstatic double __pyx_k41;\nstatic PyObject *__pyx_k42;\nstatic double __pyx_k43;\nstatic double __pyx_k44;\nstatic PyObject *__pyx_k45;\nstatic double __pyx_k46;\nstatic PyObject *__pyx_k47;\nstatic PyObject *__pyx_k48;\nstatic PyObject *__pyx_k49;\nstatic PyObject *__pyx_k50;\nstatic PyObject *__pyx_k51;\nstatic double __pyx_k52;\nstatic PyObject *__pyx_k53;\nstatic PyObject *__pyx_k54;\nstatic PyObject *__pyx_k55;\nstatic PyObject *__pyx_k56;\nstatic PyObject *__pyx_k57;\nstatic PyObject *__pyx_k58;\nstatic PyObject *__pyx_k59;\nstatic PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n\n/* Implementation of mtrand */\n\n\nstatic PyObject *__pyx_n__sp;\nstatic PyObject *__pyx_n__rand;\nstatic PyObject *__pyx_n_seed;\nstatic PyObject *__pyx_n_get_state;\nstatic PyObject *__pyx_n_set_state;\nstatic PyObject *__pyx_n_random_sample;\nstatic PyObject *__pyx_n_randint;\nstatic PyObject *__pyx_n_bytes;\nstatic PyObject *__pyx_n_uniform;\nstatic PyObject *__pyx_n_rand;\nstatic PyObject *__pyx_n_randn;\nstatic PyObject *__pyx_n_random_integers;\nstatic PyObject *__pyx_n_standard_normal;\nstatic PyObject *__pyx_n_normal;\nstatic PyObject *__pyx_n_beta;\nstatic PyObject *__pyx_n_exponential;\nstatic PyObject *__pyx_n_standard_exponential;\nstatic PyObject *__pyx_n_standard_gamma;\nstatic PyObject *__pyx_n_gamma;\nstatic PyObject *__pyx_n_f;\nstatic PyObject *__pyx_n_noncentral_f;\nstatic PyObject *__pyx_n_chisquare;\nstatic PyObject *__pyx_n_noncentral_chisquare;\nstatic PyObject *__pyx_n_standard_cauchy;\nstatic PyObject *__pyx_n_standard_t;\nstatic PyObject *__pyx_n_vonmises;\nstatic PyObject *__pyx_n_pareto;\nstatic PyObject *__pyx_n_weibull;\nstatic PyObject *__pyx_n_power;\nstatic PyObject *__pyx_n_laplace;\nstatic PyObject *__pyx_n_gumbel;\nstatic PyObject *__pyx_n_logistic;\nstatic PyObject *__pyx_n_lognormal;\nstatic PyObject *__pyx_n_rayleigh;\nstatic PyObject *__pyx_n_wald;\nstatic PyObject *__pyx_n_triangular;\nstatic PyObject *__pyx_n_binomial;\nstatic PyObject *__pyx_n_negative_binomial;\nstatic PyObject *__pyx_n_poisson;\nstatic PyObject *__pyx_n_zipf;\nstatic PyObject *__pyx_n_geometric;\nstatic PyObject *__pyx_n_hypergeometric;\nstatic PyObject *__pyx_n_logseries;\nstatic PyObject *__pyx_n_multivariate_normal;\nstatic PyObject *__pyx_n_multinomial;\nstatic PyObject *__pyx_n_shuffle;\nstatic PyObject *__pyx_n_permutation;\nstatic PyObject *__pyx_n_numpy;\n\nstatic PyObject *__pyx_n_empty;\nstatic PyObject *__pyx_n_Float64;\n\nstatic PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont1_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont2_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont3_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_Int;\n\nstatic PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.disc0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnp_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discd_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n double __pyx_v_c;\n double __pyx_v_y;\n double __pyx_v_t;\n double __pyx_v_sum;\n long __pyx_v_i;\n double __pyx_r;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n __pyx_v_sum = (__pyx_v_darr[0]);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n __pyx_v_c = 0.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n __pyx_v_sum = __pyx_v_t;\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n __pyx_r = __pyx_v_sum;\n goto __pyx_L0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n __pyx_L0:;\n return __pyx_r;\n}\n\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n int __pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k2;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n __pyx_r = -1;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n int __pyx_1;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n goto __pyx_L0;\n __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n}\n\nstatic PyObject *__pyx_n_type;\nstatic PyObject *__pyx_n_int;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n rk_error __pyx_v_errcode;\n PyArrayObject *arrayObject_obj;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n unsigned long __pyx_5;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k3;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n __pyx_1 = __pyx_v_seed == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_1 = __pyx_4 == __pyx_2;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_3));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_3);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_MT19937;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyArrayObject *arrayObject_state;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_1 = 0;\n __pyx_4 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_state));\n arrayObject_state = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n Py_INCREF(__pyx_n_MT19937);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n Py_INCREF(((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n __pyx_4 = 0;\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_state);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_ValueError;\n\nstatic PyObject *__pyx_k62p;\nstatic PyObject *__pyx_k63p;\n\nstatic char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\nstatic char (__pyx_k63[]) = \"state must be 624 longs\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyArrayObject *arrayObject_obj;\n int __pyx_v_pos;\n PyObject *__pyx_v_algorithm_name;\n PyObject *__pyx_v_key;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n int __pyx_3;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_algorithm_name);\n __pyx_v_algorithm_name = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n __pyx_3 = __pyx_3 != 0;\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_INCREF(__pyx_k62p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_v_key);\n __pyx_v_key = __pyx_2;\n __pyx_2 = 0;\n __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_v_pos = __pyx_3;\n if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_INCREF(__pyx_k63p);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_algorithm_name);\n Py_DECREF(__pyx_v_key);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_INCREF(__pyx_v_state);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_random;\nstatic PyObject *__pyx_n___RandomState_ctor;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n __pyx_1 = 0;\n __pyx_2 = 0;\n __pyx_5 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k4;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k5;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k64p;\n\nstatic char (__pyx_k64[]) = \"low >= high\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_lo;\n long __pyx_v_hi;\n long __pyx_v_diff;\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n long __pyx_2;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k6;\n __pyx_v_size = __pyx_k7;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n __pyx_v_lo = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n __pyx_v_lo = __pyx_2;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n __pyx_1 = (__pyx_v_diff < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_INCREF(__pyx_k64p);\n PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __Pyx_Raise(__pyx_5, 0, 0);\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n goto __pyx_L4;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L4:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n unsigned int __pyx_v_length;\n void (*__pyx_v_bytes);\n PyObject *__pyx_v_bytestring;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"length\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n Py_INCREF(__pyx_v_self);\n __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n Py_DECREF(__pyx_v_bytestring);\n __pyx_v_bytestring = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n PyMem_Free(__pyx_v_bytes);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n Py_INCREF(__pyx_v_bytestring);\n __pyx_r = __pyx_v_bytestring;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_bytestring);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_low;\n double __pyx_v_high;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_low = __pyx_k8;\n __pyx_v_high = __pyx_k9;\n __pyx_v_size = __pyx_k10;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_len;\nstatic PyObject *__pyx_n_size;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_r = __pyx_5;\n __pyx_5 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k11;\n __pyx_v_size = __pyx_k12;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n Py_INCREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n __pyx_v_high = __pyx_v_low;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n Py_DECREF(__pyx_v_low);\n __pyx_v_low = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_INCREF(__pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_4;\n __pyx_4 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k13;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k66p;\n\nstatic char (__pyx_k66[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k14;\n __pyx_v_scale = __pyx_k15;\n __pyx_v_size = __pyx_k16;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_INCREF(__pyx_k66p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k67p;\nstatic PyObject *__pyx_k68p;\n\nstatic char (__pyx_k67[]) = \"a <= 0\";\nstatic char (__pyx_k68[]) = \"b <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n double __pyx_v_b;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n __pyx_v_size = __pyx_k17;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_INCREF(__pyx_k67p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_b <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_INCREF(__pyx_k68p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k69p;\n\nstatic char (__pyx_k69[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k18;\n __pyx_v_size = __pyx_k19;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_INCREF(__pyx_k69p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k20;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k70p;\n\nstatic char (__pyx_k70[]) = \"shape <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n __pyx_v_size = __pyx_k21;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_INCREF(__pyx_k70p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k71p;\nstatic PyObject *__pyx_k72p;\n\nstatic char (__pyx_k71[]) = \"shape <= 0\";\nstatic char (__pyx_k72[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k22;\n __pyx_v_size = __pyx_k23;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_INCREF(__pyx_k71p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_INCREF(__pyx_k72p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k73p;\nstatic PyObject *__pyx_k74p;\n\nstatic char (__pyx_k73[]) = \"dfnum <= 0\";\nstatic char (__pyx_k74[]) = \"dfden <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n __pyx_v_size = __pyx_k24;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n __pyx_1 = (__pyx_v_dfnum <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_INCREF(__pyx_k73p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_INCREF(__pyx_k74p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k75p;\nstatic PyObject *__pyx_k76p;\nstatic PyObject *__pyx_k77p;\n\nstatic char (__pyx_k75[]) = \"dfnum <= 1\";\nstatic char (__pyx_k76[]) = \"dfden <= 0\";\nstatic char (__pyx_k77[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k25;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n __pyx_1 = (__pyx_v_dfnum <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_INCREF(__pyx_k75p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_INCREF(__pyx_k76p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_INCREF(__pyx_k77p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k78p;\n\nstatic char (__pyx_k78[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k26;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_INCREF(__pyx_k78p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k79p;\nstatic PyObject *__pyx_k80p;\n\nstatic char (__pyx_k79[]) = \"df <= 1\";\nstatic char (__pyx_k80[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k27;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n __pyx_1 = (__pyx_v_df <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_INCREF(__pyx_k79p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_INCREF(__pyx_k80p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k28;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k81p;\n\nstatic char (__pyx_k81[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k29;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_INCREF(__pyx_k81p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k82p;\n\nstatic char (__pyx_k82[]) = \"kappa < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mu;\n double __pyx_v_kappa;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n __pyx_v_size = __pyx_k30;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n __pyx_1 = (__pyx_v_kappa < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_INCREF(__pyx_k82p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k83p;\n\nstatic char (__pyx_k83[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k31;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_INCREF(__pyx_k83p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k84p;\n\nstatic char (__pyx_k84[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k32;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_INCREF(__pyx_k84p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k85p;\n\nstatic char (__pyx_k85[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k33;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_INCREF(__pyx_k85p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k86p;\n\nstatic char (__pyx_k86[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k34;\n __pyx_v_scale = __pyx_k35;\n __pyx_v_size = __pyx_k36;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_INCREF(__pyx_k86p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k87p;\n\nstatic char (__pyx_k87[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k37;\n __pyx_v_scale = __pyx_k38;\n __pyx_v_size = __pyx_k39;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_INCREF(__pyx_k87p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k88p;\n\nstatic char (__pyx_k88[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k40;\n __pyx_v_scale = __pyx_k41;\n __pyx_v_size = __pyx_k42;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_INCREF(__pyx_k88p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k89p;\n\nstatic char (__pyx_k89[]) = \"sigma <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_sigma;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n __pyx_v_mean = __pyx_k43;\n __pyx_v_sigma = __pyx_k44;\n __pyx_v_size = __pyx_k45;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n __pyx_1 = (__pyx_v_sigma <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_INCREF(__pyx_k89p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k90p;\n\nstatic char (__pyx_k90[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k46;\n __pyx_v_size = __pyx_k47;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_INCREF(__pyx_k90p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k91p;\nstatic PyObject *__pyx_k92p;\n\nstatic char (__pyx_k91[]) = \"mean <= 0.0\";\nstatic char (__pyx_k92[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n __pyx_v_size = __pyx_k48;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n __pyx_1 = (__pyx_v_mean <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_INCREF(__pyx_k91p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_INCREF(__pyx_k92p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k93p;\nstatic PyObject *__pyx_k94p;\nstatic PyObject *__pyx_k95p;\n\nstatic char (__pyx_k93[]) = \"left > mode\";\nstatic char (__pyx_k94[]) = \"mode > right\";\nstatic char (__pyx_k95[]) = \"left == right\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_left;\n double __pyx_v_mode;\n double __pyx_v_right;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n __pyx_v_size = __pyx_k49;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_INCREF(__pyx_k93p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_INCREF(__pyx_k94p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_left == __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_INCREF(__pyx_k95p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k96p;\nstatic PyObject *__pyx_k97p;\nstatic PyObject *__pyx_k98p;\n\nstatic char (__pyx_k96[]) = \"n <= 0\";\nstatic char (__pyx_k97[]) = \"p < 0\";\nstatic char (__pyx_k98[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k50;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_INCREF(__pyx_k96p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_INCREF(__pyx_k97p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_INCREF(__pyx_k98p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k99p;\nstatic PyObject *__pyx_k100p;\nstatic PyObject *__pyx_k101p;\n\nstatic char (__pyx_k99[]) = \"n <= 0\";\nstatic char (__pyx_k100[]) = \"p < 0\";\nstatic char (__pyx_k101[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k51;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_INCREF(__pyx_k99p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_INCREF(__pyx_k100p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_INCREF(__pyx_k101p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k102p;\n\nstatic char (__pyx_k102[]) = \"lam <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_lam;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n __pyx_v_lam = __pyx_k52;\n __pyx_v_size = __pyx_k53;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n __pyx_1 = (__pyx_v_lam <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_INCREF(__pyx_k102p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k103p;\n\nstatic char (__pyx_k103[]) = \"a <= 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k54;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n __pyx_1 = (__pyx_v_a <= 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_INCREF(__pyx_k103p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k104p;\nstatic PyObject *__pyx_k105p;\n\nstatic char (__pyx_k104[]) = \"p < 0.0\";\nstatic char (__pyx_k105[]) = \"p > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k55;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n __pyx_1 = (__pyx_v_p < 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_INCREF(__pyx_k104p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_INCREF(__pyx_k105p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k106p;\nstatic PyObject *__pyx_k107p;\nstatic PyObject *__pyx_k108p;\nstatic PyObject *__pyx_k109p;\n\nstatic char (__pyx_k106[]) = \"ngood < 1\";\nstatic char (__pyx_k107[]) = \"nbad < 1\";\nstatic char (__pyx_k108[]) = \"ngood + nbad < nsample\";\nstatic char (__pyx_k109[]) = \"nsample < 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_ngood;\n long __pyx_v_nbad;\n long __pyx_v_nsample;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n __pyx_v_size = __pyx_k56;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n __pyx_1 = (__pyx_v_ngood < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_INCREF(__pyx_k106p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nbad < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_INCREF(__pyx_k107p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_INCREF(__pyx_k108p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nsample < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_INCREF(__pyx_k109p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k110p;\nstatic PyObject *__pyx_k111p;\n\nstatic char (__pyx_k110[]) = \"p < 0\";\nstatic char (__pyx_k111[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k57;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_INCREF(__pyx_k110p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_INCREF(__pyx_k111p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_array;\nstatic PyObject *__pyx_n_shape;\nstatic PyObject *__pyx_n_ArgumentError;\nstatic PyObject *__pyx_n_isinstance;\nstatic PyObject *__pyx_n_list;\nstatic PyObject *__pyx_n_append;\nstatic PyObject *__pyx_n_multiply;\nstatic PyObject *__pyx_n_reduce;\nstatic PyObject *__pyx_n_svd;\nstatic PyObject *__pyx_n_matrixmultiply;\nstatic PyObject *__pyx_n_sqrt;\nstatic PyObject *__pyx_n_add;\nstatic PyObject *__pyx_n_tuple;\n\nstatic PyObject *__pyx_k112p;\nstatic PyObject *__pyx_k113p;\nstatic PyObject *__pyx_k114p;\nstatic PyObject *__pyx_k115p;\n\nstatic char (__pyx_k112[]) = \"mean must be 1 dimensional\";\nstatic char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\nstatic char (__pyx_k114[]) = \"mean and cov must have same length\";\nstatic char (__pyx_k115[]) = \"numpy.dual\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_mean = 0;\n PyObject *__pyx_v_cov = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_final_shape;\n PyObject *__pyx_v_x;\n PyObject *__pyx_v_svd;\n PyObject *__pyx_v_u;\n PyObject *__pyx_v_s;\n PyObject *__pyx_v_v;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n __pyx_v_size = __pyx_k58;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_mean);\n Py_INCREF(__pyx_v_cov);\n Py_INCREF(__pyx_v_size);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_mean);\n __pyx_v_mean = __pyx_3;\n __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_cov);\n __pyx_v_cov = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n __pyx_4 = __pyx_v_size == Py_None;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n Py_INCREF(__pyx_v_size);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_v_size;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_INCREF(__pyx_k112p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_3, 0, 0);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (!__pyx_4) {\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n }\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_INCREF(__pyx_k113p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n goto __pyx_L4;\n }\n __pyx_L4:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_INCREF(__pyx_k114p);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __Pyx_Raise(__pyx_2, 0, 0);\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n goto __pyx_L5;\n }\n __pyx_L5:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L6;\n }\n __pyx_L6:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n __pyx_5 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_final_shape);\n __pyx_v_final_shape = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n __pyx_3 = 0;\n __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_5;\n __pyx_5 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n __pyx_3 = 0;\n __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_INCREF(__pyx_n_svd);\n PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_v_svd);\n __pyx_v_svd = __pyx_5;\n __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_u);\n __pyx_v_u = __pyx_3;\n __pyx_3 = 0;\n __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_s);\n __pyx_v_s = __pyx_5;\n __pyx_5 = 0;\n __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_v);\n __pyx_v_v = __pyx_1;\n __pyx_1 = 0;\n if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_INCREF(__pyx_v_s);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n Py_INCREF(__pyx_v_v);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n __pyx_2 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n Py_INCREF(__pyx_v_x);\n __pyx_r = __pyx_v_x;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_final_shape);\n Py_DECREF(__pyx_v_x);\n Py_DECREF(__pyx_v_svd);\n Py_DECREF(__pyx_v_u);\n Py_DECREF(__pyx_v_s);\n Py_DECREF(__pyx_v_v);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_mean);\n Py_DECREF(__pyx_v_cov);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_zeros;\n\nstatic PyObject *__pyx_k117p;\n\nstatic char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n PyObject *__pyx_v_pvals = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_d;\n PyArrayObject *arrayObject_parr;\n PyArrayObject *arrayObject_mnarr;\n double (*__pyx_v_pix);\n long (*__pyx_v_mnix);\n long __pyx_v_i;\n long __pyx_v_j;\n long __pyx_v_dn;\n double __pyx_v_Sum;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_multin;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n __pyx_v_size = __pyx_k59;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_pvals);\n Py_INCREF(__pyx_v_size);\n arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_INCREF(__pyx_v_pvals);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_v_d = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_parr));\n arrayObject_parr = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_INCREF(__pyx_k117p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n __pyx_5 = __pyx_v_size == Py_None;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_5 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_multin);\n __pyx_v_multin = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n Py_INCREF(((PyObject *)__pyx_v_multin));\n Py_DECREF(((PyObject *)arrayObject_mnarr));\n arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n __pyx_v_i = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n while (1) {\n __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n __pyx_v_Sum = 1.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n __pyx_v_dn = __pyx_v_n;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n __pyx_4 = (__pyx_v_d - 1);\n for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n __pyx_5 = (__pyx_v_dn <= 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n goto __pyx_L7;\n goto __pyx_L8;\n }\n __pyx_L8:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n }\n __pyx_L7:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n __pyx_5 = (__pyx_v_dn > 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n goto __pyx_L9;\n }\n __pyx_L9:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n Py_INCREF(__pyx_v_multin);\n __pyx_r = __pyx_v_multin;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_parr);\n Py_DECREF(arrayObject_mnarr);\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_multin);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_pvals);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n long __pyx_v_i;\n long __pyx_v_j;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_v_i = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n while (1) {\n __pyx_5 = (__pyx_v_i > 0);\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n __pyx_v_i = (__pyx_v_i - 1);\n }\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_arange;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n PyObject *__pyx_v_arr;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_4 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_INCREF(__pyx_v_arr);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n Py_INCREF(__pyx_v_arr);\n __pyx_r = __pyx_v_arr;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_arr);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic __Pyx_InternTabEntry __pyx_intern_tab[] = {\n {&__pyx_n_ArgumentError, \"ArgumentError\"},\n {&__pyx_n_Float64, \"Float64\"},\n {&__pyx_n_Int, \"Int\"},\n {&__pyx_n_MT19937, \"MT19937\"},\n {&__pyx_n_ValueError, \"ValueError\"},\n {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n {&__pyx_n__rand, \"_rand\"},\n {&__pyx_n__sp, \"_sp\"},\n {&__pyx_n_add, \"add\"},\n {&__pyx_n_append, \"append\"},\n {&__pyx_n_arange, \"arange\"},\n {&__pyx_n_array, \"array\"},\n {&__pyx_n_beta, \"beta\"},\n {&__pyx_n_binomial, \"binomial\"},\n {&__pyx_n_bytes, \"bytes\"},\n {&__pyx_n_chisquare, \"chisquare\"},\n {&__pyx_n_empty, \"empty\"},\n {&__pyx_n_exponential, \"exponential\"},\n {&__pyx_n_f, \"f\"},\n {&__pyx_n_gamma, \"gamma\"},\n {&__pyx_n_geometric, \"geometric\"},\n {&__pyx_n_get_state, \"get_state\"},\n {&__pyx_n_gumbel, \"gumbel\"},\n {&__pyx_n_hypergeometric, \"hypergeometric\"},\n {&__pyx_n_int, \"int\"},\n {&__pyx_n_isinstance, \"isinstance\"},\n {&__pyx_n_laplace, \"laplace\"},\n {&__pyx_n_len, \"len\"},\n {&__pyx_n_list, \"list\"},\n {&__pyx_n_logistic, \"logistic\"},\n {&__pyx_n_lognormal, \"lognormal\"},\n {&__pyx_n_logseries, \"logseries\"},\n {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n {&__pyx_n_multinomial, \"multinomial\"},\n {&__pyx_n_multiply, \"multiply\"},\n {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n {&__pyx_n_negative_binomial, \"negative_binomial\"},\n {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n {&__pyx_n_noncentral_f, \"noncentral_f\"},\n {&__pyx_n_normal, \"normal\"},\n {&__pyx_n_numpy, \"numpy\"},\n {&__pyx_n_pareto, \"pareto\"},\n {&__pyx_n_permutation, \"permutation\"},\n {&__pyx_n_poisson, \"poisson\"},\n {&__pyx_n_power, \"power\"},\n {&__pyx_n_rand, \"rand\"},\n {&__pyx_n_randint, \"randint\"},\n {&__pyx_n_randn, \"randn\"},\n {&__pyx_n_random, \"random\"},\n {&__pyx_n_random_integers, \"random_integers\"},\n {&__pyx_n_random_sample, \"random_sample\"},\n {&__pyx_n_rayleigh, \"rayleigh\"},\n {&__pyx_n_reduce, \"reduce\"},\n {&__pyx_n_seed, \"seed\"},\n {&__pyx_n_set_state, \"set_state\"},\n {&__pyx_n_shape, \"shape\"},\n {&__pyx_n_shuffle, \"shuffle\"},\n {&__pyx_n_size, \"size\"},\n {&__pyx_n_sqrt, \"sqrt\"},\n {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n {&__pyx_n_standard_exponential, \"standard_exponential\"},\n {&__pyx_n_standard_gamma, \"standard_gamma\"},\n {&__pyx_n_standard_normal, \"standard_normal\"},\n {&__pyx_n_standard_t, \"standard_t\"},\n {&__pyx_n_svd, \"svd\"},\n {&__pyx_n_triangular, \"triangular\"},\n {&__pyx_n_tuple, \"tuple\"},\n {&__pyx_n_type, \"type\"},\n {&__pyx_n_uniform, \"uniform\"},\n {&__pyx_n_vonmises, \"vonmises\"},\n {&__pyx_n_wald, \"wald\"},\n {&__pyx_n_weibull, \"weibull\"},\n {&__pyx_n_zeros, \"zeros\"},\n {&__pyx_n_zipf, \"zipf\"},\n {0, 0}\n};\n\nstatic __Pyx_StringTabEntry __pyx_string_tab[] = {\n {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n {0, 0, 0}\n};\n\nstatic PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n PyObject *o = (*t->tp_alloc)(t, 0);\n struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n return o;\n}\n\nstatic void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n {\n PyObject *etype, *eval, *etb;\n PyErr_Fetch(&etype, &eval, &etb);\n ++o->ob_refcnt;\n __pyx_f_6mtrand_11RandomState___dealloc__(o);\n if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n --o->ob_refcnt;\n PyErr_Restore(etype, eval, etb);\n }\n (*o->ob_type->tp_free)(o);\n}\n\nstatic int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n return 0;\n}\n\nstatic int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n return 0;\n}\n\nstatic struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n {0, 0, 0, 0}\n};\n\nstatic PyNumberMethods __pyx_tp_as_number_RandomState = {\n 0, /*nb_add*/\n 0, /*nb_subtract*/\n 0, /*nb_multiply*/\n 0, /*nb_divide*/\n 0, /*nb_remainder*/\n 0, /*nb_divmod*/\n 0, /*nb_power*/\n 0, /*nb_negative*/\n 0, /*nb_positive*/\n 0, /*nb_absolute*/\n 0, /*nb_nonzero*/\n 0, /*nb_invert*/\n 0, /*nb_lshift*/\n 0, /*nb_rshift*/\n 0, /*nb_and*/\n 0, /*nb_xor*/\n 0, /*nb_or*/\n 0, /*nb_coerce*/\n 0, /*nb_int*/\n 0, /*nb_long*/\n 0, /*nb_float*/\n 0, /*nb_oct*/\n 0, /*nb_hex*/\n 0, /*nb_inplace_add*/\n 0, /*nb_inplace_subtract*/\n 0, /*nb_inplace_multiply*/\n 0, /*nb_inplace_divide*/\n 0, /*nb_inplace_remainder*/\n 0, /*nb_inplace_power*/\n 0, /*nb_inplace_lshift*/\n 0, /*nb_inplace_rshift*/\n 0, /*nb_inplace_and*/\n 0, /*nb_inplace_xor*/\n 0, /*nb_inplace_or*/\n 0, /*nb_floor_divide*/\n 0, /*nb_true_divide*/\n 0, /*nb_inplace_floor_divide*/\n 0, /*nb_inplace_true_divide*/\n};\n\nstatic PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n 0, /*sq_length*/\n 0, /*sq_concat*/\n 0, /*sq_repeat*/\n 0, /*sq_item*/\n 0, /*sq_slice*/\n 0, /*sq_ass_item*/\n 0, /*sq_ass_slice*/\n 0, /*sq_contains*/\n 0, /*sq_inplace_concat*/\n 0, /*sq_inplace_repeat*/\n};\n\nstatic PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n 0, /*mp_length*/\n 0, /*mp_subscript*/\n 0, /*mp_ass_subscript*/\n};\n\nstatic PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n 0, /*bf_getreadbuffer*/\n 0, /*bf_getwritebuffer*/\n 0, /*bf_getsegcount*/\n 0, /*bf_getcharbuffer*/\n};\n\nstatichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n PyObject_HEAD_INIT(0)\n 0, /*ob_size*/\n \"mtrand.RandomState\", /*tp_name*/\n sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n 0, /*tp_itemsize*/\n __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n 0, /*tp_print*/\n 0, /*tp_getattr*/\n 0, /*tp_setattr*/\n 0, /*tp_compare*/\n 0, /*tp_repr*/\n &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n 0, /*tp_hash*/\n 0, /*tp_call*/\n 0, /*tp_str*/\n 0, /*tp_getattro*/\n 0, /*tp_setattro*/\n &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n 0, /*tp_richcompare*/\n 0, /*tp_weaklistoffset*/\n 0, /*tp_iter*/\n 0, /*tp_iternext*/\n __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n 0, /*tp_members*/\n 0, /*tp_getset*/\n 0, /*tp_base*/\n 0, /*tp_dict*/\n 0, /*tp_descr_get*/\n 0, /*tp_descr_set*/\n 0, /*tp_dictoffset*/\n __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n 0, /*tp_alloc*/\n __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n 0, /*tp_free*/\n 0, /*tp_is_gc*/\n 0, /*tp_bases*/\n 0, /*tp_mro*/\n 0, /*tp_cache*/\n 0, /*tp_subclasses*/\n 0, /*tp_weaklist*/\n};\n\nstatic struct PyMethodDef __pyx_methods[] = {\n {0, 0, 0, 0}\n};\n\nDL_EXPORT(void) initmtrand(void); /*proto*/\nDL_EXPORT(void) initmtrand(void) {\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_b = PyImport_AddModule(\"__builtin__\");\n if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n import_array();\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n Py_INCREF(Py_None);\n __pyx_k2 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n Py_INCREF(Py_None);\n __pyx_k3 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n Py_INCREF(Py_None);\n __pyx_k4 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n Py_INCREF(Py_None);\n __pyx_k5 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n Py_INCREF(Py_None);\n __pyx_k6 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k7 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n __pyx_k8 = 0.0;\n __pyx_k9 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k10 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n Py_INCREF(Py_None);\n __pyx_k11 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k12 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n Py_INCREF(Py_None);\n __pyx_k13 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n __pyx_k14 = 0.0;\n __pyx_k15 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k16 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n Py_INCREF(Py_None);\n __pyx_k17 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n __pyx_k18 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k19 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n Py_INCREF(Py_None);\n __pyx_k20 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n Py_INCREF(Py_None);\n __pyx_k21 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n __pyx_k22 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k23 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n Py_INCREF(Py_None);\n __pyx_k24 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n Py_INCREF(Py_None);\n __pyx_k25 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n Py_INCREF(Py_None);\n __pyx_k26 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n Py_INCREF(Py_None);\n __pyx_k27 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n Py_INCREF(Py_None);\n __pyx_k28 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n Py_INCREF(Py_None);\n __pyx_k29 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n Py_INCREF(Py_None);\n __pyx_k30 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n Py_INCREF(Py_None);\n __pyx_k31 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n Py_INCREF(Py_None);\n __pyx_k32 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n Py_INCREF(Py_None);\n __pyx_k33 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n __pyx_k34 = 0.0;\n __pyx_k35 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k36 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n __pyx_k37 = 0.0;\n __pyx_k38 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k39 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n __pyx_k40 = 0.0;\n __pyx_k41 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k42 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n __pyx_k43 = 0.0;\n __pyx_k44 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k45 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n __pyx_k46 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k47 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n Py_INCREF(Py_None);\n __pyx_k48 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n Py_INCREF(Py_None);\n __pyx_k49 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n Py_INCREF(Py_None);\n __pyx_k50 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n Py_INCREF(Py_None);\n __pyx_k51 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n __pyx_k52 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k53 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n Py_INCREF(Py_None);\n __pyx_k54 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n Py_INCREF(Py_None);\n __pyx_k55 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n Py_INCREF(Py_None);\n __pyx_k56 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n Py_INCREF(Py_None);\n __pyx_k57 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n Py_INCREF(Py_None);\n __pyx_k58 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n Py_INCREF(Py_None);\n __pyx_k59 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n return;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n __Pyx_AddTraceback(\"mtrand\");\n}\n\nstatic char *__pyx_filenames[] = {\n \"mtrand.pyx\",\n \"numpy.pxi\",\n};\nstatichere char **__pyx_f = __pyx_filenames;\n\n/* Runtime support code */\n\nstatic int __Pyx_GetStarArgs(\n PyObject **args, \n PyObject **kwds,\n char *kwd_list[], \n int nargs,\n PyObject **args2, \n PyObject **kwds2)\n{\n PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n \n if (args2)\n *args2 = 0;\n if (kwds2)\n *kwds2 = 0;\n \n if (args2) {\n args1 = PyTuple_GetSlice(*args, 0, nargs);\n if (!args1)\n goto bad;\n *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n if (!*args2)\n goto bad;\n }\n else {\n args1 = *args;\n Py_INCREF(args1);\n }\n \n if (kwds2) {\n if (*kwds) {\n char **p;\n kwds1 = PyDict_New();\n if (!kwds)\n goto bad;\n *kwds2 = PyDict_Copy(*kwds);\n if (!*kwds2)\n goto bad;\n for (p = kwd_list; *p; p++) {\n x = PyDict_GetItemString(*kwds, *p);\n if (x) {\n if (PyDict_SetItemString(kwds1, *p, x) < 0)\n goto bad;\n if (PyDict_DelItemString(*kwds2, *p) < 0)\n goto bad;\n }\n }\n }\n else {\n *kwds2 = PyDict_New();\n if (!*kwds2)\n goto bad;\n }\n }\n else {\n kwds1 = *kwds;\n Py_XINCREF(kwds1);\n }\n \n *args = args1;\n *kwds = kwds1;\n return 0;\nbad:\n Py_XDECREF(args1);\n Py_XDECREF(kwds1);\n Py_XDECREF(*args2);\n Py_XDECREF(*kwds2);\n return -1;\n}\n\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n PyObject *__import__ = 0;\n PyObject *empty_list = 0;\n PyObject *module = 0;\n PyObject *global_dict = 0;\n PyObject *empty_dict = 0;\n PyObject *list;\n __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n if (!__import__)\n goto bad;\n if (from_list)\n list = from_list;\n else {\n empty_list = PyList_New(0);\n if (!empty_list)\n goto bad;\n list = empty_list;\n }\n global_dict = PyModule_GetDict(__pyx_m);\n if (!global_dict)\n goto bad;\n empty_dict = PyDict_New();\n if (!empty_dict)\n goto bad;\n module = PyObject_CallFunction(__import__, \"OOOO\",\n name, global_dict, empty_dict, list);\nbad:\n Py_XDECREF(empty_list);\n Py_XDECREF(__import__);\n Py_XDECREF(empty_dict);\n return module;\n}\n\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n PyObject *result;\n result = PyObject_GetAttr(dict, name);\n if (!result)\n PyErr_SetObject(PyExc_NameError, name);\n return result;\n}\n\nstatic void __Pyx_WriteUnraisable(char *name) {\n PyObject *old_exc, *old_val, *old_tb;\n PyObject *ctx;\n PyErr_Fetch(&old_exc, &old_val, &old_tb);\n ctx = PyString_FromString(name);\n PyErr_Restore(old_exc, old_val, old_tb);\n if (!ctx)\n ctx = Py_None;\n PyErr_WriteUnraisable(ctx);\n}\n\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n Py_XINCREF(type);\n Py_XINCREF(value);\n Py_XINCREF(tb);\n /* First, check the traceback argument, replacing None with NULL. */\n if (tb == Py_None) {\n Py_DECREF(tb);\n tb = 0;\n }\n else if (tb != NULL && !PyTraceBack_Check(tb)) {\n PyErr_SetString(PyExc_TypeError,\n \"raise: arg 3 must be a traceback or None\");\n goto raise_error;\n }\n /* Next, replace a missing value with None */\n if (value == NULL) {\n value = Py_None;\n Py_INCREF(value);\n }\n /* Next, repeatedly, replace a tuple exception with its first item */\n while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n PyObject *tmp = type;\n type = PyTuple_GET_ITEM(type, 0);\n Py_INCREF(type);\n Py_DECREF(tmp);\n }\n if (PyString_Check(type))\n ;\n else if (PyClass_Check(type))\n ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n else if (PyInstance_Check(type)) {\n /* Raising an instance. The value should be a dummy. */\n if (value != Py_None) {\n PyErr_SetString(PyExc_TypeError,\n \"instance exception may not have a separate value\");\n goto raise_error;\n }\n else {\n /* Normalize to raise , */\n Py_DECREF(value);\n value = type;\n type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n Py_INCREF(type);\n }\n }\n else {\n /* Not something you can raise. You get an exception\n anyway, just not what you specified :-) */\n PyErr_Format(PyExc_TypeError,\n \"exceptions must be strings, classes, or \"\n \"instances, not %s\", type->ob_type->tp_name);\n goto raise_error;\n }\n PyErr_Restore(type, value, tb);\n return;\nraise_error:\n Py_XDECREF(value);\n Py_XDECREF(type);\n Py_XDECREF(tb);\n return;\n}\n\nstatic void __Pyx_UnpackError(void) {\n PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n}\n\nstatic PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (!item) {\n if (PyErr_ExceptionMatches(PyExc_IndexError))\n __Pyx_UnpackError();\n }\n return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (item) {\n Py_DECREF(item);\n __Pyx_UnpackError();\n return -1;\n }\n PyErr_Clear();\n return 0;\n}\n\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n while (t->p) {\n *t->p = PyString_InternFromString(t->s);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n while (t->p) {\n *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n long size) \n{\n PyObject *py_module_name = 0;\n PyObject *py_class_name = 0;\n PyObject *py_name_list = 0;\n PyObject *py_module = 0;\n PyObject *result = 0;\n \n py_module_name = PyString_FromString(module_name);\n if (!py_module_name)\n goto bad;\n py_class_name = PyString_FromString(class_name);\n if (!py_class_name)\n goto bad;\n py_name_list = PyList_New(1);\n if (!py_name_list)\n goto bad;\n Py_INCREF(py_class_name);\n if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n goto bad;\n py_module = __Pyx_Import(py_module_name, py_name_list);\n if (!py_module)\n goto bad;\n result = PyObject_GetAttr(py_module, py_class_name);\n if (!result)\n goto bad;\n if (!PyType_Check(result)) {\n PyErr_Format(PyExc_TypeError, \n \"%s.%s is not a type object\",\n module_name, class_name);\n goto bad;\n }\n if (((PyTypeObject *)result)->tp_basicsize != size) {\n PyErr_Format(PyExc_ValueError, \n \"%s.%s does not appear to be the correct type object\",\n module_name, class_name);\n goto bad;\n }\n goto done;\nbad:\n Py_XDECREF(result);\n result = 0;\ndone:\n Py_XDECREF(py_module_name);\n Py_XDECREF(py_class_name);\n Py_XDECREF(py_name_list);\n return (PyTypeObject *)result;\n}\n\n#include \"compile.h\"\n#include \"frameobject.h\"\n#include \"traceback.h\"\n\nstatic void __Pyx_AddTraceback(char *funcname) {\n PyObject *py_srcfile = 0;\n PyObject *py_funcname = 0;\n PyObject *py_globals = 0;\n PyObject *empty_tuple = 0;\n PyObject *empty_string = 0;\n PyCodeObject *py_code = 0;\n PyFrameObject *py_frame = 0;\n \n py_srcfile = PyString_FromString(__pyx_filename);\n if (!py_srcfile) goto bad;\n py_funcname = PyString_FromString(funcname);\n if (!py_funcname) goto bad;\n py_globals = PyModule_GetDict(__pyx_m);\n if (!py_globals) goto bad;\n empty_tuple = PyTuple_New(0);\n if (!empty_tuple) goto bad;\n empty_string = PyString_FromString(\"\");\n if (!empty_string) goto bad;\n py_code = PyCode_New(\n 0, /*int argcount,*/\n 0, /*int nlocals,*/\n 0, /*int stacksize,*/\n 0, /*int flags,*/\n empty_string, /*PyObject *code,*/\n empty_tuple, /*PyObject *consts,*/\n empty_tuple, /*PyObject *names,*/\n empty_tuple, /*PyObject *varnames,*/\n empty_tuple, /*PyObject *freevars,*/\n empty_tuple, /*PyObject *cellvars,*/\n py_srcfile, /*PyObject *filename,*/\n py_funcname, /*PyObject *name,*/\n __pyx_lineno, /*int firstlineno,*/\n empty_string /*PyObject *lnotab*/\n );\n if (!py_code) goto bad;\n py_frame = PyFrame_New(\n PyThreadState_Get(), /*PyThreadState *tstate,*/\n py_code, /*PyCodeObject *code,*/\n py_globals, /*PyObject *globals,*/\n 0 /*PyObject *locals*/\n );\n if (!py_frame) goto bad;\n py_frame->f_lineno = __pyx_lineno;\n PyTraceBack_Here(py_frame);\nbad:\n Py_XDECREF(py_srcfile);\n Py_XDECREF(py_funcname);\n Py_XDECREF(empty_tuple);\n Py_XDECREF(empty_string);\n Py_XDECREF(py_code);\n Py_XDECREF(py_frame);\n}\n", + "source_code_before": "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */\n\n#include \"Python.h\"\n#include \"structmember.h\"\n#ifndef PY_LONG_LONG\n #define PY_LONG_LONG LONG_LONG\n#endif\n#include \"string.h\"\n#include \"math.h\"\n#include \"numpy/arrayobject.h\"\n#include \"randomkit.h\"\n#include \"distributions.h\"\n#include \"initarray.h\"\n\n\ntypedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/\ntypedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/\nstatic PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/\nstatic int __Pyx_EndUnpack(PyObject *, int); /*proto*/\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/\nstatic int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/\nstatic void __Pyx_WriteUnraisable(char *name); /*proto*/\nstatic void __Pyx_AddTraceback(char *funcname); /*proto*/\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/\n\nstatic PyObject *__pyx_m;\nstatic PyObject *__pyx_b;\nstatic int __pyx_lineno;\nstatic char *__pyx_filename;\nstaticforward char **__pyx_f;\n\n/* Declarations from mtrand */\n\nstaticforward PyTypeObject __pyx_type_6mtrand_RandomState;\n\nstruct __pyx_obj_6mtrand_RandomState {\n PyObject_HEAD\n rk_state (*internal_state);\n};\n\nstatic PyTypeObject *__pyx_ptype_6mtrand_dtypedescr = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;\nstatic PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;\nstatic PyObject *__pyx_k2;\nstatic PyObject *__pyx_k3;\nstatic PyObject *__pyx_k4;\nstatic PyObject *__pyx_k5;\nstatic PyObject *__pyx_k6;\nstatic PyObject *__pyx_k7;\nstatic double __pyx_k8;\nstatic double __pyx_k9;\nstatic PyObject *__pyx_k10;\nstatic PyObject *__pyx_k11;\nstatic PyObject *__pyx_k12;\nstatic PyObject *__pyx_k13;\nstatic double __pyx_k14;\nstatic double __pyx_k15;\nstatic PyObject *__pyx_k16;\nstatic PyObject *__pyx_k17;\nstatic double __pyx_k18;\nstatic PyObject *__pyx_k19;\nstatic PyObject *__pyx_k20;\nstatic PyObject *__pyx_k21;\nstatic double __pyx_k22;\nstatic PyObject *__pyx_k23;\nstatic PyObject *__pyx_k24;\nstatic PyObject *__pyx_k25;\nstatic PyObject *__pyx_k26;\nstatic PyObject *__pyx_k27;\nstatic PyObject *__pyx_k28;\nstatic PyObject *__pyx_k29;\nstatic PyObject *__pyx_k30;\nstatic PyObject *__pyx_k31;\nstatic PyObject *__pyx_k32;\nstatic PyObject *__pyx_k33;\nstatic double __pyx_k34;\nstatic double __pyx_k35;\nstatic PyObject *__pyx_k36;\nstatic double __pyx_k37;\nstatic double __pyx_k38;\nstatic PyObject *__pyx_k39;\nstatic double __pyx_k40;\nstatic double __pyx_k41;\nstatic PyObject *__pyx_k42;\nstatic double __pyx_k43;\nstatic double __pyx_k44;\nstatic PyObject *__pyx_k45;\nstatic double __pyx_k46;\nstatic PyObject *__pyx_k47;\nstatic PyObject *__pyx_k48;\nstatic PyObject *__pyx_k49;\nstatic PyObject *__pyx_k50;\nstatic PyObject *__pyx_k51;\nstatic double __pyx_k52;\nstatic PyObject *__pyx_k53;\nstatic PyObject *__pyx_k54;\nstatic PyObject *__pyx_k55;\nstatic PyObject *__pyx_k56;\nstatic PyObject *__pyx_k57;\nstatic PyObject *__pyx_k58;\nstatic PyObject *__pyx_k59;\nstatic PyObject *(__pyx_f_6mtrand_cont0_array(rk_state (*),double ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont1_array(rk_state (*),double ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont2_array(rk_state (*),double ((*)(rk_state (*),double ,double )),PyObject *,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_cont3_array(rk_state (*),double ((*)(rk_state (*),double ,double ,double )),PyObject *,double ,double ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_disc0_array(rk_state (*),long ((*)(rk_state (*))),PyObject *)); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnp_array(rk_state (*),long ((*)(rk_state (*),long ,double )),PyObject *,long ,double )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discnmN_array(rk_state (*),long ((*)(rk_state (*),long ,long ,long )),PyObject *,long ,long ,long )); /*proto*/\nstatic PyObject *(__pyx_f_6mtrand_discd_array(rk_state (*),long ((*)(rk_state (*),double )),PyObject *,double )); /*proto*/\nstatic double (__pyx_f_6mtrand_kahan_sum(double (*),long )); /*proto*/\n\n/* Implementation of mtrand */\n\n\nstatic PyObject *__pyx_n__sp;\nstatic PyObject *__pyx_n__rand;\nstatic PyObject *__pyx_n_seed;\nstatic PyObject *__pyx_n_get_state;\nstatic PyObject *__pyx_n_set_state;\nstatic PyObject *__pyx_n_random_sample;\nstatic PyObject *__pyx_n_randint;\nstatic PyObject *__pyx_n_bytes;\nstatic PyObject *__pyx_n_uniform;\nstatic PyObject *__pyx_n_rand;\nstatic PyObject *__pyx_n_randn;\nstatic PyObject *__pyx_n_random_integers;\nstatic PyObject *__pyx_n_standard_normal;\nstatic PyObject *__pyx_n_normal;\nstatic PyObject *__pyx_n_beta;\nstatic PyObject *__pyx_n_exponential;\nstatic PyObject *__pyx_n_standard_exponential;\nstatic PyObject *__pyx_n_standard_gamma;\nstatic PyObject *__pyx_n_gamma;\nstatic PyObject *__pyx_n_f;\nstatic PyObject *__pyx_n_noncentral_f;\nstatic PyObject *__pyx_n_chisquare;\nstatic PyObject *__pyx_n_noncentral_chisquare;\nstatic PyObject *__pyx_n_standard_cauchy;\nstatic PyObject *__pyx_n_standard_t;\nstatic PyObject *__pyx_n_vonmises;\nstatic PyObject *__pyx_n_pareto;\nstatic PyObject *__pyx_n_weibull;\nstatic PyObject *__pyx_n_power;\nstatic PyObject *__pyx_n_laplace;\nstatic PyObject *__pyx_n_gumbel;\nstatic PyObject *__pyx_n_logistic;\nstatic PyObject *__pyx_n_lognormal;\nstatic PyObject *__pyx_n_rayleigh;\nstatic PyObject *__pyx_n_wald;\nstatic PyObject *__pyx_n_triangular;\nstatic PyObject *__pyx_n_binomial;\nstatic PyObject *__pyx_n_negative_binomial;\nstatic PyObject *__pyx_n_poisson;\nstatic PyObject *__pyx_n_zipf;\nstatic PyObject *__pyx_n_geometric;\nstatic PyObject *__pyx_n_hypergeometric;\nstatic PyObject *__pyx_n_logseries;\nstatic PyObject *__pyx_n_multivariate_normal;\nstatic PyObject *__pyx_n_multinomial;\nstatic PyObject *__pyx_n_shuffle;\nstatic PyObject *__pyx_n_permutation;\nstatic PyObject *__pyx_n_numpy;\n\nstatic PyObject *__pyx_n_empty;\nstatic PyObject *__pyx_n_Float64;\n\nstatic PyObject *__pyx_f_6mtrand_cont0_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":128 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":129 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":131 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":132 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":133 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":134 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":135 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":136 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont1_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":144 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":145 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":147 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":148 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":149 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":150 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":151 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":152 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont1_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont2_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":161 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":162 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":164 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":165 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":166 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":167 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":168 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":169 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont2_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_cont3_array(rk_state (*__pyx_v_state),double ((*__pyx_v_func)(rk_state (*),double ,double ,double )),PyObject *__pyx_v_size,double __pyx_v_a,double __pyx_v_b,double __pyx_v_c) {\n double (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":179 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":180 */\n __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":182 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":183 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":184 */\n __pyx_v_array_data = ((double (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":185 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":186 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":187 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.cont3_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_Int;\n\nstatic PyObject *__pyx_f_6mtrand_disc0_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*))),PyObject *__pyx_v_size) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":195 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":196 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":198 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":199 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":200 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":201 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":202 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":203 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.disc0_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnp_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,double )),PyObject *__pyx_v_size,long __pyx_v_n,double __pyx_v_p) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":211 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":212 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":214 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":215 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":216 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":217 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":218 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":219 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnp_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discnmN_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),long ,long ,long )),PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":228 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":229 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":231 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":232 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":233 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":234 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":235 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":236 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discnmN_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_discd_array(rk_state (*__pyx_v_state),long ((*__pyx_v_func)(rk_state (*),double )),PyObject *__pyx_v_size,double __pyx_v_a) {\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":244 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":245 */\n __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":247 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":248 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":249 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":250 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":251 */\n (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":252 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.discd_array\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic double __pyx_f_6mtrand_kahan_sum(double (*__pyx_v_darr),long __pyx_v_n) {\n double __pyx_v_c;\n double __pyx_v_y;\n double __pyx_v_t;\n double __pyx_v_sum;\n long __pyx_v_i;\n double __pyx_r;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":257 */\n __pyx_v_sum = (__pyx_v_darr[0]);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":258 */\n __pyx_v_c = 0.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":259 */\n for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":260 */\n __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":261 */\n __pyx_v_t = (__pyx_v_sum + __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":262 */\n __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":263 */\n __pyx_v_sum = __pyx_v_t;\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":264 */\n __pyx_r = __pyx_v_sum;\n goto __pyx_L0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __Pyx_WriteUnraisable(\"mtrand.kahan_sum\");\n __pyx_L0:;\n return __pyx_r;\n}\n\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic int __pyx_f_6mtrand_11RandomState___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n int __pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k2;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return -1;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":287 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state (*))PyMem_Malloc((sizeof(rk_state ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":289 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = 0;\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__init__\");\n __pyx_r = -1;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/\nstatic void __pyx_f_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) {\n int __pyx_1;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":292 */\n __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":293 */\n PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n goto __pyx_L0;\n __Pyx_AddTraceback(\"mtrand.RandomState.__dealloc__\");\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n}\n\nstatic PyObject *__pyx_n_type;\nstatic PyObject *__pyx_n_int;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_seed[] = \"Seed the generator.\\n\\n seed(seed=None)\\n\\n seed can be an integer, an array (or other sequence) of integers of any\\n length, or None. If seed is None, then RandomState will try to read data\\n from /dev/urandom (or the Windows analogue) if available or seed from\\n the clock otherwise.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_seed = 0;\n rk_error __pyx_v_errcode;\n PyArrayObject *arrayObject_obj;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n unsigned long __pyx_5;\n static char *__pyx_argnames[] = {\"seed\",0};\n __pyx_v_seed = __pyx_k3;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_seed)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_seed);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":307 */\n __pyx_1 = __pyx_v_seed == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":308 */\n __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_INCREF(__pyx_v_seed);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; goto __pyx_L1;}\n __pyx_1 = __pyx_4 == __pyx_2;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":310 */\n __pyx_5 = PyLong_AsUnsignedLong(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;}\n rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":312 */\n __pyx_3 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_seed,PyArray_LONG,1,1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_3));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_3);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":313 */\n init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long (*))arrayObject_obj->data),(arrayObject_obj->dimensions[0]));\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.seed\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_seed);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_MT19937;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_get_state[] = \"Return a tuple representing the internal state of the generator.\\n\\n get_state() -> (\\'MT19937\\', int key[624], int pos)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyArrayObject *arrayObject_state;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n arrayObject_state = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":322 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_1 = 0;\n __pyx_4 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_state));\n arrayObject_state = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":323 */\n memcpy(((void (*))arrayObject_state->data),((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":324 */\n __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;}\n Py_INCREF(__pyx_n_MT19937);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937);\n Py_INCREF(((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state));\n PyTuple_SET_ITEM(__pyx_2, 2, __pyx_4);\n __pyx_4 = 0;\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.get_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_state);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_ValueError;\n\nstatic PyObject *__pyx_k62p;\nstatic PyObject *__pyx_k63p;\n\nstatic char (__pyx_k62[]) = \"algorithm must be 'MT19937'\";\nstatic char (__pyx_k63[]) = \"state must be 624 longs\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_set_state[] = \"Set the state from a tuple.\\n \\n state = (\\'MT19937\\', int key[624], int pos)\\n \\n set_state(state)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyArrayObject *arrayObject_obj;\n int __pyx_v_pos;\n PyObject *__pyx_v_algorithm_name;\n PyObject *__pyx_v_key;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n int __pyx_3;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n arrayObject_obj = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_obj);\n __pyx_v_algorithm_name = Py_None; Py_INCREF(__pyx_v_algorithm_name);\n __pyx_v_key = Py_None; Py_INCREF(__pyx_v_key);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":335 */\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_algorithm_name);\n __pyx_v_algorithm_name = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":336 */\n if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}\n __pyx_3 = __pyx_3 != 0;\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":337 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_INCREF(__pyx_k62p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p);\n __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":338 */\n __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_v_key);\n __pyx_v_key = __pyx_2;\n __pyx_2 = 0;\n __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n __pyx_3 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_v_pos = __pyx_3;\n if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":339 */\n __pyx_4 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_key,PyArray_LONG,1,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject_obj));\n arrayObject_obj = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":340 */\n __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624);\n if (__pyx_3) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":341 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_INCREF(__pyx_k63p);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k63p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":342 */\n memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,((void (*))arrayObject_obj->data),(624 * (sizeof(long ))));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":343 */\n ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.set_state\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_obj);\n Py_DECREF(__pyx_v_algorithm_name);\n Py_DECREF(__pyx_v_key);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":347 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__getstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_state = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n static char *__pyx_argnames[] = {\"state\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_state)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":350 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_INCREF(__pyx_v_state);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.__setstate__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_state);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_random;\nstatic PyObject *__pyx_n___RandomState_ctor;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic PyObject *__pyx_f_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) return 0;\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":353 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_5);\n __pyx_1 = 0;\n __pyx_2 = 0;\n __pyx_5 = 0;\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.__reduce__\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_sample[] = \"Return random floats in the half-open interval [0.0, 1.0).\\n\\n random_sample(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k4;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":361 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_sample\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_tomaxint[] = \"Returns random integers x such that 0 <= x <= sys.maxint.\\n\\n tomaxint(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k5;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":368 */\n __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.tomaxint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k64p;\n\nstatic char (__pyx_k64[]) = \"low >= high\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randint[] = \"Return random integers x such that low <= x < high.\\n\\n randint(low, high=None, size=None) -> random values\\n\\n If high is None, then 0 <= x < low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_lo;\n long __pyx_v_hi;\n long __pyx_v_diff;\n long (*__pyx_v_array_data);\n PyArrayObject *arrayObject;\n long __pyx_v_length;\n long __pyx_v_i;\n PyObject *__pyx_r;\n int __pyx_1;\n long __pyx_2;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k6;\n __pyx_v_size = __pyx_k7;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n arrayObject = (void *)Py_None; Py_INCREF((PyObject *) arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":383 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":384 */\n __pyx_v_lo = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":385 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":387 */\n __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}\n __pyx_v_lo = __pyx_2;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":388 */\n __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}\n __pyx_v_hi = __pyx_2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":390 */\n __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":391 */\n __pyx_1 = (__pyx_v_diff < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":392 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_INCREF(__pyx_k64p);\n PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k64p);\n __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __Pyx_Raise(__pyx_5, 0, 0);\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":394 */\n __pyx_1 = __pyx_v_size == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":395 */\n __pyx_3 = PyLong_FromUnsignedLong(rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}\n __pyx_r = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L0;\n goto __pyx_L4;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":397 */\n __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_INCREF(((PyObject *)__pyx_4));\n Py_DECREF(((PyObject *)arrayObject));\n arrayObject = ((PyArrayObject *)__pyx_4);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":398 */\n __pyx_v_length = PyArray_SIZE(arrayObject);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":399 */\n __pyx_v_array_data = ((long (*))arrayObject->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":400 */\n for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":401 */\n (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long )rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)));\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":402 */\n Py_INCREF(((PyObject *)arrayObject));\n __pyx_r = ((PyObject *)arrayObject);\n goto __pyx_L0;\n }\n __pyx_L4:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.randint\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_bytes[] = \"Return random bytes.\\n\\n bytes(length) -> str\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n unsigned int __pyx_v_length;\n void (*__pyx_v_bytes);\n PyObject *__pyx_v_bytestring;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"length\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"i\", __pyx_argnames, &__pyx_v_length)) return 0;\n Py_INCREF(__pyx_v_self);\n __pyx_v_bytestring = Py_None; Py_INCREF(__pyx_v_bytestring);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":410 */\n __pyx_v_bytes = PyMem_Malloc(__pyx_v_length);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":411 */\n rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":412 */\n __pyx_1 = PyString_FromString(((char (*))__pyx_v_bytes)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}\n Py_DECREF(__pyx_v_bytestring);\n __pyx_v_bytestring = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":413 */\n PyMem_Free(__pyx_v_bytes);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":414 */\n Py_INCREF(__pyx_v_bytestring);\n __pyx_r = __pyx_v_bytestring;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.bytes\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_bytestring);\n Py_DECREF(__pyx_v_self);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_uniform[] = \"Uniform distribution over [low, high).\\n\\n uniform(low=0.0, high=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_low;\n double __pyx_v_high;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_low = __pyx_k8;\n __pyx_v_high = __pyx_k9;\n __pyx_v_size = __pyx_k10;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":421 */\n __pyx_1 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_low,(__pyx_v_high - __pyx_v_low)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.uniform\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_len;\nstatic PyObject *__pyx_n_size;\n\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rand[] = \"Return an array of the given dimensions which is initialized to \\n random numbers from a uniform distribution in the range [0,1).\\n\\n rand(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":430 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":431 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":433 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n if (PyDict_SetItem(__pyx_1, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, __pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_r = __pyx_5;\n __pyx_5 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.rand\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_randn[] = \"Returns zero-mean, unit-variance Gaussian random numbers in an \\n array of shape (d0, d1, ..., dn).\\n\\n randn(d0, d1, ..., dn) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_args = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {0};\n if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return 0;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"\", __pyx_argnames)) {\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n Py_XDECREF(__pyx_v_args);\n return 0;\n }\n Py_INCREF(__pyx_v_self);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":441 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_args);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;}\n __pyx_4 = __pyx_4 == 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":442 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":444 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_INCREF(__pyx_v_args);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_args);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n }\n __pyx_L2:;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.randn\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_XDECREF(__pyx_v_args);\n Py_DECREF(__pyx_v_self);\n Py_XDECREF(__pyx_args);\n Py_XDECREF(__pyx_kwds);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_random_integers[] = \"Return random integers x such that low <= x <= high.\\n\\n random_integers(low, high=None, size=None) -> random values.\\n\\n If high is None, then 1 <= x <= low.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_low = 0;\n PyObject *__pyx_v_high = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"low\",\"high\",\"size\",0};\n __pyx_v_high = __pyx_k11;\n __pyx_v_size = __pyx_k12;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O|OO\", __pyx_argnames, &__pyx_v_low, &__pyx_v_high, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_low);\n Py_INCREF(__pyx_v_high);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":453 */\n __pyx_1 = __pyx_v_high == Py_None;\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":454 */\n Py_INCREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n __pyx_v_high = __pyx_v_low;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":455 */\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; goto __pyx_L1;}\n Py_DECREF(__pyx_v_low);\n __pyx_v_low = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":456 */\n __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_INCREF(__pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4);\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size);\n __pyx_4 = 0;\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_r = __pyx_4;\n __pyx_4 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.random_integers\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_low);\n Py_DECREF(__pyx_v_high);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_normal[] = \"Standard Normal distribution (mean=0, stdev=1).\\n\\n standard_normal(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k13;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":464 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k66p;\n\nstatic char (__pyx_k66[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_normal[] = \"Normal distribution (mean=loc, stdev=scale).\\n\\n normal(loc=0.0, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k14;\n __pyx_v_scale = __pyx_k15;\n __pyx_v_size = __pyx_k16;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":471 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":472 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_INCREF(__pyx_k66p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k66p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":473 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k67p;\nstatic PyObject *__pyx_k68p;\n\nstatic char (__pyx_k67[]) = \"a <= 0\";\nstatic char (__pyx_k68[]) = \"b <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_beta[] = \"Beta distribution over [0, 1].\\n\\n beta(a, b, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n double __pyx_v_b;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"b\",\"size\",0};\n __pyx_v_size = __pyx_k17;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_b, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":480 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":481 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_INCREF(__pyx_k67p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k67p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_b <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":483 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_INCREF(__pyx_k68p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k68p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":484 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_a,__pyx_v_b); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.beta\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k69p;\n\nstatic char (__pyx_k69[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_exponential[] = \"Exponential distribution.\\n\\n exponential(scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k18;\n __pyx_v_size = __pyx_k19;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":491 */\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":492 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_INCREF(__pyx_k69p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k69p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":493 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_exponential[] = \"Standard exponential distribution (scale=1).\\n\\n standard_exponential(size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k20;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":500 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_exponential\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k70p;\n\nstatic char (__pyx_k70[]) = \"shape <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = \"Standard Gamma distribution.\\n\\n standard_gamma(shape, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"size\",0};\n __pyx_v_size = __pyx_k21;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":507 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":508 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_INCREF(__pyx_k70p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k70p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":509 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k71p;\nstatic PyObject *__pyx_k72p;\n\nstatic char (__pyx_k71[]) = \"shape <= 0\";\nstatic char (__pyx_k72[]) = \"scale <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gamma[] = \"Gamma distribution.\\n\\n gamma(shape, scale=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_shape;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"shape\",\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k22;\n __pyx_v_size = __pyx_k23;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|dO\", __pyx_argnames, &__pyx_v_shape, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":516 */\n __pyx_1 = (__pyx_v_shape <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":517 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_INCREF(__pyx_k71p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":519 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_INCREF(__pyx_k72p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k72p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":520 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_shape,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gamma\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k73p;\nstatic PyObject *__pyx_k74p;\n\nstatic char (__pyx_k73[]) = \"dfnum <= 0\";\nstatic char (__pyx_k74[]) = \"dfden <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_f[] = \"F distribution.\\n\\n f(dfnum, dfden, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"size\",0};\n __pyx_v_size = __pyx_k24;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":527 */\n __pyx_1 = (__pyx_v_dfnum <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":528 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_INCREF(__pyx_k73p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":530 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_INCREF(__pyx_k74p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":531 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k75p;\nstatic PyObject *__pyx_k76p;\nstatic PyObject *__pyx_k77p;\n\nstatic char (__pyx_k75[]) = \"dfnum <= 1\";\nstatic char (__pyx_k76[]) = \"dfden <= 0\";\nstatic char (__pyx_k77[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = \"Noncentral F distribution.\\n\\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_dfnum;\n double __pyx_v_dfden;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"dfnum\",\"dfden\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k25;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_dfnum, &__pyx_v_dfden, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":538 */\n __pyx_1 = (__pyx_v_dfnum <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":539 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_INCREF(__pyx_k75p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_dfden <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":541 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_INCREF(__pyx_k76p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":543 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_INCREF(__pyx_k77p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":544 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_dfnum,__pyx_v_dfden,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_f\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k78p;\n\nstatic char (__pyx_k78[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_chisquare[] = \"Chi^2 distribution.\\n\\n chisquare(df, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k26;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":552 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":553 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_INCREF(__pyx_k78p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":554 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k79p;\nstatic PyObject *__pyx_k80p;\n\nstatic char (__pyx_k79[]) = \"df <= 1\";\nstatic char (__pyx_k80[]) = \"nonc < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = \"Noncentral Chi^2 distribution.\\n\\n noncentral_chisquare(df, nonc, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n double __pyx_v_nonc;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"nonc\",\"size\",0};\n __pyx_v_size = __pyx_k27;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_nonc, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":561 */\n __pyx_1 = (__pyx_v_df <= 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":562 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_INCREF(__pyx_k79p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nonc < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":564 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_INCREF(__pyx_k80p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":565 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_df,__pyx_v_nonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.noncentral_chisquare\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_cauchy[] = \"Standard Cauchy with mode=0.\\n\\n standard_cauchy(size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n static char *__pyx_argnames[] = {\"size\",0};\n __pyx_v_size = __pyx_k28;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|O\", __pyx_argnames, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":573 */\n __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;}\n __pyx_r = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_cauchy\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k81p;\n\nstatic char (__pyx_k81[]) = \"df <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_standard_t[] = \"Standard Student\\'s t distribution with df degrees of freedom.\\n\\n standard_t(df, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_df;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"df\",\"size\",0};\n __pyx_v_size = __pyx_k29;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_df, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":580 */\n __pyx_1 = (__pyx_v_df <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":581 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_INCREF(__pyx_k81p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":582 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_df); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.standard_t\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k82p;\n\nstatic char (__pyx_k82[]) = \"kappa < 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_vonmises[] = \"von Mises circular distribution with mode mu and dispersion parameter\\n kappa on [-pi, pi].\\n\\n vonmises(mu, kappa, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mu;\n double __pyx_v_kappa;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mu\",\"kappa\",\"size\",0};\n __pyx_v_size = __pyx_k30;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mu, &__pyx_v_kappa, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":590 */\n __pyx_1 = (__pyx_v_kappa < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":591 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_INCREF(__pyx_k82p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":592 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_mu,__pyx_v_kappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.vonmises\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k83p;\n\nstatic char (__pyx_k83[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_pareto[] = \"Pareto distribution.\\n\\n pareto(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k31;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":599 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":600 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_INCREF(__pyx_k83p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":601 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.pareto\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k84p;\n\nstatic char (__pyx_k84[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_weibull[] = \"Weibull distribution.\\n\\n weibull(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k32;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":608 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":609 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_INCREF(__pyx_k84p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":610 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.weibull\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k85p;\n\nstatic char (__pyx_k85[]) = \"a <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_power[] = \"Power distribution.\\n\\n power(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k33;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":617 */\n __pyx_1 = (__pyx_v_a <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":618 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_INCREF(__pyx_k85p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":619 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.power\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k86p;\n\nstatic char (__pyx_k86[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_laplace[] = \"Laplace distribution.\\n \\n laplace(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k34;\n __pyx_v_scale = __pyx_k35;\n __pyx_v_size = __pyx_k36;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":626 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":627 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_INCREF(__pyx_k86p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":628 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.laplace\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k87p;\n\nstatic char (__pyx_k87[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_gumbel[] = \"Gumbel distribution.\\n \\n gumbel(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k37;\n __pyx_v_scale = __pyx_k38;\n __pyx_v_size = __pyx_k39;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":635 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":636 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_INCREF(__pyx_k87p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":637 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.gumbel\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k88p;\n\nstatic char (__pyx_k88[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logistic[] = \"Logistic distribution.\\n \\n logistic(loc=0.0, scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_loc;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"loc\",\"scale\",\"size\",0};\n __pyx_v_loc = __pyx_k40;\n __pyx_v_scale = __pyx_k41;\n __pyx_v_size = __pyx_k42;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_loc, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":644 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":645 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_INCREF(__pyx_k88p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":646 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_loc,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logistic\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k89p;\n\nstatic char (__pyx_k89[]) = \"sigma <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_lognormal[] = \"Log-normal distribution.\\n \\n Note that the mean parameter is not the mean of this distribution, but \\n the underlying normal distribution.\\n \\n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\\n \\n lognormal(mean=0.0, sigma=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_sigma;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"sigma\",\"size\",0};\n __pyx_v_mean = __pyx_k43;\n __pyx_v_sigma = __pyx_k44;\n __pyx_v_size = __pyx_k45;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|ddO\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_sigma, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":658 */\n __pyx_1 = (__pyx_v_sigma <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":659 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_INCREF(__pyx_k89p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":660 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_mean,__pyx_v_sigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.lognormal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k90p;\n\nstatic char (__pyx_k90[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_rayleigh[] = \"Rayleigh distribution.\\n \\n rayleigh(scale=1.0, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"scale\",\"size\",0};\n __pyx_v_scale = __pyx_k46;\n __pyx_v_size = __pyx_k47;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":667 */\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":668 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_INCREF(__pyx_k90p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":669 */\n __pyx_2 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.rayleigh\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k91p;\nstatic PyObject *__pyx_k92p;\n\nstatic char (__pyx_k91[]) = \"mean <= 0.0\";\nstatic char (__pyx_k92[]) = \"scale <= 0.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_wald[] = \"Wald (inverse Gaussian) distribution.\\n \\n wald(mean, scale, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_mean;\n double __pyx_v_scale;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"scale\",\"size\",0};\n __pyx_v_size = __pyx_k48;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"dd|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_scale, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":676 */\n __pyx_1 = (__pyx_v_mean <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":677 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_INCREF(__pyx_k91p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_scale <= 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":679 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_INCREF(__pyx_k92p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":680 */\n __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_mean,__pyx_v_scale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.wald\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k93p;\nstatic PyObject *__pyx_k94p;\nstatic PyObject *__pyx_k95p;\n\nstatic char (__pyx_k93[]) = \"left > mode\";\nstatic char (__pyx_k94[]) = \"mode > right\";\nstatic char (__pyx_k95[]) = \"left == right\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_triangular[] = \"Triangular distribution starting at left, peaking at mode, and \\n ending at right (left <= mode <= right).\\n \\n triangular(left, mode, right, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_left;\n double __pyx_v_mode;\n double __pyx_v_right;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"left\",\"mode\",\"right\",\"size\",0};\n __pyx_v_size = __pyx_k49;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ddd|O\", __pyx_argnames, &__pyx_v_left, &__pyx_v_mode, &__pyx_v_right, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":688 */\n __pyx_1 = (__pyx_v_left > __pyx_v_mode);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":689 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_INCREF(__pyx_k93p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_mode > __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":691 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_INCREF(__pyx_k94p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_left == __pyx_v_right);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":693 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_INCREF(__pyx_k95p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k95p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":694 */\n __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_left,__pyx_v_mode,__pyx_v_right); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.triangular\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k96p;\nstatic PyObject *__pyx_k97p;\nstatic PyObject *__pyx_k98p;\n\nstatic char (__pyx_k96[]) = \"n <= 0\";\nstatic char (__pyx_k97[]) = \"p < 0\";\nstatic char (__pyx_k98[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_binomial[] = \"Binomial distribution of n trials and p probability of success.\\n\\n binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k50;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":703 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":704 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_INCREF(__pyx_k96p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":706 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_INCREF(__pyx_k97p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":708 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_INCREF(__pyx_k98p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":709 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k99p;\nstatic PyObject *__pyx_k100p;\nstatic PyObject *__pyx_k101p;\n\nstatic char (__pyx_k99[]) = \"n <= 0\";\nstatic char (__pyx_k100[]) = \"p < 0\";\nstatic char (__pyx_k101[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = \"Negative Binomial distribution.\\n\\n negative_binomial(n, p, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"n\",\"p\",\"size\",0};\n __pyx_v_size = __pyx_k51;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"ld|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":716 */\n __pyx_1 = (__pyx_v_n <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":717 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_INCREF(__pyx_k99p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":719 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_INCREF(__pyx_k100p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":721 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_INCREF(__pyx_k101p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":722 */\n __pyx_2 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_n,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.negative_binomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k102p;\n\nstatic char (__pyx_k102[]) = \"lam <= 0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_poisson[] = \"Poisson distribution.\\n\\n poisson(lam=1.0, size=None) -> random values\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_lam;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"lam\",\"size\",0};\n __pyx_v_lam = __pyx_k52;\n __pyx_v_size = __pyx_k53;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"|dO\", __pyx_argnames, &__pyx_v_lam, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":730 */\n __pyx_1 = (__pyx_v_lam <= 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":731 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_INCREF(__pyx_k102p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":732 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_lam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.poisson\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k103p;\n\nstatic char (__pyx_k103[]) = \"a <= 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_zipf[] = \"Zipf distribution.\\n \\n zipf(a, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_a;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"a\",\"size\",0};\n __pyx_v_size = __pyx_k54;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_a, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":739 */\n __pyx_1 = (__pyx_v_a <= 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":740 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_INCREF(__pyx_k103p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":741 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_a); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.zipf\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k104p;\nstatic PyObject *__pyx_k105p;\n\nstatic char (__pyx_k104[]) = \"p < 0.0\";\nstatic char (__pyx_k105[]) = \"p > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_geometric[] = \"Geometric distribution with p being the probability of \\\"success\\\" on\\n an individual trial.\\n \\n geometric(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k55;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":749 */\n __pyx_1 = (__pyx_v_p < 0.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":750 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_INCREF(__pyx_k104p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1.0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":752 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_INCREF(__pyx_k105p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":753 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.geometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k106p;\nstatic PyObject *__pyx_k107p;\nstatic PyObject *__pyx_k108p;\nstatic PyObject *__pyx_k109p;\n\nstatic char (__pyx_k106[]) = \"ngood < 1\";\nstatic char (__pyx_k107[]) = \"nbad < 1\";\nstatic char (__pyx_k108[]) = \"ngood + nbad < nsample\";\nstatic char (__pyx_k109[]) = \"nsample < 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = \"Hypergeometric distribution.\\n \\n Consider an urn with ngood \\\"good\\\" balls and nbad \\\"bad\\\" balls. If one \\n were to draw nsample balls from the urn without replacement, then \\n the hypergeometric distribution describes the distribution of \\\"good\\\" \\n balls in the sample.\\n \\n hypergeometric(ngood, nbad, nsample, size=None) \\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_ngood;\n long __pyx_v_nbad;\n long __pyx_v_nsample;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"ngood\",\"nbad\",\"nsample\",\"size\",0};\n __pyx_v_size = __pyx_k56;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lll|O\", __pyx_argnames, &__pyx_v_ngood, &__pyx_v_nbad, &__pyx_v_nsample, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":765 */\n __pyx_1 = (__pyx_v_ngood < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":766 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_INCREF(__pyx_k106p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nbad < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":768 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_INCREF(__pyx_k107p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = ((__pyx_v_ngood + __pyx_v_nbad) < __pyx_v_nsample);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":770 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_INCREF(__pyx_k108p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_nsample < 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":772 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_INCREF(__pyx_k109p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":773 */\n __pyx_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ngood,__pyx_v_nbad,__pyx_v_nsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.hypergeometric\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_k110p;\nstatic PyObject *__pyx_k111p;\n\nstatic char (__pyx_k110[]) = \"p < 0\";\nstatic char (__pyx_k111[]) = \"p > 1\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_logseries[] = \"Logarithmic series distribution.\\n \\n logseries(p, size=None)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n double __pyx_v_p;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_r;\n int __pyx_1;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n PyObject *__pyx_4 = 0;\n static char *__pyx_argnames[] = {\"p\",\"size\",0};\n __pyx_v_size = __pyx_k57;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"d|O\", __pyx_argnames, &__pyx_v_p, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_size);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":781 */\n __pyx_1 = (__pyx_v_p < 0);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":782 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_INCREF(__pyx_k110p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_1 = (__pyx_v_p > 1);\n if (__pyx_1) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":784 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_INCREF(__pyx_k111p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p);\n __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_4, 0, 0);\n Py_DECREF(__pyx_4); __pyx_4 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":785 */\n __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; goto __pyx_L1;}\n __pyx_r = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_4);\n __Pyx_AddTraceback(\"mtrand.RandomState.logseries\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_array;\nstatic PyObject *__pyx_n_shape;\nstatic PyObject *__pyx_n_ArgumentError;\nstatic PyObject *__pyx_n_isinstance;\nstatic PyObject *__pyx_n_list;\nstatic PyObject *__pyx_n_append;\nstatic PyObject *__pyx_n_multiply;\nstatic PyObject *__pyx_n_reduce;\nstatic PyObject *__pyx_n_svd;\nstatic PyObject *__pyx_n_matrixmultiply;\nstatic PyObject *__pyx_n_sqrt;\nstatic PyObject *__pyx_n_add;\nstatic PyObject *__pyx_n_tuple;\n\nstatic PyObject *__pyx_k112p;\nstatic PyObject *__pyx_k113p;\nstatic PyObject *__pyx_k114p;\nstatic PyObject *__pyx_k115p;\n\nstatic char (__pyx_k112[]) = \"mean must be 1 dimensional\";\nstatic char (__pyx_k113[]) = \"cov must be 2 dimensional and square\";\nstatic char (__pyx_k114[]) = \"mean and cov must have same length\";\nstatic char (__pyx_k115[]) = \"numpy.linalg\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = \"Return an array containing multivariate normally distributed random numbers\\n with specified mean and covariance.\\n\\n multivariate_normal(mean, cov) -> random values\\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\\n\\n mean must be a 1 dimensional array. cov must be a square two dimensional\\n array with the same number of rows and columns as mean has elements.\\n\\n The first form returns a single 1-D array containing a multivariate\\n normal.\\n\\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\\n normal.\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_mean = 0;\n PyObject *__pyx_v_cov = 0;\n PyObject *__pyx_v_size = 0;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_final_shape;\n PyObject *__pyx_v_x;\n PyObject *__pyx_v_svd;\n PyObject *__pyx_v_u;\n PyObject *__pyx_v_s;\n PyObject *__pyx_v_v;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n PyObject *__pyx_5 = 0;\n static char *__pyx_argnames[] = {\"mean\",\"cov\",\"size\",0};\n __pyx_v_size = __pyx_k58;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"OO|O\", __pyx_argnames, &__pyx_v_mean, &__pyx_v_cov, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_mean);\n Py_INCREF(__pyx_v_cov);\n Py_INCREF(__pyx_v_size);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_final_shape = Py_None; Py_INCREF(__pyx_v_final_shape);\n __pyx_v_x = Py_None; Py_INCREF(__pyx_v_x);\n __pyx_v_svd = Py_None; Py_INCREF(__pyx_v_svd);\n __pyx_v_u = Py_None; Py_INCREF(__pyx_v_u);\n __pyx_v_s = Py_None; Py_INCREF(__pyx_v_s);\n __pyx_v_v = Py_None; Py_INCREF(__pyx_v_v);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":806 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_mean);\n __pyx_v_mean = __pyx_3;\n __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":807 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_cov);\n __pyx_v_cov = __pyx_2;\n __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":808 */\n __pyx_4 = __pyx_v_size == Py_None;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":809 */\n __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;}\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":811 */\n Py_INCREF(__pyx_v_size);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_v_size;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":812 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":813 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_INCREF(__pyx_k112p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_3, 0, 0);\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;}\n goto __pyx_L3;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":814 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (!__pyx_4) {\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (PyObject_Cmp(__pyx_1, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n }\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":815 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_INCREF(__pyx_k113p);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p);\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}\n goto __pyx_L4;\n }\n __pyx_L4:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":816 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_2 = PyObject_GetItem(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;}\n __pyx_4 = __pyx_4 != 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":817 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ArgumentError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_INCREF(__pyx_k114p);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k114p);\n __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __Pyx_Raise(__pyx_2, 0, 0);\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}\n goto __pyx_L5;\n }\n __pyx_L5:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":819 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_isinstance); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":820 */\n __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyList_SET_ITEM(__pyx_1, 0, __pyx_v_shape);\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_1;\n __pyx_1 = 0;\n goto __pyx_L6;\n }\n __pyx_L6:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":821 */\n __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_5 = PySequence_GetSlice(__pyx_v_shape, 0, 0x7fffffff); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);\n __pyx_5 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_final_shape);\n __pyx_v_final_shape = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":822 */\n __pyx_5 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":826 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_multiply); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);\n __pyx_3 = 0;\n __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_5;\n __pyx_5 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":827 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n __pyx_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);\n PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);\n __pyx_3 = 0;\n __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":836 */\n __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_INCREF(__pyx_n_svd);\n PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd);\n __pyx_3 = __Pyx_Import(__pyx_k115p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_svd); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;}\n Py_DECREF(__pyx_v_svd);\n __pyx_v_svd = __pyx_5;\n __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":838 */\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_INCREF(__pyx_v_cov);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_cov);\n __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_u);\n __pyx_v_u = __pyx_3;\n __pyx_3 = 0;\n __pyx_5 = __Pyx_UnpackItem(__pyx_2, 1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_s);\n __pyx_v_s = __pyx_5;\n __pyx_5 = 0;\n __pyx_1 = __Pyx_UnpackItem(__pyx_2, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_v_v);\n __pyx_v_v = __pyx_1;\n __pyx_1 = 0;\n if (__Pyx_EndUnpack(__pyx_2, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":839 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_matrixmultiply); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_INCREF(__pyx_v_s);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n Py_INCREF(__pyx_v_v);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v);\n __pyx_2 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_x);\n __pyx_v_x = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":842 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_INCREF(__pyx_v_mean);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x);\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x);\n __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;}\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":843 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_INCREF(__pyx_v_final_shape);\n PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_final_shape);\n __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_5); __pyx_5 = 0;\n if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":844 */\n Py_INCREF(__pyx_v_x);\n __pyx_r = __pyx_v_x;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n Py_XDECREF(__pyx_5);\n __Pyx_AddTraceback(\"mtrand.RandomState.multivariate_normal\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_final_shape);\n Py_DECREF(__pyx_v_x);\n Py_DECREF(__pyx_v_svd);\n Py_DECREF(__pyx_v_u);\n Py_DECREF(__pyx_v_s);\n Py_DECREF(__pyx_v_v);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_mean);\n Py_DECREF(__pyx_v_cov);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_zeros;\n\nstatic PyObject *__pyx_k117p;\n\nstatic char (__pyx_k117[]) = \"sum(pvals) > 1.0\";\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_multinomial[] = \"Multinomial distribution.\\n \\n multinomial(n, pvals, size=None) -> random values\\n\\n pvals is a sequence of probabilities that should sum to 1 (however, the\\n last element is always assumed to account for the remaining probability\\n as long as sum(pvals[:-1]) <= 1).\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n long __pyx_v_n;\n PyObject *__pyx_v_pvals = 0;\n PyObject *__pyx_v_size = 0;\n long __pyx_v_d;\n PyArrayObject *arrayObject_parr;\n PyArrayObject *arrayObject_mnarr;\n double (*__pyx_v_pix);\n long (*__pyx_v_mnix);\n long __pyx_v_i;\n long __pyx_v_j;\n long __pyx_v_dn;\n double __pyx_v_Sum;\n PyObject *__pyx_v_shape;\n PyObject *__pyx_v_multin;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"n\",\"pvals\",\"size\",0};\n __pyx_v_size = __pyx_k59;\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"lO|O\", __pyx_argnames, &__pyx_v_n, &__pyx_v_pvals, &__pyx_v_size)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_pvals);\n Py_INCREF(__pyx_v_size);\n arrayObject_parr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_parr);\n arrayObject_mnarr = (void *)Py_None; Py_INCREF((PyObject *) arrayObject_mnarr);\n __pyx_v_shape = Py_None; Py_INCREF(__pyx_v_shape);\n __pyx_v_multin = Py_None; Py_INCREF(__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":862 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_INCREF(__pyx_v_pvals);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pvals);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_v_d = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":863 */\n __pyx_1 = ((PyObject *)PyArray_ContiguousFromObject(__pyx_v_pvals,PyArray_DOUBLE,1,1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;}\n Py_INCREF(((PyObject *)__pyx_1));\n Py_DECREF(((PyObject *)arrayObject_parr));\n arrayObject_parr = ((PyArrayObject *)__pyx_1);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":864 */\n __pyx_v_pix = ((double (*))arrayObject_parr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":866 */\n __pyx_5 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > 1.0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":867 */\n __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_INCREF(__pyx_k117p);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p);\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __Pyx_Raise(__pyx_1, 0, 0);\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;}\n goto __pyx_L2;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":869 */\n __pyx_5 = __pyx_v_size == Py_None;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":870 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}\n __pyx_5 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":872 */\n __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}\n Py_INCREF(__pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_size);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);\n __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n goto __pyx_L3;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":874 */\n __pyx_1 = PyInt_FromLong(__pyx_v_d); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);\n __pyx_1 = 0;\n __pyx_3 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_shape);\n __pyx_v_shape = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L3:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":876 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_Int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_INCREF(__pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_shape);\n PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);\n __pyx_1 = 0;\n __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_v_multin);\n __pyx_v_multin = __pyx_1;\n __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":877 */\n Py_INCREF(((PyObject *)__pyx_v_multin));\n Py_DECREF(((PyObject *)arrayObject_mnarr));\n arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":878 */\n __pyx_v_mnix = ((long (*))arrayObject_mnarr->data);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":879 */\n __pyx_v_i = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":880 */\n while (1) {\n __pyx_5 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":881 */\n __pyx_v_Sum = 1.0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":882 */\n __pyx_v_dn = __pyx_v_n;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":883 */\n __pyx_4 = (__pyx_v_d - 1);\n for (__pyx_v_j = 0; __pyx_v_j < __pyx_4; ++__pyx_v_j) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":884 */\n (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":885 */\n __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":886 */\n __pyx_5 = (__pyx_v_dn <= 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":887 */\n goto __pyx_L7;\n goto __pyx_L8;\n }\n __pyx_L8:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":888 */\n __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));\n }\n __pyx_L7:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":889 */\n __pyx_5 = (__pyx_v_dn > 0);\n if (__pyx_5) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":890 */\n (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;\n goto __pyx_L9;\n }\n __pyx_L9:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":892 */\n __pyx_v_i = (__pyx_v_i + __pyx_v_d);\n }\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":894 */\n Py_INCREF(__pyx_v_multin);\n __pyx_r = __pyx_v_multin;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.multinomial\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(arrayObject_parr);\n Py_DECREF(arrayObject_mnarr);\n Py_DECREF(__pyx_v_shape);\n Py_DECREF(__pyx_v_multin);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_pvals);\n Py_DECREF(__pyx_v_size);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_shuffle[] = \"Modify a sequence in-place by shuffling its contents.\\n \\n shuffle(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n long __pyx_v_i;\n long __pyx_v_j;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n long __pyx_4;\n int __pyx_5;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":905 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_v_i = __pyx_4;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":906 */\n while (1) {\n __pyx_5 = (__pyx_v_i > 0);\n if (!__pyx_5) break;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":907 */\n __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":908 */\n __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_1 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":909 */\n __pyx_v_i = (__pyx_v_i - 1);\n }\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.shuffle\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic PyObject *__pyx_n_arange;\n\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/\nstatic char __pyx_doc_6mtrand_11RandomState_permutation[] = \"Given an integer, return a shuffled sequence of integers >= 0 and \\n < x; given a sequence, return a shuffled array copy.\\n\\n permutation(x)\\n \";\nstatic PyObject *__pyx_f_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {\n PyObject *__pyx_v_x = 0;\n PyObject *__pyx_v_arr;\n PyObject *__pyx_r;\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n PyObject *__pyx_3 = 0;\n int __pyx_4;\n static char *__pyx_argnames[] = {\"x\",0};\n if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, \"O\", __pyx_argnames, &__pyx_v_x)) return 0;\n Py_INCREF(__pyx_v_self);\n Py_INCREF(__pyx_v_x);\n __pyx_v_arr = Py_None; Py_INCREF(__pyx_v_arr);\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":917 */\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;}\n __pyx_4 = __pyx_3 == __pyx_1;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (__pyx_4) {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":918 */\n __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);\n __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_2;\n __pyx_2 = 0;\n goto __pyx_L2;\n }\n /*else*/ {\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":920 */\n __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_INCREF(__pyx_v_x);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_v_arr);\n __pyx_v_arr = __pyx_3;\n __pyx_3 = 0;\n }\n __pyx_L2:;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":921 */\n __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_INCREF(__pyx_v_arr);\n PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_arr);\n __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n Py_DECREF(__pyx_3); __pyx_3 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":922 */\n Py_INCREF(__pyx_v_arr);\n __pyx_r = __pyx_v_arr;\n goto __pyx_L0;\n\n __pyx_r = Py_None; Py_INCREF(__pyx_r);\n goto __pyx_L0;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n Py_XDECREF(__pyx_3);\n __Pyx_AddTraceback(\"mtrand.RandomState.permutation\");\n __pyx_r = 0;\n __pyx_L0:;\n Py_DECREF(__pyx_v_arr);\n Py_DECREF(__pyx_v_self);\n Py_DECREF(__pyx_v_x);\n return __pyx_r;\n}\n\nstatic __Pyx_InternTabEntry __pyx_intern_tab[] = {\n {&__pyx_n_ArgumentError, \"ArgumentError\"},\n {&__pyx_n_Float64, \"Float64\"},\n {&__pyx_n_Int, \"Int\"},\n {&__pyx_n_MT19937, \"MT19937\"},\n {&__pyx_n_ValueError, \"ValueError\"},\n {&__pyx_n___RandomState_ctor, \"__RandomState_ctor\"},\n {&__pyx_n__rand, \"_rand\"},\n {&__pyx_n__sp, \"_sp\"},\n {&__pyx_n_add, \"add\"},\n {&__pyx_n_append, \"append\"},\n {&__pyx_n_arange, \"arange\"},\n {&__pyx_n_array, \"array\"},\n {&__pyx_n_beta, \"beta\"},\n {&__pyx_n_binomial, \"binomial\"},\n {&__pyx_n_bytes, \"bytes\"},\n {&__pyx_n_chisquare, \"chisquare\"},\n {&__pyx_n_empty, \"empty\"},\n {&__pyx_n_exponential, \"exponential\"},\n {&__pyx_n_f, \"f\"},\n {&__pyx_n_gamma, \"gamma\"},\n {&__pyx_n_geometric, \"geometric\"},\n {&__pyx_n_get_state, \"get_state\"},\n {&__pyx_n_gumbel, \"gumbel\"},\n {&__pyx_n_hypergeometric, \"hypergeometric\"},\n {&__pyx_n_int, \"int\"},\n {&__pyx_n_isinstance, \"isinstance\"},\n {&__pyx_n_laplace, \"laplace\"},\n {&__pyx_n_len, \"len\"},\n {&__pyx_n_list, \"list\"},\n {&__pyx_n_logistic, \"logistic\"},\n {&__pyx_n_lognormal, \"lognormal\"},\n {&__pyx_n_logseries, \"logseries\"},\n {&__pyx_n_matrixmultiply, \"matrixmultiply\"},\n {&__pyx_n_multinomial, \"multinomial\"},\n {&__pyx_n_multiply, \"multiply\"},\n {&__pyx_n_multivariate_normal, \"multivariate_normal\"},\n {&__pyx_n_negative_binomial, \"negative_binomial\"},\n {&__pyx_n_noncentral_chisquare, \"noncentral_chisquare\"},\n {&__pyx_n_noncentral_f, \"noncentral_f\"},\n {&__pyx_n_normal, \"normal\"},\n {&__pyx_n_numpy, \"numpy\"},\n {&__pyx_n_pareto, \"pareto\"},\n {&__pyx_n_permutation, \"permutation\"},\n {&__pyx_n_poisson, \"poisson\"},\n {&__pyx_n_power, \"power\"},\n {&__pyx_n_rand, \"rand\"},\n {&__pyx_n_randint, \"randint\"},\n {&__pyx_n_randn, \"randn\"},\n {&__pyx_n_random, \"random\"},\n {&__pyx_n_random_integers, \"random_integers\"},\n {&__pyx_n_random_sample, \"random_sample\"},\n {&__pyx_n_rayleigh, \"rayleigh\"},\n {&__pyx_n_reduce, \"reduce\"},\n {&__pyx_n_seed, \"seed\"},\n {&__pyx_n_set_state, \"set_state\"},\n {&__pyx_n_shape, \"shape\"},\n {&__pyx_n_shuffle, \"shuffle\"},\n {&__pyx_n_size, \"size\"},\n {&__pyx_n_sqrt, \"sqrt\"},\n {&__pyx_n_standard_cauchy, \"standard_cauchy\"},\n {&__pyx_n_standard_exponential, \"standard_exponential\"},\n {&__pyx_n_standard_gamma, \"standard_gamma\"},\n {&__pyx_n_standard_normal, \"standard_normal\"},\n {&__pyx_n_standard_t, \"standard_t\"},\n {&__pyx_n_svd, \"svd\"},\n {&__pyx_n_triangular, \"triangular\"},\n {&__pyx_n_tuple, \"tuple\"},\n {&__pyx_n_type, \"type\"},\n {&__pyx_n_uniform, \"uniform\"},\n {&__pyx_n_vonmises, \"vonmises\"},\n {&__pyx_n_wald, \"wald\"},\n {&__pyx_n_weibull, \"weibull\"},\n {&__pyx_n_zeros, \"zeros\"},\n {&__pyx_n_zipf, \"zipf\"},\n {0, 0}\n};\n\nstatic __Pyx_StringTabEntry __pyx_string_tab[] = {\n {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)},\n {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)},\n {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)},\n {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)},\n {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)},\n {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)},\n {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)},\n {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)},\n {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)},\n {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)},\n {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)},\n {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)},\n {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)},\n {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)},\n {&__pyx_k77p, __pyx_k77, sizeof(__pyx_k77)},\n {&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},\n {&__pyx_k79p, __pyx_k79, sizeof(__pyx_k79)},\n {&__pyx_k80p, __pyx_k80, sizeof(__pyx_k80)},\n {&__pyx_k81p, __pyx_k81, sizeof(__pyx_k81)},\n {&__pyx_k82p, __pyx_k82, sizeof(__pyx_k82)},\n {&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},\n {&__pyx_k84p, __pyx_k84, sizeof(__pyx_k84)},\n {&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},\n {&__pyx_k86p, __pyx_k86, sizeof(__pyx_k86)},\n {&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},\n {&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},\n {&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},\n {&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},\n {&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},\n {&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},\n {&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},\n {&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},\n {&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},\n {&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},\n {&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},\n {&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},\n {&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},\n {&__pyx_k100p, __pyx_k100, sizeof(__pyx_k100)},\n {&__pyx_k101p, __pyx_k101, sizeof(__pyx_k101)},\n {&__pyx_k102p, __pyx_k102, sizeof(__pyx_k102)},\n {&__pyx_k103p, __pyx_k103, sizeof(__pyx_k103)},\n {&__pyx_k104p, __pyx_k104, sizeof(__pyx_k104)},\n {&__pyx_k105p, __pyx_k105, sizeof(__pyx_k105)},\n {&__pyx_k106p, __pyx_k106, sizeof(__pyx_k106)},\n {&__pyx_k107p, __pyx_k107, sizeof(__pyx_k107)},\n {&__pyx_k108p, __pyx_k108, sizeof(__pyx_k108)},\n {&__pyx_k109p, __pyx_k109, sizeof(__pyx_k109)},\n {&__pyx_k110p, __pyx_k110, sizeof(__pyx_k110)},\n {&__pyx_k111p, __pyx_k111, sizeof(__pyx_k111)},\n {&__pyx_k112p, __pyx_k112, sizeof(__pyx_k112)},\n {&__pyx_k113p, __pyx_k113, sizeof(__pyx_k113)},\n {&__pyx_k114p, __pyx_k114, sizeof(__pyx_k114)},\n {&__pyx_k115p, __pyx_k115, sizeof(__pyx_k115)},\n {&__pyx_k117p, __pyx_k117, sizeof(__pyx_k117)},\n {0, 0, 0}\n};\n\nstatic PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k) {\n PyObject *o = (*t->tp_alloc)(t, 0);\n struct __pyx_obj_6mtrand_RandomState *p = (struct __pyx_obj_6mtrand_RandomState *)o;\n return o;\n}\n\nstatic void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {\n {\n PyObject *etype, *eval, *etb;\n PyErr_Fetch(&etype, &eval, &etb);\n ++o->ob_refcnt;\n __pyx_f_6mtrand_11RandomState___dealloc__(o);\n if (PyErr_Occurred()) PyErr_WriteUnraisable(o);\n --o->ob_refcnt;\n PyErr_Restore(etype, eval, etb);\n }\n (*o->ob_type->tp_free)(o);\n}\n\nstatic int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) {\n return 0;\n}\n\nstatic int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) {\n return 0;\n}\n\nstatic struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = {\n {\"seed\", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed},\n {\"get_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state},\n {\"set_state\", (PyCFunction)__pyx_f_6mtrand_11RandomState_set_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_set_state},\n {\"__getstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___getstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__setstate__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___setstate__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"__reduce__\", (PyCFunction)__pyx_f_6mtrand_11RandomState___reduce__, METH_VARARGS|METH_KEYWORDS, 0},\n {\"random_sample\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_sample, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_sample},\n {\"tomaxint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_tomaxint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_tomaxint},\n {\"randint\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randint},\n {\"bytes\", (PyCFunction)__pyx_f_6mtrand_11RandomState_bytes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_bytes},\n {\"uniform\", (PyCFunction)__pyx_f_6mtrand_11RandomState_uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_uniform},\n {\"rand\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rand},\n {\"randn\", (PyCFunction)__pyx_f_6mtrand_11RandomState_randn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_randn},\n {\"random_integers\", (PyCFunction)__pyx_f_6mtrand_11RandomState_random_integers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_random_integers},\n {\"standard_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_normal},\n {\"normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_normal},\n {\"beta\", (PyCFunction)__pyx_f_6mtrand_11RandomState_beta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_beta},\n {\"exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_exponential},\n {\"standard_exponential\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_exponential, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_exponential},\n {\"standard_gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_gamma},\n {\"gamma\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gamma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gamma},\n {\"f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_f},\n {\"noncentral_f\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_f},\n {\"chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_chisquare},\n {\"noncentral_chisquare\", (PyCFunction)__pyx_f_6mtrand_11RandomState_noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_noncentral_chisquare},\n {\"standard_cauchy\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_cauchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_cauchy},\n {\"standard_t\", (PyCFunction)__pyx_f_6mtrand_11RandomState_standard_t, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_standard_t},\n {\"vonmises\", (PyCFunction)__pyx_f_6mtrand_11RandomState_vonmises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_vonmises},\n {\"pareto\", (PyCFunction)__pyx_f_6mtrand_11RandomState_pareto, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_pareto},\n {\"weibull\", (PyCFunction)__pyx_f_6mtrand_11RandomState_weibull, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_weibull},\n {\"power\", (PyCFunction)__pyx_f_6mtrand_11RandomState_power, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_power},\n {\"laplace\", (PyCFunction)__pyx_f_6mtrand_11RandomState_laplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_laplace},\n {\"gumbel\", (PyCFunction)__pyx_f_6mtrand_11RandomState_gumbel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_gumbel},\n {\"logistic\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logistic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logistic},\n {\"lognormal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_lognormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_lognormal},\n {\"rayleigh\", (PyCFunction)__pyx_f_6mtrand_11RandomState_rayleigh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_rayleigh},\n {\"wald\", (PyCFunction)__pyx_f_6mtrand_11RandomState_wald, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_wald},\n {\"triangular\", (PyCFunction)__pyx_f_6mtrand_11RandomState_triangular, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_triangular},\n {\"binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_binomial},\n {\"negative_binomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_negative_binomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_negative_binomial},\n {\"poisson\", (PyCFunction)__pyx_f_6mtrand_11RandomState_poisson, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_poisson},\n {\"zipf\", (PyCFunction)__pyx_f_6mtrand_11RandomState_zipf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_zipf},\n {\"geometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_geometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_geometric},\n {\"hypergeometric\", (PyCFunction)__pyx_f_6mtrand_11RandomState_hypergeometric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_hypergeometric},\n {\"logseries\", (PyCFunction)__pyx_f_6mtrand_11RandomState_logseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_logseries},\n {\"multivariate_normal\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multivariate_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multivariate_normal},\n {\"multinomial\", (PyCFunction)__pyx_f_6mtrand_11RandomState_multinomial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_multinomial},\n {\"shuffle\", (PyCFunction)__pyx_f_6mtrand_11RandomState_shuffle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_shuffle},\n {\"permutation\", (PyCFunction)__pyx_f_6mtrand_11RandomState_permutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_permutation},\n {0, 0, 0, 0}\n};\n\nstatic PyNumberMethods __pyx_tp_as_number_RandomState = {\n 0, /*nb_add*/\n 0, /*nb_subtract*/\n 0, /*nb_multiply*/\n 0, /*nb_divide*/\n 0, /*nb_remainder*/\n 0, /*nb_divmod*/\n 0, /*nb_power*/\n 0, /*nb_negative*/\n 0, /*nb_positive*/\n 0, /*nb_absolute*/\n 0, /*nb_nonzero*/\n 0, /*nb_invert*/\n 0, /*nb_lshift*/\n 0, /*nb_rshift*/\n 0, /*nb_and*/\n 0, /*nb_xor*/\n 0, /*nb_or*/\n 0, /*nb_coerce*/\n 0, /*nb_int*/\n 0, /*nb_long*/\n 0, /*nb_float*/\n 0, /*nb_oct*/\n 0, /*nb_hex*/\n 0, /*nb_inplace_add*/\n 0, /*nb_inplace_subtract*/\n 0, /*nb_inplace_multiply*/\n 0, /*nb_inplace_divide*/\n 0, /*nb_inplace_remainder*/\n 0, /*nb_inplace_power*/\n 0, /*nb_inplace_lshift*/\n 0, /*nb_inplace_rshift*/\n 0, /*nb_inplace_and*/\n 0, /*nb_inplace_xor*/\n 0, /*nb_inplace_or*/\n 0, /*nb_floor_divide*/\n 0, /*nb_true_divide*/\n 0, /*nb_inplace_floor_divide*/\n 0, /*nb_inplace_true_divide*/\n};\n\nstatic PySequenceMethods __pyx_tp_as_sequence_RandomState = {\n 0, /*sq_length*/\n 0, /*sq_concat*/\n 0, /*sq_repeat*/\n 0, /*sq_item*/\n 0, /*sq_slice*/\n 0, /*sq_ass_item*/\n 0, /*sq_ass_slice*/\n 0, /*sq_contains*/\n 0, /*sq_inplace_concat*/\n 0, /*sq_inplace_repeat*/\n};\n\nstatic PyMappingMethods __pyx_tp_as_mapping_RandomState = {\n 0, /*mp_length*/\n 0, /*mp_subscript*/\n 0, /*mp_ass_subscript*/\n};\n\nstatic PyBufferProcs __pyx_tp_as_buffer_RandomState = {\n 0, /*bf_getreadbuffer*/\n 0, /*bf_getwritebuffer*/\n 0, /*bf_getsegcount*/\n 0, /*bf_getcharbuffer*/\n};\n\nstatichere PyTypeObject __pyx_type_6mtrand_RandomState = {\n PyObject_HEAD_INIT(0)\n 0, /*ob_size*/\n \"mtrand.RandomState\", /*tp_name*/\n sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/\n 0, /*tp_itemsize*/\n __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/\n 0, /*tp_print*/\n 0, /*tp_getattr*/\n 0, /*tp_setattr*/\n 0, /*tp_compare*/\n 0, /*tp_repr*/\n &__pyx_tp_as_number_RandomState, /*tp_as_number*/\n &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/\n &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/\n 0, /*tp_hash*/\n 0, /*tp_call*/\n 0, /*tp_str*/\n 0, /*tp_getattro*/\n 0, /*tp_setattro*/\n &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/\n Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/\n \"Container for the Mersenne Twister PRNG.\\n\\n Constructor\\n -----------\\n RandomState(seed=None): initializes the PRNG with the given seed. See the\\n seed() method for details.\\n\\n Distribution Methods\\n -----------------\\n RandomState exposes a number of methods for generating random numbers drawn\\n from a variety of probability distributions. In addition to the\\n distribution-specific arguments, each method takes a keyword argument\\n size=None. If size is None, then a single value is generated and returned.\\n If size is an integer, then a 1-D numpy array filled with generated values\\n is returned. If size is a tuple, then a numpy array with that shape is\\n filled and returned.\\n \", /*tp_doc*/\n __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/\n __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/\n 0, /*tp_richcompare*/\n 0, /*tp_weaklistoffset*/\n 0, /*tp_iter*/\n 0, /*tp_iternext*/\n __pyx_methods_6mtrand_RandomState, /*tp_methods*/\n 0, /*tp_members*/\n 0, /*tp_getset*/\n 0, /*tp_base*/\n 0, /*tp_dict*/\n 0, /*tp_descr_get*/\n 0, /*tp_descr_set*/\n 0, /*tp_dictoffset*/\n __pyx_f_6mtrand_11RandomState___init__, /*tp_init*/\n 0, /*tp_alloc*/\n __pyx_tp_new_6mtrand_RandomState, /*tp_new*/\n 0, /*tp_free*/\n 0, /*tp_is_gc*/\n 0, /*tp_bases*/\n 0, /*tp_mro*/\n 0, /*tp_cache*/\n 0, /*tp_subclasses*/\n 0, /*tp_weaklist*/\n};\n\nstatic struct PyMethodDef __pyx_methods[] = {\n {0, 0, 0, 0}\n};\n\nDL_EXPORT(void) initmtrand(void); /*proto*/\nDL_EXPORT(void) initmtrand(void) {\n PyObject *__pyx_1 = 0;\n PyObject *__pyx_2 = 0;\n __pyx_m = Py_InitModule4(\"mtrand\", __pyx_methods, 0, 0, PYTHON_API_VERSION);\n if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_b = PyImport_AddModule(\"__builtin__\");\n if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (PyObject_SetAttrString(__pyx_m, \"__builtins__\", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;};\n __pyx_ptype_6mtrand_dtypedescr = __Pyx_ImportType(\"numpy\", \"dtypedescr\", sizeof(PyArray_Descr)); if (!__pyx_ptype_6mtrand_dtypedescr) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; goto __pyx_L1;}\n __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType(\"numpy\", \"ndarray\", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}\n if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n if (PyObject_SetAttrString(__pyx_m, \"RandomState\", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; goto __pyx_L1;}\n __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":118 */\n import_array();\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":120 */\n __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":286 */\n Py_INCREF(Py_None);\n __pyx_k2 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":295 */\n Py_INCREF(Py_None);\n __pyx_k3 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":356 */\n Py_INCREF(Py_None);\n __pyx_k4 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":363 */\n Py_INCREF(Py_None);\n __pyx_k5 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":370 */\n Py_INCREF(Py_None);\n __pyx_k6 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k7 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":416 */\n __pyx_k8 = 0.0;\n __pyx_k9 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k10 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":446 */\n Py_INCREF(Py_None);\n __pyx_k11 = Py_None;\n Py_INCREF(Py_None);\n __pyx_k12 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":459 */\n Py_INCREF(Py_None);\n __pyx_k13 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":466 */\n __pyx_k14 = 0.0;\n __pyx_k15 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k16 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":475 */\n Py_INCREF(Py_None);\n __pyx_k17 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":486 */\n __pyx_k18 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k19 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":495 */\n Py_INCREF(Py_None);\n __pyx_k20 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":502 */\n Py_INCREF(Py_None);\n __pyx_k21 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":511 */\n __pyx_k22 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k23 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":522 */\n Py_INCREF(Py_None);\n __pyx_k24 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":533 */\n Py_INCREF(Py_None);\n __pyx_k25 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":547 */\n Py_INCREF(Py_None);\n __pyx_k26 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":556 */\n Py_INCREF(Py_None);\n __pyx_k27 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":568 */\n Py_INCREF(Py_None);\n __pyx_k28 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":575 */\n Py_INCREF(Py_None);\n __pyx_k29 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":584 */\n Py_INCREF(Py_None);\n __pyx_k30 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":594 */\n Py_INCREF(Py_None);\n __pyx_k31 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":603 */\n Py_INCREF(Py_None);\n __pyx_k32 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":612 */\n Py_INCREF(Py_None);\n __pyx_k33 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":621 */\n __pyx_k34 = 0.0;\n __pyx_k35 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k36 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":630 */\n __pyx_k37 = 0.0;\n __pyx_k38 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k39 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":639 */\n __pyx_k40 = 0.0;\n __pyx_k41 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k42 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":648 */\n __pyx_k43 = 0.0;\n __pyx_k44 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k45 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":662 */\n __pyx_k46 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k47 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":671 */\n Py_INCREF(Py_None);\n __pyx_k48 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":682 */\n Py_INCREF(Py_None);\n __pyx_k49 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":698 */\n Py_INCREF(Py_None);\n __pyx_k50 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":711 */\n Py_INCREF(Py_None);\n __pyx_k51 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":725 */\n __pyx_k52 = 1.0;\n Py_INCREF(Py_None);\n __pyx_k53 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":734 */\n Py_INCREF(Py_None);\n __pyx_k54 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":743 */\n Py_INCREF(Py_None);\n __pyx_k55 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":755 */\n Py_INCREF(Py_None);\n __pyx_k56 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":776 */\n Py_INCREF(Py_None);\n __pyx_k57 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":788 */\n Py_INCREF(Py_None);\n __pyx_k58 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":846 */\n Py_INCREF(Py_None);\n __pyx_k59 = Py_None;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":924 */\n __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":925 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_seed); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":926 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_get_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":927 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set_state); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":928 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_sample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":929 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":930 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":931 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_uniform); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":932 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rand); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":933 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_randn); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":934 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random_integers); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":935 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":936 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":937 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_beta); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":938 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":939 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_exponential); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":940 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":941 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gamma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":942 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":943 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_f); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":944 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":945 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_noncentral_chisquare); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":946 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_cauchy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":947 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_standard_t); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":948 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_vonmises); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":949 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_pareto); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":950 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_weibull); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":951 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_power); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":952 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_laplace); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":953 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_gumbel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":954 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logistic); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":955 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_lognormal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":956 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_rayleigh); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":957 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_wald); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":958 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_triangular); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":960 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":961 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_negative_binomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":962 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_poisson); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":963 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_zipf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":964 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_geometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":965 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_hypergeometric); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":966 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_logseries); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":968 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multivariate_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":969 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_multinomial); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":971 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n\n /* \"/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx\":972 */\n __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_permutation); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_1); __pyx_1 = 0;\n if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; goto __pyx_L1;}\n Py_DECREF(__pyx_2); __pyx_2 = 0;\n return;\n __pyx_L1:;\n Py_XDECREF(__pyx_1);\n Py_XDECREF(__pyx_2);\n __Pyx_AddTraceback(\"mtrand\");\n}\n\nstatic char *__pyx_filenames[] = {\n \"mtrand.pyx\",\n \"numpy.pxi\",\n};\nstatichere char **__pyx_f = __pyx_filenames;\n\n/* Runtime support code */\n\nstatic int __Pyx_GetStarArgs(\n PyObject **args, \n PyObject **kwds,\n char *kwd_list[], \n int nargs,\n PyObject **args2, \n PyObject **kwds2)\n{\n PyObject *x = 0, *args1 = 0, *kwds1 = 0;\n \n if (args2)\n *args2 = 0;\n if (kwds2)\n *kwds2 = 0;\n \n if (args2) {\n args1 = PyTuple_GetSlice(*args, 0, nargs);\n if (!args1)\n goto bad;\n *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_Size(*args));\n if (!*args2)\n goto bad;\n }\n else {\n args1 = *args;\n Py_INCREF(args1);\n }\n \n if (kwds2) {\n if (*kwds) {\n char **p;\n kwds1 = PyDict_New();\n if (!kwds)\n goto bad;\n *kwds2 = PyDict_Copy(*kwds);\n if (!*kwds2)\n goto bad;\n for (p = kwd_list; *p; p++) {\n x = PyDict_GetItemString(*kwds, *p);\n if (x) {\n if (PyDict_SetItemString(kwds1, *p, x) < 0)\n goto bad;\n if (PyDict_DelItemString(*kwds2, *p) < 0)\n goto bad;\n }\n }\n }\n else {\n *kwds2 = PyDict_New();\n if (!*kwds2)\n goto bad;\n }\n }\n else {\n kwds1 = *kwds;\n Py_XINCREF(kwds1);\n }\n \n *args = args1;\n *kwds = kwds1;\n return 0;\nbad:\n Py_XDECREF(args1);\n Py_XDECREF(kwds1);\n Py_XDECREF(*args2);\n Py_XDECREF(*kwds2);\n return -1;\n}\n\nstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {\n PyObject *__import__ = 0;\n PyObject *empty_list = 0;\n PyObject *module = 0;\n PyObject *global_dict = 0;\n PyObject *empty_dict = 0;\n PyObject *list;\n __import__ = PyObject_GetAttrString(__pyx_b, \"__import__\");\n if (!__import__)\n goto bad;\n if (from_list)\n list = from_list;\n else {\n empty_list = PyList_New(0);\n if (!empty_list)\n goto bad;\n list = empty_list;\n }\n global_dict = PyModule_GetDict(__pyx_m);\n if (!global_dict)\n goto bad;\n empty_dict = PyDict_New();\n if (!empty_dict)\n goto bad;\n module = PyObject_CallFunction(__import__, \"OOOO\",\n name, global_dict, empty_dict, list);\nbad:\n Py_XDECREF(empty_list);\n Py_XDECREF(__import__);\n Py_XDECREF(empty_dict);\n return module;\n}\n\nstatic PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {\n PyObject *result;\n result = PyObject_GetAttr(dict, name);\n if (!result)\n PyErr_SetObject(PyExc_NameError, name);\n return result;\n}\n\nstatic void __Pyx_WriteUnraisable(char *name) {\n PyObject *old_exc, *old_val, *old_tb;\n PyObject *ctx;\n PyErr_Fetch(&old_exc, &old_val, &old_tb);\n ctx = PyString_FromString(name);\n PyErr_Restore(old_exc, old_val, old_tb);\n if (!ctx)\n ctx = Py_None;\n PyErr_WriteUnraisable(ctx);\n}\n\nstatic void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {\n Py_XINCREF(type);\n Py_XINCREF(value);\n Py_XINCREF(tb);\n /* First, check the traceback argument, replacing None with NULL. */\n if (tb == Py_None) {\n Py_DECREF(tb);\n tb = 0;\n }\n else if (tb != NULL && !PyTraceBack_Check(tb)) {\n PyErr_SetString(PyExc_TypeError,\n \"raise: arg 3 must be a traceback or None\");\n goto raise_error;\n }\n /* Next, replace a missing value with None */\n if (value == NULL) {\n value = Py_None;\n Py_INCREF(value);\n }\n /* Next, repeatedly, replace a tuple exception with its first item */\n while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {\n PyObject *tmp = type;\n type = PyTuple_GET_ITEM(type, 0);\n Py_INCREF(type);\n Py_DECREF(tmp);\n }\n if (PyString_Check(type))\n ;\n else if (PyClass_Check(type))\n ; /*PyErr_NormalizeException(&type, &value, &tb);*/\n else if (PyInstance_Check(type)) {\n /* Raising an instance. The value should be a dummy. */\n if (value != Py_None) {\n PyErr_SetString(PyExc_TypeError,\n \"instance exception may not have a separate value\");\n goto raise_error;\n }\n else {\n /* Normalize to raise , */\n Py_DECREF(value);\n value = type;\n type = (PyObject*) ((PyInstanceObject*)type)->in_class;\n Py_INCREF(type);\n }\n }\n else {\n /* Not something you can raise. You get an exception\n anyway, just not what you specified :-) */\n PyErr_Format(PyExc_TypeError,\n \"exceptions must be strings, classes, or \"\n \"instances, not %s\", type->ob_type->tp_name);\n goto raise_error;\n }\n PyErr_Restore(type, value, tb);\n return;\nraise_error:\n Py_XDECREF(value);\n Py_XDECREF(type);\n Py_XDECREF(tb);\n return;\n}\n\nstatic void __Pyx_UnpackError(void) {\n PyErr_SetString(PyExc_ValueError, \"unpack sequence of wrong size\");\n}\n\nstatic PyObject *__Pyx_UnpackItem(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (!item) {\n if (PyErr_ExceptionMatches(PyExc_IndexError))\n __Pyx_UnpackError();\n }\n return item;\n}\n\nstatic int __Pyx_EndUnpack(PyObject *seq, int i) {\n PyObject *item = PySequence_GetItem(seq, i);\n if (item) {\n Py_DECREF(item);\n __Pyx_UnpackError();\n return -1;\n }\n PyErr_Clear();\n return 0;\n}\n\nstatic int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {\n while (t->p) {\n *t->p = PyString_InternFromString(t->s);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {\n while (t->p) {\n *t->p = PyString_FromStringAndSize(t->s, t->n - 1);\n if (!*t->p)\n return -1;\n ++t;\n }\n return 0;\n}\n\nstatic PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, \n long size) \n{\n PyObject *py_module_name = 0;\n PyObject *py_class_name = 0;\n PyObject *py_name_list = 0;\n PyObject *py_module = 0;\n PyObject *result = 0;\n \n py_module_name = PyString_FromString(module_name);\n if (!py_module_name)\n goto bad;\n py_class_name = PyString_FromString(class_name);\n if (!py_class_name)\n goto bad;\n py_name_list = PyList_New(1);\n if (!py_name_list)\n goto bad;\n Py_INCREF(py_class_name);\n if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)\n goto bad;\n py_module = __Pyx_Import(py_module_name, py_name_list);\n if (!py_module)\n goto bad;\n result = PyObject_GetAttr(py_module, py_class_name);\n if (!result)\n goto bad;\n if (!PyType_Check(result)) {\n PyErr_Format(PyExc_TypeError, \n \"%s.%s is not a type object\",\n module_name, class_name);\n goto bad;\n }\n if (((PyTypeObject *)result)->tp_basicsize != size) {\n PyErr_Format(PyExc_ValueError, \n \"%s.%s does not appear to be the correct type object\",\n module_name, class_name);\n goto bad;\n }\n goto done;\nbad:\n Py_XDECREF(result);\n result = 0;\ndone:\n Py_XDECREF(py_module_name);\n Py_XDECREF(py_class_name);\n Py_XDECREF(py_name_list);\n return (PyTypeObject *)result;\n}\n\n#include \"compile.h\"\n#include \"frameobject.h\"\n#include \"traceback.h\"\n\nstatic void __Pyx_AddTraceback(char *funcname) {\n PyObject *py_srcfile = 0;\n PyObject *py_funcname = 0;\n PyObject *py_globals = 0;\n PyObject *empty_tuple = 0;\n PyObject *empty_string = 0;\n PyCodeObject *py_code = 0;\n PyFrameObject *py_frame = 0;\n \n py_srcfile = PyString_FromString(__pyx_filename);\n if (!py_srcfile) goto bad;\n py_funcname = PyString_FromString(funcname);\n if (!py_funcname) goto bad;\n py_globals = PyModule_GetDict(__pyx_m);\n if (!py_globals) goto bad;\n empty_tuple = PyTuple_New(0);\n if (!empty_tuple) goto bad;\n empty_string = PyString_FromString(\"\");\n if (!empty_string) goto bad;\n py_code = PyCode_New(\n 0, /*int argcount,*/\n 0, /*int nlocals,*/\n 0, /*int stacksize,*/\n 0, /*int flags,*/\n empty_string, /*PyObject *code,*/\n empty_tuple, /*PyObject *consts,*/\n empty_tuple, /*PyObject *names,*/\n empty_tuple, /*PyObject *varnames,*/\n empty_tuple, /*PyObject *freevars,*/\n empty_tuple, /*PyObject *cellvars,*/\n py_srcfile, /*PyObject *filename,*/\n py_funcname, /*PyObject *name,*/\n __pyx_lineno, /*int firstlineno,*/\n empty_string /*PyObject *lnotab*/\n );\n if (!py_code) goto bad;\n py_frame = PyFrame_New(\n PyThreadState_Get(), /*PyThreadState *tstate,*/\n py_code, /*PyCodeObject *code,*/\n py_globals, /*PyObject *globals,*/\n 0 /*PyObject *locals*/\n );\n if (!py_frame) goto bad;\n py_frame->f_lineno = __pyx_lineno;\n PyTraceBack_Here(py_frame);\nbad:\n Py_XDECREF(py_srcfile);\n Py_XDECREF(py_funcname);\n Py_XDECREF(empty_tuple);\n Py_XDECREF(empty_string);\n Py_XDECREF(py_code);\n Py_XDECREF(py_frame);\n}\n", + "methods": [ + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "__pyx_f_6mtrand_cont0_array", + "long_name": "__pyx_f_6mtrand_cont0_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont1_array", + "long_name": "__pyx_f_6mtrand_cont1_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 251, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont2_array", + "long_name": "__pyx_f_6mtrand_cont2_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b" + ], + "start_line": 331, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_cont3_array", + "long_name": "__pyx_f_6mtrand_cont3_array( rk_state(*__pyx_v_state) , double((*__pyx_v_func)(rk_state(*),double,double,double)) , PyObject * __pyx_v_size , double __pyx_v_a , double __pyx_v_b , double __pyx_v_c)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "double", + "__pyx_v_size", + "__pyx_v_a", + "__pyx_v_b", + "__pyx_v_c" + ], + "start_line": 411, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_disc0_array", + "long_name": "__pyx_f_6mtrand_disc0_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*))) , PyObject * __pyx_v_size)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 562, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size" + ], + "start_line": 493, + "end_line": 571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnp_array", + "long_name": "__pyx_f_6mtrand_discnp_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,double)) , PyObject * __pyx_v_size , long __pyx_v_n , double __pyx_v_p)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 580, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_p" + ], + "start_line": 573, + "end_line": 651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discnmN_array", + "long_name": "__pyx_f_6mtrand_discnmN_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),long,long,long)) , PyObject * __pyx_v_size , long __pyx_v_n , long __pyx_v_m , long __pyx_v_N)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 589, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_n", + "__pyx_v_m", + "__pyx_v_N" + ], + "start_line": 653, + "end_line": 731, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_discd_array", + "long_name": "__pyx_f_6mtrand_discd_array( rk_state(*__pyx_v_state) , long((*__pyx_v_func)(rk_state(*),double)) , PyObject * __pyx_v_size , double __pyx_v_a)", + "filename": "mtrand.c", + "nloc": 62, + "complexity": 10, + "token_count": 571, + "parameters": [ + "rk_state", + "long", + "__pyx_v_size", + "__pyx_v_a" + ], + "start_line": 733, + "end_line": 811, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_kahan_sum", + "long_name": "__pyx_f_6mtrand_kahan_sum( double(*__pyx_v_darr) , long __pyx_v_n)", + "filename": "mtrand.c", + "nloc": 23, + "complexity": 2, + "token_count": 121, + "parameters": [ + "double", + "__pyx_v_n" + ], + "start_line": 813, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___init__", + "long_name": "__pyx_f_6mtrand_11RandomState___init__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 33, + "complexity": 5, + "token_count": 300, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 855, + "end_line": 892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___dealloc__", + "long_name": "__pyx_f_6mtrand_11RandomState___dealloc__( PyObject * __pyx_v_self)", + "filename": "mtrand.c", + "nloc": 14, + "complexity": 2, + "token_count": 75, + "parameters": [ + "__pyx_v_self" + ], + "start_line": 895, + "end_line": 913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_seed", + "long_name": "__pyx_f_6mtrand_11RandomState_seed( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 10, + "token_count": 563, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 920, + "end_line": 990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_get_state", + "long_name": "__pyx_f_6mtrand_11RandomState_get_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 56, + "complexity": 11, + "token_count": 637, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 997, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_set_state", + "long_name": "__pyx_f_6mtrand_11RandomState_set_state( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 991, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1071, + "end_line": 1178, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 108, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___getstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___getstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 5, + "token_count": 238, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1181, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___setstate__", + "long_name": "__pyx_f_6mtrand_11RandomState___setstate__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 5, + "token_count": 271, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1214, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState___reduce__", + "long_name": "__pyx_f_6mtrand_11RandomState___reduce__( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 10, + "token_count": 463, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1253, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_sample", + "long_name": "__pyx_f_6mtrand_11RandomState_random_sample( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1304, + "end_line": 1330, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_tomaxint", + "long_name": "__pyx_f_6mtrand_11RandomState_tomaxint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1334, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randint", + "long_name": "__pyx_f_6mtrand_11RandomState_randint( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 109, + "complexity": 19, + "token_count": 1001, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1368, + "end_line": 1509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 142, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_bytes", + "long_name": "__pyx_f_6mtrand_11RandomState_bytes( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 31, + "complexity": 3, + "token_count": 223, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1513, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_uniform", + "long_name": "__pyx_f_6mtrand_11RandomState_uniform( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 28, + "complexity": 3, + "token_count": 208, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1558, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rand", + "long_name": "__pyx_f_6mtrand_11RandomState_rand( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 70, + "complexity": 17, + "token_count": 715, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1596, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 77, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_randn", + "long_name": "__pyx_f_6mtrand_11RandomState_randn( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 67, + "complexity": 15, + "token_count": 651, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1676, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 74, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_random_integers", + "long_name": "__pyx_f_6mtrand_11RandomState_random_integers( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 9, + "token_count": 493, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1753, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1826, + "end_line": 1852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1860, + "end_line": 1914, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_beta", + "long_name": "__pyx_f_6mtrand_11RandomState_beta( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 1924, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2000, + "end_line": 2052, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_exponential", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_exponential( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2056, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2090, + "end_line": 2141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gamma", + "long_name": "__pyx_f_6mtrand_11RandomState_gamma( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 11, + "token_count": 570, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2151, + "end_line": 2220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 70, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_f", + "long_name": "__pyx_f_6mtrand_11RandomState_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2230, + "end_line": 2298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_f", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_f( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2310, + "end_line": 2395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2403, + "end_line": 2454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare", + "long_name": "__pyx_f_6mtrand_11RandomState_noncentral_chisquare( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2464, + "end_line": 2532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_cauchy", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_cauchy( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 24, + "complexity": 3, + "token_count": 176, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2536, + "end_line": 2562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_standard_t", + "long_name": "__pyx_f_6mtrand_11RandomState_standard_t( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2570, + "end_line": 2621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_vonmises", + "long_name": "__pyx_f_6mtrand_11RandomState_vonmises( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 395, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2629, + "end_line": 2681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_pareto", + "long_name": "__pyx_f_6mtrand_11RandomState_pareto( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2689, + "end_line": 2740, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_weibull", + "long_name": "__pyx_f_6mtrand_11RandomState_weibull( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2748, + "end_line": 2799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_power", + "long_name": "__pyx_f_6mtrand_11RandomState_power( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2807, + "end_line": 2858, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_laplace", + "long_name": "__pyx_f_6mtrand_11RandomState_laplace( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2866, + "end_line": 2920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_gumbel", + "long_name": "__pyx_f_6mtrand_11RandomState_gumbel( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2928, + "end_line": 2982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logistic", + "long_name": "__pyx_f_6mtrand_11RandomState_logistic( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 2990, + "end_line": 3044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_lognormal", + "long_name": "__pyx_f_6mtrand_11RandomState_lognormal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 7, + "token_count": 403, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3052, + "end_line": 3106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 55, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_rayleigh", + "long_name": "__pyx_f_6mtrand_11RandomState_rayleigh( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3114, + "end_line": 3166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_wald", + "long_name": "__pyx_f_6mtrand_11RandomState_wald( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 60, + "complexity": 11, + "token_count": 566, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3176, + "end_line": 3244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 69, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_triangular", + "long_name": "__pyx_f_6mtrand_11RandomState_triangular( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 75, + "complexity": 15, + "token_count": 747, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3256, + "end_line": 3341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 86, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3353, + "end_line": 3437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_negative_binomial", + "long_name": "__pyx_f_6mtrand_11RandomState_negative_binomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 74, + "complexity": 15, + "token_count": 737, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3449, + "end_line": 3533, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_poisson", + "long_name": "__pyx_f_6mtrand_11RandomState_poisson( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 46, + "complexity": 7, + "token_count": 389, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3541, + "end_line": 3593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_zipf", + "long_name": "__pyx_f_6mtrand_11RandomState_zipf( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 45, + "complexity": 7, + "token_count": 385, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3601, + "end_line": 3652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_geometric", + "long_name": "__pyx_f_6mtrand_11RandomState_geometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3662, + "end_line": 3729, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_hypergeometric", + "long_name": "__pyx_f_6mtrand_11RandomState_hypergeometric( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 89, + "complexity": 19, + "token_count": 922, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3743, + "end_line": 3844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 102, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_logseries", + "long_name": "__pyx_f_6mtrand_11RandomState_logseries( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 59, + "complexity": 11, + "token_count": 556, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3854, + "end_line": 3921, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multivariate_normal", + "long_name": "__pyx_f_6mtrand_11RandomState_multivariate_normal( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 374, + "complexity": 119, + "token_count": 5031, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 3949, + "end_line": 4369, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 421, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_multinomial", + "long_name": "__pyx_f_6mtrand_11RandomState_multinomial( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 177, + "complexity": 35, + "token_count": 1748, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4379, + "end_line": 4608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 230, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_shuffle", + "long_name": "__pyx_f_6mtrand_11RandomState_shuffle( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 61, + "complexity": 18, + "token_count": 723, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4612, + "end_line": 4683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 0 + }, + { + "name": "__pyx_f_6mtrand_11RandomState_permutation", + "long_name": "__pyx_f_6mtrand_11RandomState_permutation( PyObject * __pyx_v_self , PyObject * __pyx_args , PyObject * __pyx_kwds)", + "filename": "mtrand.c", + "nloc": 79, + "complexity": 18, + "token_count": 836, + "parameters": [ + "__pyx_v_self", + "__pyx_args", + "__pyx_kwds" + ], + "start_line": 4689, + "end_line": 4778, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 90, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_new_6mtrand_RandomState", + "long_name": "__pyx_tp_new_6mtrand_RandomState( PyTypeObject * t , PyObject * a , PyObject * k)", + "filename": "mtrand.c", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "t", + "a", + "k" + ], + "start_line": 4916, + "end_line": 4920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_dealloc_6mtrand_RandomState", + "long_name": "__pyx_tp_dealloc_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 12, + "complexity": 2, + "token_count": 79, + "parameters": [ + "o" + ], + "start_line": 4922, + "end_line": 4933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_traverse_6mtrand_RandomState", + "long_name": "__pyx_tp_traverse_6mtrand_RandomState( PyObject * o , visitproc v , * a)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 18, + "parameters": [ + "o", + "v", + "a" + ], + "start_line": 4935, + "end_line": 4937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__pyx_tp_clear_6mtrand_RandomState", + "long_name": "__pyx_tp_clear_6mtrand_RandomState( PyObject * o)", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "o" + ], + "start_line": 4939, + "end_line": 4941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "initmtrand", + "long_name": "initmtrand()", + "filename": "mtrand.c", + "nloc": 355, + "complexity": 150, + "token_count": 5760, + "parameters": [], + "start_line": 5117, + "end_line": 5647, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 531, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetStarArgs", + "long_name": "__Pyx_GetStarArgs( PyObject ** args , PyObject ** kwds , char * kwd_list [ ] , int nargs , PyObject ** args2 , PyObject ** kwds2)", + "filename": "mtrand.c", + "nloc": 64, + "complexity": 15, + "token_count": 314, + "parameters": [ + "args", + "kwds", + "nargs", + "args2", + "kwds2" + ], + "start_line": 5657, + "end_line": 5724, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 68, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Import", + "long_name": "__Pyx_Import( PyObject * name , PyObject * from_list)", + "filename": "mtrand.c", + "nloc": 32, + "complexity": 6, + "token_count": 159, + "parameters": [ + "name", + "from_list" + ], + "start_line": 5726, + "end_line": 5757, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_GetName", + "long_name": "__Pyx_GetName( PyObject * dict , PyObject * name)", + "filename": "mtrand.c", + "nloc": 7, + "complexity": 2, + "token_count": 40, + "parameters": [ + "dict", + "name" + ], + "start_line": 5759, + "end_line": 5765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_WriteUnraisable", + "long_name": "__Pyx_WriteUnraisable( char * name)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 64, + "parameters": [ + "name" + ], + "start_line": 5767, + "end_line": 5776, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_Raise", + "long_name": "__Pyx_Raise( PyObject * type , PyObject * value , PyObject * tb)", + "filename": "mtrand.c", + "nloc": 54, + "complexity": 11, + "token_count": 259, + "parameters": [ + "type", + "value", + "tb" + ], + "start_line": 5778, + "end_line": 5838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackError", + "long_name": "__Pyx_UnpackError()", + "filename": "mtrand.c", + "nloc": 3, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 5840, + "end_line": 5842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_UnpackItem", + "long_name": "__Pyx_UnpackItem( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 8, + "complexity": 3, + "token_count": 43, + "parameters": [ + "seq", + "i" + ], + "start_line": 5844, + "end_line": 5851, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_EndUnpack", + "long_name": "__Pyx_EndUnpack( PyObject * seq , int i)", + "filename": "mtrand.c", + "nloc": 10, + "complexity": 2, + "token_count": 48, + "parameters": [ + "seq", + "i" + ], + "start_line": 5853, + "end_line": 5862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InternStrings", + "long_name": "__Pyx_InternStrings( __Pyx_InternTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 46, + "parameters": [ + "t" + ], + "start_line": 5864, + "end_line": 5872, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_InitStrings", + "long_name": "__Pyx_InitStrings( __Pyx_StringTabEntry * t)", + "filename": "mtrand.c", + "nloc": 9, + "complexity": 3, + "token_count": 52, + "parameters": [ + "t" + ], + "start_line": 5874, + "end_line": 5882, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_ImportType", + "long_name": "__Pyx_ImportType( char * module_name , char * class_name , long size)", + "filename": "mtrand.c", + "nloc": 48, + "complexity": 9, + "token_count": 237, + "parameters": [ + "module_name", + "class_name", + "size" + ], + "start_line": 5884, + "end_line": 5932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 49, + "top_nesting_level": 0 + }, + { + "name": "__Pyx_AddTraceback", + "long_name": "__Pyx_AddTraceback( char * funcname)", + "filename": "mtrand.c", + "nloc": 52, + "complexity": 8, + "token_count": 232, + "parameters": [ + "funcname" + ], + "start_line": 5938, + "end_line": 5990, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 4970, + "complexity": 908, + "token_count": 48058, + "diff_parsed": { + "added": [ + "/* Generated by Pyrex 0.9.3.1 on Thu Jan 5 00:40:10 2006 */", + "static char (__pyx_k115[]) = \"numpy.dual\";" + ], + "deleted": [ + "/* Generated by Pyrex 0.9.3.1 on Wed Jan 4 20:21:15 2006 */", + "static char (__pyx_k115[]) = \"numpy.linalg\";" + ] + } + }, + { + "old_path": "numpy/random/mtrand/mtrand.pyx", + "new_path": "numpy/random/mtrand/mtrand.pyx", + "filename": "mtrand.pyx", + "extension": "pyx", + "change_type": "MODIFY", + "diff": "@@ -832,8 +832,8 @@ def multivariate_normal(self, mean, cov, size=None):\n # Then the matrix products of the rows of x and A has the desired\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n- \n- from numpy.linalg import svd\n+\t\n+ from numpy.dual import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "# mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit\n#\n# Copyright 2005 Robert Kern (robert.kern@gmail.com)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\ninclude \"Python.pxi\"\ninclude \"numpy.pxi\"\n\ncdef extern from \"math.h\":\n double exp(double x)\n double log(double x)\n double floor(double x)\n double sin(double x)\n double cos(double x)\n\ncdef extern from \"randomkit.h\":\n\n ctypedef struct rk_state:\n unsigned long key[624]\n int pos\n\n ctypedef enum rk_error:\n RK_NOERR = 0\n RK_ENODEV = 1\n RK_ERR_MAX = 2\n\n char *rk_strerror[2]\n \n # 0xFFFFFFFFUL\n unsigned long RK_MAX\n\n void rk_seed(unsigned long seed, rk_state *state)\n rk_error rk_randomseed(rk_state *state)\n unsigned long rk_random(rk_state *state)\n long rk_long(rk_state *state)\n unsigned long rk_ulong(rk_state *state)\n unsigned long rk_interval(unsigned long max, rk_state *state)\n double rk_double(rk_state *state)\n void rk_fill(void *buffer, size_t size, rk_state *state)\n rk_error rk_devfill(void *buffer, size_t size, int strong)\n rk_error rk_altfill(void *buffer, size_t size, int strong,\n rk_state *state)\n double rk_gauss(rk_state *state)\n\ncdef extern from \"distributions.h\":\n \n double rk_normal(rk_state *state, double loc, double scale)\n double rk_standard_exponential(rk_state *state)\n double rk_exponential(rk_state *state, double scale)\n double rk_uniform(rk_state *state, double loc, double scale)\n double rk_standard_gamma(rk_state *state, double shape)\n double rk_gamma(rk_state *state, double shape, double scale)\n double rk_beta(rk_state *state, double a, double b)\n double rk_chisquare(rk_state *state, double df)\n double rk_noncentral_chisquare(rk_state *state, double df, double nonc)\n double rk_f(rk_state *state, double dfnum, double dfden)\n double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)\n double rk_standard_cauchy(rk_state *state)\n double rk_standard_t(rk_state *state, double df)\n double rk_vonmises(rk_state *state, double mu, double kappa)\n double rk_pareto(rk_state *state, double a)\n double rk_weibull(rk_state *state, double a)\n double rk_power(rk_state *state, double a)\n double rk_laplace(rk_state *state, double loc, double scale)\n double rk_gumbel(rk_state *state, double loc, double scale)\n double rk_logistic(rk_state *state, double loc, double scale)\n double rk_lognormal(rk_state *state, double mode, double sigma)\n double rk_rayleigh(rk_state *state, double mode)\n double rk_wald(rk_state *state, double mean, double scale)\n double rk_triangular(rk_state *state, double left, double mode, double right)\n \n long rk_binomial(rk_state *state, long n, double p)\n long rk_binomial_btpe(rk_state *state, long n, double p)\n long rk_binomial_inversion(rk_state *state, long n, double p)\n long rk_negative_binomial(rk_state *state, long n, double p)\n long rk_poisson(rk_state *state, double lam)\n long rk_poisson_mult(rk_state *state, double lam)\n long rk_poisson_ptrs(rk_state *state, double lam)\n long rk_zipf(rk_state *state, double a)\n long rk_geometric(rk_state *state, double p)\n long rk_hypergeometric(rk_state *state, long good, long bad, long sample)\n long rk_logseries(rk_state *state, double p)\n\nctypedef double (* rk_cont0)(rk_state *state)\nctypedef double (* rk_cont1)(rk_state *state, double a)\nctypedef double (* rk_cont2)(rk_state *state, double a, double b)\nctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)\n\nctypedef long (* rk_disc0)(rk_state *state)\nctypedef long (* rk_discnp)(rk_state *state, long n, double p)\nctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N)\nctypedef long (* rk_discd)(rk_state *state, double a)\n\n\ncdef extern from \"initarray.h\":\n void init_by_array(rk_state *self, unsigned long *init_key, \n unsigned long key_length)\n\n# Initialize numpy\nimport_array()\n\nimport numpy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a, \n double b):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a, b)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b)\n return array\n\ncdef object cont3_array(rk_state *state, rk_cont3 func, object size, double a, \n double b, double c):\n\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n \n if size is None:\n return func(state, a, b, c)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b, c)\n return array\n\ncdef object disc0_array(rk_state *state, rk_disc0 func, object size):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, double p):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, p)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, p)\n return array\n\ncdef object discnmN_array(rk_state *state, rk_discnmN func, object size, \n long n, long m, long N):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, m, N)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, m, N)\n return array\n\ncdef object discd_array(rk_state *state, rk_discd func, object size, double a):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef double kahan_sum(double *darr, long n):\n cdef double c, y, t, sum\n cdef long i\n sum = darr[0]\n c = 0.0\n for i from 1 <= i < n:\n y = darr[i] - c\n t = sum + y\n c = (t-sum) - y\n sum = t\n return sum\n\ncdef class RandomState:\n \"\"\"Container for the Mersenne Twister PRNG.\n\n Constructor\n -----------\n RandomState(seed=None): initializes the PRNG with the given seed. See the\n seed() method for details.\n\n Distribution Methods\n -----------------\n RandomState exposes a number of methods for generating random numbers drawn\n from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n size=None. If size is None, then a single value is generated and returned.\n If size is an integer, then a 1-D numpy array filled with generated values\n is returned. If size is a tuple, then a numpy array with that shape is\n filled and returned.\n \"\"\"\n cdef rk_state *internal_state\n\n def __init__(self, seed=None):\n self.internal_state = PyMem_Malloc(sizeof(rk_state))\n\n self.seed(seed)\n\n def __dealloc__(self):\n if self.internal_state != NULL:\n PyMem_Free(self.internal_state)\n\n def seed(self, seed=None):\n \"\"\"Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n \"\"\"\n cdef rk_error errcode\n cdef ndarray obj \"arrayObject_obj\"\n if seed is None:\n errcode = rk_randomseed(self.internal_state)\n elif type(seed) is int:\n rk_seed(seed, self.internal_state)\n else:\n obj = PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n init_by_array(self.internal_state, (obj.data),\n obj.dimensions[0])\n\n def get_state(self):\n \"\"\"Return a tuple representing the internal state of the generator.\n\n get_state() -> ('MT19937', int key[624], int pos)\n \"\"\"\n cdef ndarray state \"arrayObject_state\"\n state = _sp.empty(624, _sp.Int)\n memcpy((state.data), self.internal_state.key, 624*sizeof(long))\n return ('MT19937', state, self.internal_state.pos)\n \n def set_state(self, state):\n \"\"\"Set the state from a tuple.\n \n state = ('MT19937', int key[624], int pos)\n \n set_state(state)\n \"\"\"\n cdef ndarray obj \"arrayObject_obj\"\n cdef int pos\n algorithm_name = state[0]\n if algorithm_name != 'MT19937':\n raise ValueError(\"algorithm must be 'MT19937'\")\n key, pos = state[1:]\n obj = PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)\n if obj.dimensions[0] != 624:\n raise ValueError(\"state must be 624 longs\")\n memcpy(self.internal_state.key, (obj.data), 624*sizeof(long))\n self.internal_state.pos = pos\n \n # Pickling support:\n def __getstate__(self):\n return self.get_state()\n\n def __setstate__(self, state):\n self.set_state(state)\n\n def __reduce__(self):\n return (_sp.random.__RandomState_ctor, (), self.get_state())\n\n # Basic distributions:\n def random_sample(self, size=None):\n \"\"\"Return random floats in the half-open interval [0.0, 1.0).\n\n random_sample(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_double, size)\n\n def tomaxint(self, size=None):\n \"\"\"Returns random integers x such that 0 <= x <= sys.maxint.\n\n tomaxint(size=None) -> random values\n \"\"\"\n return disc0_array(self.internal_state, rk_long, size)\n\n def randint(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x < high.\n\n randint(low, high=None, size=None) -> random values\n\n If high is None, then 0 <= x < low.\n \"\"\"\n cdef long lo, hi, diff\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if high is None:\n lo = 0\n hi = low\n else:\n lo = low\n hi = high\n\n diff = hi - lo - 1\n if diff < 0:\n raise ValueError(\"low >= high\")\n \n if size is None:\n return rk_interval(diff, self.internal_state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = lo + rk_interval(diff, self.internal_state)\n return array\n\n def bytes(self, unsigned int length):\n \"\"\"Return random bytes.\n\n bytes(length) -> str\n \"\"\"\n cdef void *bytes\n bytes = PyMem_Malloc(length)\n rk_fill(bytes, length, self.internal_state)\n bytestring = PyString_FromString(bytes)\n PyMem_Free(bytes)\n return bytestring\n\n def uniform(self, double low=0.0, double high=1.0, size=None):\n \"\"\"Uniform distribution over [low, high).\n\n uniform(low=0.0, high=1.0, size=None) -> random values\n \"\"\"\n return cont2_array(self.internal_state, rk_uniform, size, low, \n high-low)\n\n def rand(self, *args):\n \"\"\"Return an array of the given dimensions which is initialized to \n random numbers from a uniform distribution in the range [0,1).\n\n rand(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.random_sample()\n else:\n return self.random_sample(size=args)\n\n def randn(self, *args):\n \"\"\"Returns zero-mean, unit-variance Gaussian random numbers in an \n array of shape (d0, d1, ..., dn).\n\n randn(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.standard_normal()\n else:\n return self.standard_normal(args)\n\n def random_integers(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x <= high.\n\n random_integers(low, high=None, size=None) -> random values.\n\n If high is None, then 1 <= x <= low.\n \"\"\"\n if high is None:\n high = low\n low = 1\n return self.randint(low, high+1, size)\n\n # Complicated, continuous distributions:\n def standard_normal(self, size=None):\n \"\"\"Standard Normal distribution (mean=0, stdev=1).\n\n standard_normal(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_gauss, size)\n\n def normal(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Normal distribution (mean=loc, stdev=scale).\n\n normal(loc=0.0, scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_normal, size, loc, scale)\n\n def beta(self, double a, double b, size=None):\n \"\"\"Beta distribution over [0, 1].\n\n beta(a, b, size=None) -> random values\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n elif b <= 0:\n raise ValueError(\"b <= 0\")\n return cont2_array(self.internal_state, rk_beta, size, a, b)\n\n def exponential(self, double scale=1.0, size=None):\n \"\"\"Exponential distribution.\n\n exponential(scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont1_array(self.internal_state, rk_exponential, size, scale)\n\n def standard_exponential(self, size=None):\n \"\"\"Standard exponential distribution (scale=1).\n\n standard_exponential(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_exponential, size)\n\n def standard_gamma(self, double shape, size=None):\n \"\"\"Standard Gamma distribution.\n\n standard_gamma(shape, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n return cont1_array(self.internal_state, rk_standard_gamma, size, shape)\n\n def gamma(self, double shape, double scale=1.0, size=None):\n \"\"\"Gamma distribution.\n\n gamma(shape, scale=1.0, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n elif scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_gamma, size, shape, scale)\n\n def f(self, double dfnum, double dfden, size=None):\n \"\"\"F distribution.\n\n f(dfnum, dfden, size=None) -> random values\n \"\"\"\n if dfnum <= 0:\n raise ValueError(\"dfnum <= 0\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n return cont2_array(self.internal_state, rk_f, size, dfnum, dfden)\n\n def noncentral_f(self, double dfnum, double dfden, double nonc, size=None):\n \"\"\"Noncentral F distribution.\n\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\n \"\"\"\n if dfnum <= 1:\n raise ValueError(\"dfnum <= 1\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont3_array(self.internal_state, rk_noncentral_f, size, dfnum,\n dfden, nonc)\n\n def chisquare(self, double df, size=None):\n \"\"\"Chi^2 distribution.\n\n chisquare(df, size=None) -> random values\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_chisquare, size, df)\n\n def noncentral_chisquare(self, double df, double nonc, size=None):\n \"\"\"Noncentral Chi^2 distribution.\n\n noncentral_chisquare(df, nonc, size=None) -> random values\n \"\"\"\n if df <= 1:\n raise ValueError(\"df <= 1\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont2_array(self.internal_state, rk_noncentral_chisquare, size,\n df, nonc)\n \n def standard_cauchy(self, size=None):\n \"\"\"Standard Cauchy with mode=0.\n\n standard_cauchy(size=None)\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_cauchy, size)\n\n def standard_t(self, double df, size=None):\n \"\"\"Standard Student's t distribution with df degrees of freedom.\n\n standard_t(df, size=None)\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_standard_t, size, df)\n\n def vonmises(self, double mu, double kappa, size=None):\n \"\"\"von Mises circular distribution with mode mu and dispersion parameter\n kappa on [-pi, pi].\n\n vonmises(mu, kappa, size=None)\n \"\"\"\n if kappa < 0:\n raise ValueError(\"kappa < 0\")\n return cont2_array(self.internal_state, rk_vonmises, size, mu, kappa)\n\n def pareto(self, double a, size=None):\n \"\"\"Pareto distribution.\n\n pareto(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_pareto, size, a)\n\n def weibull(self, double a, size=None):\n \"\"\"Weibull distribution.\n\n weibull(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_weibull, size, a)\n\n def power(self, double a, size=None):\n \"\"\"Power distribution.\n\n power(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_power, size, a)\n\n def laplace(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Laplace distribution.\n \n laplace(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_laplace, size, loc, scale)\n \n def gumbel(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Gumbel distribution.\n \n gumbel(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_gumbel, size, loc, scale)\n \n def logistic(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Logistic distribution.\n \n logistic(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_logistic, size, loc, scale)\n\n def lognormal(self, double mean=0.0, double sigma=1.0, size=None):\n \"\"\"Log-normal distribution.\n \n Note that the mean parameter is not the mean of this distribution, but \n the underlying normal distribution.\n \n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\n \n lognormal(mean=0.0, sigma=1.0, size=None)\n \"\"\"\n if sigma <= 0.0:\n raise ValueError(\"sigma <= 0.0\")\n return cont2_array(self.internal_state, rk_lognormal, size, mean, sigma)\n \n def rayleigh(self, double scale=1.0, size=None):\n \"\"\"Rayleigh distribution.\n \n rayleigh(scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont1_array(self.internal_state, rk_rayleigh, size, scale)\n \n def wald(self, double mean, double scale, size=None):\n \"\"\"Wald (inverse Gaussian) distribution.\n \n wald(mean, scale, size=None)\n \"\"\"\n if mean <= 0.0:\n raise ValueError(\"mean <= 0.0\")\n elif scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_wald, size, mean, scale)\n\n def triangular(self, double left, double mode, double right, size=None):\n \"\"\"Triangular distribution starting at left, peaking at mode, and \n ending at right (left <= mode <= right).\n \n triangular(left, mode, right, size=None)\n \"\"\"\n if left > mode:\n raise ValueError(\"left > mode\")\n elif mode > right:\n raise ValueError(\"mode > right\")\n elif left == right:\n raise ValueError(\"left == right\")\n return cont3_array(self.internal_state, rk_triangular, size, left, \n mode, right)\n\n # Complicated, discrete distributions:\n def binomial(self, long n, double p, size=None):\n \"\"\"Binomial distribution of n trials and p probability of success.\n\n binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_binomial, size, n, p)\n\n def negative_binomial(self, long n, double p, size=None):\n \"\"\"Negative Binomial distribution.\n\n negative_binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_negative_binomial, size, n,\n p)\n\n def poisson(self, double lam=1.0, size=None):\n \"\"\"Poisson distribution.\n\n poisson(lam=1.0, size=None) -> random values\n \"\"\"\n if lam <= 0:\n raise ValueError(\"lam <= 0\")\n return discd_array(self.internal_state, rk_poisson, size, lam)\n\n def zipf(self, double a, size=None):\n \"\"\"Zipf distribution.\n \n zipf(a, size=None)\n \"\"\"\n if a <= 1.0:\n raise ValueError(\"a <= 1.0\")\n return discd_array(self.internal_state, rk_zipf, size, a)\n \n def geometric(self, double p, size=None):\n \"\"\"Geometric distribution with p being the probability of \"success\" on\n an individual trial.\n \n geometric(p, size=None)\n \"\"\"\n if p < 0.0:\n raise ValueError(\"p < 0.0\")\n elif p > 1.0:\n raise ValueError(\"p > 1.0\")\n return discd_array(self.internal_state, rk_geometric, size, p)\n \n def hypergeometric(self, long ngood, long nbad, long nsample, size=None):\n \"\"\"Hypergeometric distribution.\n \n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one \n were to draw nsample balls from the urn without replacement, then \n the hypergeometric distribution describes the distribution of \"good\" \n balls in the sample.\n \n hypergeometric(ngood, nbad, nsample, size=None) \n \"\"\"\n if ngood < 1:\n raise ValueError(\"ngood < 1\")\n elif nbad < 1:\n raise ValueError(\"nbad < 1\")\n elif ngood + nbad < nsample:\n raise ValueError(\"ngood + nbad < nsample\")\n elif nsample < 1:\n raise ValueError(\"nsample < 1\")\n return discnmN_array(self.internal_state, rk_hypergeometric, size,\n ngood, nbad, nsample)\n\n def logseries(self, double p, size=None):\n \"\"\"Logarithmic series distribution.\n \n logseries(p, size=None)\n \"\"\"\n if p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discd_array(self.internal_state, rk_logseries, size, p)\n\n # Multivariate distributions:\n def multivariate_normal(self, mean, cov, size=None):\n \"\"\"Return an array containing multivariate normally distributed random numbers\n with specified mean and covariance.\n\n multivariate_normal(mean, cov) -> random values\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\n\n mean must be a 1 dimensional array. cov must be a square two dimensional\n array with the same number of rows and columns as mean has elements.\n\n The first form returns a single 1-D array containing a multivariate\n normal.\n\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\n normal.\n \"\"\"\n # Check preconditions on arguments\n mean = _sp.array(mean)\n cov = _sp.array(cov)\n if size is None:\n shape = []\n else:\n shape = size\n if len(mean.shape) != 1:\n raise ArgumentError(\"mean must be 1 dimensional\")\n if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):\n raise ArgumentError(\"cov must be 2 dimensional and square\")\n if mean.shape[0] != cov.shape[0]:\n raise ArgumentError(\"mean and cov must have same length\")\n # Compute shape of output\n if isinstance(shape, int):\n shape = [shape]\n final_shape = list(shape[:])\n final_shape.append(mean.shape[0])\n # Create a matrix of independent standard normally distributed random\n # numbers. The matrix has rows with the same length as mean and as\n # many rows are necessary to form a matrix of shape final_shape.\n x = standard_normal(_sp.multiply.reduce(final_shape))\n x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),\n mean.shape[0])\n # Transform matrix of standard normals into matrix where each row\n # contains multivariate normals with the desired covariance.\n # Compute A such that matrixmultiply(transpose(A),A) == cov.\n # Then the matrix products of the rows of x and A has the desired\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n\t\n from numpy.dual import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n # The rows of x now have the correct covariance but mean 0. Add\n # mean to each row. Then each row will have mean mean.\n _sp.add(mean,x,x)\n x.shape = tuple(final_shape)\n return x\n\n def multinomial(self, long n, object pvals, size=None):\n \"\"\"Multinomial distribution.\n \n multinomial(n, pvals, size=None) -> random values\n\n pvals is a sequence of probabilities that should sum to 1 (however, the\n last element is always assumed to account for the remaining probability\n as long as sum(pvals[:-1]) <= 1).\n \"\"\"\n cdef long d\n cdef ndarray parr \"arrayObject_parr\", mnarr \"arrayObject_mnarr\"\n cdef double *pix\n cdef long *mnix\n cdef long i, j, dn\n cdef double Sum\n\n d = len(pvals)\n parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n pix = parr.data\n\n if kahan_sum(pix, d-1) > 1.0:\n raise ValueError(\"sum(pvals) > 1.0\")\n\n if size is None:\n shape = (d,)\n elif type(size) is int:\n shape = (size, d)\n else:\n shape = size + (d,)\n\n multin = _sp.zeros(shape, _sp.Int)\n mnarr = multin\n mnix = mnarr.data\n i = 0\n while i < PyArray_SIZE(mnarr):\n Sum = 1.0\n dn = n\n for j from 0 <= j < d-1:\n mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)\n dn = dn - mnix[i+j]\n if dn <= 0:\n break\n Sum = Sum - pix[j]\n if dn > 0:\n mnix[i+d-1] = dn\n\n i = i + d\n\n return multin\n\n # Shuffling and permutations:\n def shuffle(self, object x):\n \"\"\"Modify a sequence in-place by shuffling its contents.\n \n shuffle(x)\n \"\"\"\n cdef long i, j\n\n # adaptation of random.shuffle()\n i = len(x) - 1\n while i > 0:\n j = rk_interval(i, self.internal_state)\n x[i], x[j] = x[j], x[i]\n i = i - 1\n \n def permutation(self, object x):\n \"\"\"Given an integer, return a shuffled sequence of integers >= 0 and \n < x; given a sequence, return a shuffled array copy.\n\n permutation(x)\n \"\"\"\n if type(x) is int:\n arr = _sp.arange(x)\n else:\n arr = _sp.array(x)\n self.shuffle(arr)\n return arr \n\n_rand = RandomState()\nseed = _rand.seed\nget_state = _rand.get_state\nset_state = _rand.set_state\nrandom_sample = _rand.random_sample\nrandint = _rand.randint\nbytes = _rand.bytes\nuniform = _rand.uniform\nrand = _rand.rand\nrandn = _rand.randn\nrandom_integers = _rand.random_integers\nstandard_normal = _rand.standard_normal\nnormal = _rand.normal\nbeta = _rand.beta\nexponential = _rand.exponential\nstandard_exponential = _rand.standard_exponential\nstandard_gamma = _rand.standard_gamma\ngamma = _rand.gamma\nf = _rand.f\nnoncentral_f = _rand.noncentral_f\nchisquare = _rand.chisquare\nnoncentral_chisquare = _rand.noncentral_chisquare\nstandard_cauchy = _rand.standard_cauchy\nstandard_t = _rand.standard_t\nvonmises = _rand.vonmises\npareto = _rand.pareto\nweibull = _rand.weibull\npower = _rand.power\nlaplace = _rand.laplace\ngumbel = _rand.gumbel\nlogistic = _rand.logistic\nlognormal = _rand.lognormal\nrayleigh = _rand.rayleigh\nwald = _rand.wald\ntriangular = _rand.triangular\n\nbinomial = _rand.binomial\nnegative_binomial = _rand.negative_binomial\npoisson = _rand.poisson\nzipf = _rand.zipf\ngeometric = _rand.geometric\nhypergeometric = _rand.hypergeometric\nlogseries = _rand.logseries\n\nmultivariate_normal = _rand.multivariate_normal\nmultinomial = _rand.multinomial\n\nshuffle = _rand.shuffle\npermutation = _rand.permutation\n", + "source_code_before": "# mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit\n#\n# Copyright 2005 Robert Kern (robert.kern@gmail.com)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n# \n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n# \n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\ninclude \"Python.pxi\"\ninclude \"numpy.pxi\"\n\ncdef extern from \"math.h\":\n double exp(double x)\n double log(double x)\n double floor(double x)\n double sin(double x)\n double cos(double x)\n\ncdef extern from \"randomkit.h\":\n\n ctypedef struct rk_state:\n unsigned long key[624]\n int pos\n\n ctypedef enum rk_error:\n RK_NOERR = 0\n RK_ENODEV = 1\n RK_ERR_MAX = 2\n\n char *rk_strerror[2]\n \n # 0xFFFFFFFFUL\n unsigned long RK_MAX\n\n void rk_seed(unsigned long seed, rk_state *state)\n rk_error rk_randomseed(rk_state *state)\n unsigned long rk_random(rk_state *state)\n long rk_long(rk_state *state)\n unsigned long rk_ulong(rk_state *state)\n unsigned long rk_interval(unsigned long max, rk_state *state)\n double rk_double(rk_state *state)\n void rk_fill(void *buffer, size_t size, rk_state *state)\n rk_error rk_devfill(void *buffer, size_t size, int strong)\n rk_error rk_altfill(void *buffer, size_t size, int strong,\n rk_state *state)\n double rk_gauss(rk_state *state)\n\ncdef extern from \"distributions.h\":\n \n double rk_normal(rk_state *state, double loc, double scale)\n double rk_standard_exponential(rk_state *state)\n double rk_exponential(rk_state *state, double scale)\n double rk_uniform(rk_state *state, double loc, double scale)\n double rk_standard_gamma(rk_state *state, double shape)\n double rk_gamma(rk_state *state, double shape, double scale)\n double rk_beta(rk_state *state, double a, double b)\n double rk_chisquare(rk_state *state, double df)\n double rk_noncentral_chisquare(rk_state *state, double df, double nonc)\n double rk_f(rk_state *state, double dfnum, double dfden)\n double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)\n double rk_standard_cauchy(rk_state *state)\n double rk_standard_t(rk_state *state, double df)\n double rk_vonmises(rk_state *state, double mu, double kappa)\n double rk_pareto(rk_state *state, double a)\n double rk_weibull(rk_state *state, double a)\n double rk_power(rk_state *state, double a)\n double rk_laplace(rk_state *state, double loc, double scale)\n double rk_gumbel(rk_state *state, double loc, double scale)\n double rk_logistic(rk_state *state, double loc, double scale)\n double rk_lognormal(rk_state *state, double mode, double sigma)\n double rk_rayleigh(rk_state *state, double mode)\n double rk_wald(rk_state *state, double mean, double scale)\n double rk_triangular(rk_state *state, double left, double mode, double right)\n \n long rk_binomial(rk_state *state, long n, double p)\n long rk_binomial_btpe(rk_state *state, long n, double p)\n long rk_binomial_inversion(rk_state *state, long n, double p)\n long rk_negative_binomial(rk_state *state, long n, double p)\n long rk_poisson(rk_state *state, double lam)\n long rk_poisson_mult(rk_state *state, double lam)\n long rk_poisson_ptrs(rk_state *state, double lam)\n long rk_zipf(rk_state *state, double a)\n long rk_geometric(rk_state *state, double p)\n long rk_hypergeometric(rk_state *state, long good, long bad, long sample)\n long rk_logseries(rk_state *state, double p)\n\nctypedef double (* rk_cont0)(rk_state *state)\nctypedef double (* rk_cont1)(rk_state *state, double a)\nctypedef double (* rk_cont2)(rk_state *state, double a, double b)\nctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)\n\nctypedef long (* rk_disc0)(rk_state *state)\nctypedef long (* rk_discnp)(rk_state *state, long n, double p)\nctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N)\nctypedef long (* rk_discd)(rk_state *state, double a)\n\n\ncdef extern from \"initarray.h\":\n void init_by_array(rk_state *self, unsigned long *init_key, \n unsigned long key_length)\n\n# Initialize numpy\nimport_array()\n\nimport numpy as _sp\n\ncdef object cont0_array(rk_state *state, rk_cont0 func, object size):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object cont1_array(rk_state *state, rk_cont1 func, object size, double a):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef object cont2_array(rk_state *state, rk_cont2 func, object size, double a, \n double b):\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a, b)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b)\n return array\n\ncdef object cont3_array(rk_state *state, rk_cont3 func, object size, double a, \n double b, double c):\n\n cdef double *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n \n if size is None:\n return func(state, a, b, c)\n else:\n array = _sp.empty(size, _sp.Float64)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a, b, c)\n return array\n\ncdef object disc0_array(rk_state *state, rk_disc0 func, object size):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state)\n return array\n\ncdef object discnp_array(rk_state *state, rk_discnp func, object size, long n, double p):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, p)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, p)\n return array\n\ncdef object discnmN_array(rk_state *state, rk_discnmN func, object size, \n long n, long m, long N):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, n, m, N)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, n, m, N)\n return array\n\ncdef object discd_array(rk_state *state, rk_discd func, object size, double a):\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if size is None:\n return func(state, a)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = func(state, a)\n return array\n\ncdef double kahan_sum(double *darr, long n):\n cdef double c, y, t, sum\n cdef long i\n sum = darr[0]\n c = 0.0\n for i from 1 <= i < n:\n y = darr[i] - c\n t = sum + y\n c = (t-sum) - y\n sum = t\n return sum\n\ncdef class RandomState:\n \"\"\"Container for the Mersenne Twister PRNG.\n\n Constructor\n -----------\n RandomState(seed=None): initializes the PRNG with the given seed. See the\n seed() method for details.\n\n Distribution Methods\n -----------------\n RandomState exposes a number of methods for generating random numbers drawn\n from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n size=None. If size is None, then a single value is generated and returned.\n If size is an integer, then a 1-D numpy array filled with generated values\n is returned. If size is a tuple, then a numpy array with that shape is\n filled and returned.\n \"\"\"\n cdef rk_state *internal_state\n\n def __init__(self, seed=None):\n self.internal_state = PyMem_Malloc(sizeof(rk_state))\n\n self.seed(seed)\n\n def __dealloc__(self):\n if self.internal_state != NULL:\n PyMem_Free(self.internal_state)\n\n def seed(self, seed=None):\n \"\"\"Seed the generator.\n\n seed(seed=None)\n\n seed can be an integer, an array (or other sequence) of integers of any\n length, or None. If seed is None, then RandomState will try to read data\n from /dev/urandom (or the Windows analogue) if available or seed from\n the clock otherwise.\n \"\"\"\n cdef rk_error errcode\n cdef ndarray obj \"arrayObject_obj\"\n if seed is None:\n errcode = rk_randomseed(self.internal_state)\n elif type(seed) is int:\n rk_seed(seed, self.internal_state)\n else:\n obj = PyArray_ContiguousFromObject(seed, PyArray_LONG, 1, 1)\n init_by_array(self.internal_state, (obj.data),\n obj.dimensions[0])\n\n def get_state(self):\n \"\"\"Return a tuple representing the internal state of the generator.\n\n get_state() -> ('MT19937', int key[624], int pos)\n \"\"\"\n cdef ndarray state \"arrayObject_state\"\n state = _sp.empty(624, _sp.Int)\n memcpy((state.data), self.internal_state.key, 624*sizeof(long))\n return ('MT19937', state, self.internal_state.pos)\n \n def set_state(self, state):\n \"\"\"Set the state from a tuple.\n \n state = ('MT19937', int key[624], int pos)\n \n set_state(state)\n \"\"\"\n cdef ndarray obj \"arrayObject_obj\"\n cdef int pos\n algorithm_name = state[0]\n if algorithm_name != 'MT19937':\n raise ValueError(\"algorithm must be 'MT19937'\")\n key, pos = state[1:]\n obj = PyArray_ContiguousFromObject(key, PyArray_LONG, 1, 1)\n if obj.dimensions[0] != 624:\n raise ValueError(\"state must be 624 longs\")\n memcpy(self.internal_state.key, (obj.data), 624*sizeof(long))\n self.internal_state.pos = pos\n \n # Pickling support:\n def __getstate__(self):\n return self.get_state()\n\n def __setstate__(self, state):\n self.set_state(state)\n\n def __reduce__(self):\n return (_sp.random.__RandomState_ctor, (), self.get_state())\n\n # Basic distributions:\n def random_sample(self, size=None):\n \"\"\"Return random floats in the half-open interval [0.0, 1.0).\n\n random_sample(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_double, size)\n\n def tomaxint(self, size=None):\n \"\"\"Returns random integers x such that 0 <= x <= sys.maxint.\n\n tomaxint(size=None) -> random values\n \"\"\"\n return disc0_array(self.internal_state, rk_long, size)\n\n def randint(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x < high.\n\n randint(low, high=None, size=None) -> random values\n\n If high is None, then 0 <= x < low.\n \"\"\"\n cdef long lo, hi, diff\n cdef long *array_data\n cdef ndarray array \"arrayObject\"\n cdef long length\n cdef long i\n\n if high is None:\n lo = 0\n hi = low\n else:\n lo = low\n hi = high\n\n diff = hi - lo - 1\n if diff < 0:\n raise ValueError(\"low >= high\")\n \n if size is None:\n return rk_interval(diff, self.internal_state)\n else:\n array = _sp.empty(size, _sp.Int)\n length = PyArray_SIZE(array)\n array_data = array.data\n for i from 0 <= i < length:\n array_data[i] = lo + rk_interval(diff, self.internal_state)\n return array\n\n def bytes(self, unsigned int length):\n \"\"\"Return random bytes.\n\n bytes(length) -> str\n \"\"\"\n cdef void *bytes\n bytes = PyMem_Malloc(length)\n rk_fill(bytes, length, self.internal_state)\n bytestring = PyString_FromString(bytes)\n PyMem_Free(bytes)\n return bytestring\n\n def uniform(self, double low=0.0, double high=1.0, size=None):\n \"\"\"Uniform distribution over [low, high).\n\n uniform(low=0.0, high=1.0, size=None) -> random values\n \"\"\"\n return cont2_array(self.internal_state, rk_uniform, size, low, \n high-low)\n\n def rand(self, *args):\n \"\"\"Return an array of the given dimensions which is initialized to \n random numbers from a uniform distribution in the range [0,1).\n\n rand(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.random_sample()\n else:\n return self.random_sample(size=args)\n\n def randn(self, *args):\n \"\"\"Returns zero-mean, unit-variance Gaussian random numbers in an \n array of shape (d0, d1, ..., dn).\n\n randn(d0, d1, ..., dn) -> random values\n \"\"\"\n if len(args) == 0:\n return self.standard_normal()\n else:\n return self.standard_normal(args)\n\n def random_integers(self, low, high=None, size=None):\n \"\"\"Return random integers x such that low <= x <= high.\n\n random_integers(low, high=None, size=None) -> random values.\n\n If high is None, then 1 <= x <= low.\n \"\"\"\n if high is None:\n high = low\n low = 1\n return self.randint(low, high+1, size)\n\n # Complicated, continuous distributions:\n def standard_normal(self, size=None):\n \"\"\"Standard Normal distribution (mean=0, stdev=1).\n\n standard_normal(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_gauss, size)\n\n def normal(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Normal distribution (mean=loc, stdev=scale).\n\n normal(loc=0.0, scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_normal, size, loc, scale)\n\n def beta(self, double a, double b, size=None):\n \"\"\"Beta distribution over [0, 1].\n\n beta(a, b, size=None) -> random values\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n elif b <= 0:\n raise ValueError(\"b <= 0\")\n return cont2_array(self.internal_state, rk_beta, size, a, b)\n\n def exponential(self, double scale=1.0, size=None):\n \"\"\"Exponential distribution.\n\n exponential(scale=1.0, size=None) -> random values\n \"\"\"\n if scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont1_array(self.internal_state, rk_exponential, size, scale)\n\n def standard_exponential(self, size=None):\n \"\"\"Standard exponential distribution (scale=1).\n\n standard_exponential(size=None) -> random values\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_exponential, size)\n\n def standard_gamma(self, double shape, size=None):\n \"\"\"Standard Gamma distribution.\n\n standard_gamma(shape, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n return cont1_array(self.internal_state, rk_standard_gamma, size, shape)\n\n def gamma(self, double shape, double scale=1.0, size=None):\n \"\"\"Gamma distribution.\n\n gamma(shape, scale=1.0, size=None) -> random values\n \"\"\"\n if shape <= 0:\n raise ValueError(\"shape <= 0\")\n elif scale <= 0:\n raise ValueError(\"scale <= 0\")\n return cont2_array(self.internal_state, rk_gamma, size, shape, scale)\n\n def f(self, double dfnum, double dfden, size=None):\n \"\"\"F distribution.\n\n f(dfnum, dfden, size=None) -> random values\n \"\"\"\n if dfnum <= 0:\n raise ValueError(\"dfnum <= 0\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n return cont2_array(self.internal_state, rk_f, size, dfnum, dfden)\n\n def noncentral_f(self, double dfnum, double dfden, double nonc, size=None):\n \"\"\"Noncentral F distribution.\n\n noncentral_f(dfnum, dfden, nonc, size=None) -> random values\n \"\"\"\n if dfnum <= 1:\n raise ValueError(\"dfnum <= 1\")\n elif dfden <= 0:\n raise ValueError(\"dfden <= 0\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont3_array(self.internal_state, rk_noncentral_f, size, dfnum,\n dfden, nonc)\n\n def chisquare(self, double df, size=None):\n \"\"\"Chi^2 distribution.\n\n chisquare(df, size=None) -> random values\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_chisquare, size, df)\n\n def noncentral_chisquare(self, double df, double nonc, size=None):\n \"\"\"Noncentral Chi^2 distribution.\n\n noncentral_chisquare(df, nonc, size=None) -> random values\n \"\"\"\n if df <= 1:\n raise ValueError(\"df <= 1\")\n elif nonc < 0:\n raise ValueError(\"nonc < 0\")\n return cont2_array(self.internal_state, rk_noncentral_chisquare, size,\n df, nonc)\n \n def standard_cauchy(self, size=None):\n \"\"\"Standard Cauchy with mode=0.\n\n standard_cauchy(size=None)\n \"\"\"\n return cont0_array(self.internal_state, rk_standard_cauchy, size)\n\n def standard_t(self, double df, size=None):\n \"\"\"Standard Student's t distribution with df degrees of freedom.\n\n standard_t(df, size=None)\n \"\"\"\n if df <= 0:\n raise ValueError(\"df <= 0\")\n return cont1_array(self.internal_state, rk_standard_t, size, df)\n\n def vonmises(self, double mu, double kappa, size=None):\n \"\"\"von Mises circular distribution with mode mu and dispersion parameter\n kappa on [-pi, pi].\n\n vonmises(mu, kappa, size=None)\n \"\"\"\n if kappa < 0:\n raise ValueError(\"kappa < 0\")\n return cont2_array(self.internal_state, rk_vonmises, size, mu, kappa)\n\n def pareto(self, double a, size=None):\n \"\"\"Pareto distribution.\n\n pareto(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_pareto, size, a)\n\n def weibull(self, double a, size=None):\n \"\"\"Weibull distribution.\n\n weibull(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_weibull, size, a)\n\n def power(self, double a, size=None):\n \"\"\"Power distribution.\n\n power(a, size=None)\n \"\"\"\n if a <= 0:\n raise ValueError(\"a <= 0\")\n return cont1_array(self.internal_state, rk_power, size, a)\n\n def laplace(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Laplace distribution.\n \n laplace(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_laplace, size, loc, scale)\n \n def gumbel(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Gumbel distribution.\n \n gumbel(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_gumbel, size, loc, scale)\n \n def logistic(self, double loc=0.0, double scale=1.0, size=None):\n \"\"\"Logistic distribution.\n \n logistic(loc=0.0, scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_logistic, size, loc, scale)\n\n def lognormal(self, double mean=0.0, double sigma=1.0, size=None):\n \"\"\"Log-normal distribution.\n \n Note that the mean parameter is not the mean of this distribution, but \n the underlying normal distribution.\n \n lognormal(mean, sigma) <=> exp(normal(mean, sigma))\n \n lognormal(mean=0.0, sigma=1.0, size=None)\n \"\"\"\n if sigma <= 0.0:\n raise ValueError(\"sigma <= 0.0\")\n return cont2_array(self.internal_state, rk_lognormal, size, mean, sigma)\n \n def rayleigh(self, double scale=1.0, size=None):\n \"\"\"Rayleigh distribution.\n \n rayleigh(scale=1.0, size=None)\n \"\"\"\n if scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont1_array(self.internal_state, rk_rayleigh, size, scale)\n \n def wald(self, double mean, double scale, size=None):\n \"\"\"Wald (inverse Gaussian) distribution.\n \n wald(mean, scale, size=None)\n \"\"\"\n if mean <= 0.0:\n raise ValueError(\"mean <= 0.0\")\n elif scale <= 0.0:\n raise ValueError(\"scale <= 0.0\")\n return cont2_array(self.internal_state, rk_wald, size, mean, scale)\n\n def triangular(self, double left, double mode, double right, size=None):\n \"\"\"Triangular distribution starting at left, peaking at mode, and \n ending at right (left <= mode <= right).\n \n triangular(left, mode, right, size=None)\n \"\"\"\n if left > mode:\n raise ValueError(\"left > mode\")\n elif mode > right:\n raise ValueError(\"mode > right\")\n elif left == right:\n raise ValueError(\"left == right\")\n return cont3_array(self.internal_state, rk_triangular, size, left, \n mode, right)\n\n # Complicated, discrete distributions:\n def binomial(self, long n, double p, size=None):\n \"\"\"Binomial distribution of n trials and p probability of success.\n\n binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_binomial, size, n, p)\n\n def negative_binomial(self, long n, double p, size=None):\n \"\"\"Negative Binomial distribution.\n\n negative_binomial(n, p, size=None) -> random values\n \"\"\"\n if n <= 0:\n raise ValueError(\"n <= 0\")\n elif p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discnp_array(self.internal_state, rk_negative_binomial, size, n,\n p)\n\n def poisson(self, double lam=1.0, size=None):\n \"\"\"Poisson distribution.\n\n poisson(lam=1.0, size=None) -> random values\n \"\"\"\n if lam <= 0:\n raise ValueError(\"lam <= 0\")\n return discd_array(self.internal_state, rk_poisson, size, lam)\n\n def zipf(self, double a, size=None):\n \"\"\"Zipf distribution.\n \n zipf(a, size=None)\n \"\"\"\n if a <= 1.0:\n raise ValueError(\"a <= 1.0\")\n return discd_array(self.internal_state, rk_zipf, size, a)\n \n def geometric(self, double p, size=None):\n \"\"\"Geometric distribution with p being the probability of \"success\" on\n an individual trial.\n \n geometric(p, size=None)\n \"\"\"\n if p < 0.0:\n raise ValueError(\"p < 0.0\")\n elif p > 1.0:\n raise ValueError(\"p > 1.0\")\n return discd_array(self.internal_state, rk_geometric, size, p)\n \n def hypergeometric(self, long ngood, long nbad, long nsample, size=None):\n \"\"\"Hypergeometric distribution.\n \n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one \n were to draw nsample balls from the urn without replacement, then \n the hypergeometric distribution describes the distribution of \"good\" \n balls in the sample.\n \n hypergeometric(ngood, nbad, nsample, size=None) \n \"\"\"\n if ngood < 1:\n raise ValueError(\"ngood < 1\")\n elif nbad < 1:\n raise ValueError(\"nbad < 1\")\n elif ngood + nbad < nsample:\n raise ValueError(\"ngood + nbad < nsample\")\n elif nsample < 1:\n raise ValueError(\"nsample < 1\")\n return discnmN_array(self.internal_state, rk_hypergeometric, size,\n ngood, nbad, nsample)\n\n def logseries(self, double p, size=None):\n \"\"\"Logarithmic series distribution.\n \n logseries(p, size=None)\n \"\"\"\n if p < 0:\n raise ValueError(\"p < 0\")\n elif p > 1:\n raise ValueError(\"p > 1\")\n return discd_array(self.internal_state, rk_logseries, size, p)\n\n # Multivariate distributions:\n def multivariate_normal(self, mean, cov, size=None):\n \"\"\"Return an array containing multivariate normally distributed random numbers\n with specified mean and covariance.\n\n multivariate_normal(mean, cov) -> random values\n multivariate_normal(mean, cov, [m, n, ...]) -> random values\n\n mean must be a 1 dimensional array. cov must be a square two dimensional\n array with the same number of rows and columns as mean has elements.\n\n The first form returns a single 1-D array containing a multivariate\n normal.\n\n The second form returns an array of shape (m, n, ..., cov.shape[0]).\n In this case, output[i,j,...,:] is a 1-D array containing a multivariate\n normal.\n \"\"\"\n # Check preconditions on arguments\n mean = _sp.array(mean)\n cov = _sp.array(cov)\n if size is None:\n shape = []\n else:\n shape = size\n if len(mean.shape) != 1:\n raise ArgumentError(\"mean must be 1 dimensional\")\n if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):\n raise ArgumentError(\"cov must be 2 dimensional and square\")\n if mean.shape[0] != cov.shape[0]:\n raise ArgumentError(\"mean and cov must have same length\")\n # Compute shape of output\n if isinstance(shape, int):\n shape = [shape]\n final_shape = list(shape[:])\n final_shape.append(mean.shape[0])\n # Create a matrix of independent standard normally distributed random\n # numbers. The matrix has rows with the same length as mean and as\n # many rows are necessary to form a matrix of shape final_shape.\n x = standard_normal(_sp.multiply.reduce(final_shape))\n x.shape = (_sp.multiply.reduce(final_shape[0:len(final_shape)-1]),\n mean.shape[0])\n # Transform matrix of standard normals into matrix where each row\n # contains multivariate normals with the desired covariance.\n # Compute A such that matrixmultiply(transpose(A),A) == cov.\n # Then the matrix products of the rows of x and A has the desired\n # covariance. Note that sqrt(s)*v where (u,s,v) is the singular value\n # decomposition of cov is such an A.\n \n from numpy.linalg import svd\n # XXX: we really should be doing this by Cholesky decomposition\n (u,s,v) = svd(cov)\n x = _sp.matrixmultiply(x*_sp.sqrt(s),v)\n # The rows of x now have the correct covariance but mean 0. Add\n # mean to each row. Then each row will have mean mean.\n _sp.add(mean,x,x)\n x.shape = tuple(final_shape)\n return x\n\n def multinomial(self, long n, object pvals, size=None):\n \"\"\"Multinomial distribution.\n \n multinomial(n, pvals, size=None) -> random values\n\n pvals is a sequence of probabilities that should sum to 1 (however, the\n last element is always assumed to account for the remaining probability\n as long as sum(pvals[:-1]) <= 1).\n \"\"\"\n cdef long d\n cdef ndarray parr \"arrayObject_parr\", mnarr \"arrayObject_mnarr\"\n cdef double *pix\n cdef long *mnix\n cdef long i, j, dn\n cdef double Sum\n\n d = len(pvals)\n parr = PyArray_ContiguousFromObject(pvals, PyArray_DOUBLE, 1, 1)\n pix = parr.data\n\n if kahan_sum(pix, d-1) > 1.0:\n raise ValueError(\"sum(pvals) > 1.0\")\n\n if size is None:\n shape = (d,)\n elif type(size) is int:\n shape = (size, d)\n else:\n shape = size + (d,)\n\n multin = _sp.zeros(shape, _sp.Int)\n mnarr = multin\n mnix = mnarr.data\n i = 0\n while i < PyArray_SIZE(mnarr):\n Sum = 1.0\n dn = n\n for j from 0 <= j < d-1:\n mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)\n dn = dn - mnix[i+j]\n if dn <= 0:\n break\n Sum = Sum - pix[j]\n if dn > 0:\n mnix[i+d-1] = dn\n\n i = i + d\n\n return multin\n\n # Shuffling and permutations:\n def shuffle(self, object x):\n \"\"\"Modify a sequence in-place by shuffling its contents.\n \n shuffle(x)\n \"\"\"\n cdef long i, j\n\n # adaptation of random.shuffle()\n i = len(x) - 1\n while i > 0:\n j = rk_interval(i, self.internal_state)\n x[i], x[j] = x[j], x[i]\n i = i - 1\n \n def permutation(self, object x):\n \"\"\"Given an integer, return a shuffled sequence of integers >= 0 and \n < x; given a sequence, return a shuffled array copy.\n\n permutation(x)\n \"\"\"\n if type(x) is int:\n arr = _sp.arange(x)\n else:\n arr = _sp.array(x)\n self.shuffle(arr)\n return arr \n\n_rand = RandomState()\nseed = _rand.seed\nget_state = _rand.get_state\nset_state = _rand.set_state\nrandom_sample = _rand.random_sample\nrandint = _rand.randint\nbytes = _rand.bytes\nuniform = _rand.uniform\nrand = _rand.rand\nrandn = _rand.randn\nrandom_integers = _rand.random_integers\nstandard_normal = _rand.standard_normal\nnormal = _rand.normal\nbeta = _rand.beta\nexponential = _rand.exponential\nstandard_exponential = _rand.standard_exponential\nstandard_gamma = _rand.standard_gamma\ngamma = _rand.gamma\nf = _rand.f\nnoncentral_f = _rand.noncentral_f\nchisquare = _rand.chisquare\nnoncentral_chisquare = _rand.noncentral_chisquare\nstandard_cauchy = _rand.standard_cauchy\nstandard_t = _rand.standard_t\nvonmises = _rand.vonmises\npareto = _rand.pareto\nweibull = _rand.weibull\npower = _rand.power\nlaplace = _rand.laplace\ngumbel = _rand.gumbel\nlogistic = _rand.logistic\nlognormal = _rand.lognormal\nrayleigh = _rand.rayleigh\nwald = _rand.wald\ntriangular = _rand.triangular\n\nbinomial = _rand.binomial\nnegative_binomial = _rand.negative_binomial\npoisson = _rand.poisson\nzipf = _rand.zipf\ngeometric = _rand.geometric\nhypergeometric = _rand.hypergeometric\nlogseries = _rand.logseries\n\nmultivariate_normal = _rand.multivariate_normal\nmultinomial = _rand.multinomial\n\nshuffle = _rand.shuffle\npermutation = _rand.permutation\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "", + " from numpy.dual import svd" + ], + "deleted": [ + "", + " from numpy.linalg import svd" + ] + } + } + ] + }, + { + "hash": "b97663c8b33bbce12926887bf6ddac68fbadb42d", + "msg": "Remove deconvolve", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T08:40:43+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T08:40:43+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "4dd79b090e85566d3d3290357c3a9bbdd2558dc1" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 19, + "insertions": 0, + "lines": 19, + "files": 1, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.0, + "modified_files": [ + { + "old_path": "numpy/lib/polynomial.py", + "new_path": "numpy/lib/polynomial.py", + "filename": "polynomial.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -284,25 +284,6 @@ def polymul(a1, a2):\n val = poly1d(val)\n return val\n \n-\n-def deconvolve(signal, divisor):\n- \"\"\"Deconvolves divisor out of signal. Requires numpy.signal library\n- \"\"\"\n- import scipy.signal\n- num = atleast_1d(signal)\n- den = atleast_1d(divisor)\n- N = len(num)\n- D = len(den)\n- if D > N:\n- quot = [];\n- rem = num;\n- else:\n- input = NX.ones(N-D+1, float)\n- input[1:] = 0\n- quot = numpy.signal.lfilter(num, den, input)\n- rem = num - NX.convolve(den, quot, mode='full')\n- return quot, rem\n-\n def polydiv(u, v):\n \"\"\"Computes q and r polynomials so that u(s) = q(s)*v(s) + r(s)\n and deg r < deg v.\n", + "added_lines": 0, + "deleted_lines": 19, + "source_code": "\"\"\"\nFunctions to operate on polynomials.\n\"\"\"\n\n__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',\n 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',\n 'polyfit']\n\nimport re\nimport numpy.core.numeric as NX\n\nfrom numpy.core import isscalar\nfrom twodim_base import diag, vander\nfrom shape_base import hstack, atleast_1d\nfrom function_base import trim_zeros, sort_complex\neigvals = None\nlstsq = None\n\ndef get_linalg_funcs():\n \"Look for linear algebra functions in numpy\"\n global eigvals, lstsq\n from numpy.dual import eigvals, lstsq\n return\n\ndef _eigvals(arg):\n \"Return the eigenvalues of the argument\"\n try:\n return eigvals(arg)\n except TypeError:\n get_linalg_funcs()\n return eigvals(arg)\n\ndef _lstsq(X, y):\n \"Do least squares on the arguments\"\n try:\n return lstsq(X, y)\n except TypeError:\n get_linalg_funcs()\n return lstsq(X, y)\n\ndef poly(seq_of_zeros):\n \"\"\" Return a sequence representing a polynomial given a sequence of roots.\n\n If the input is a matrix, return the characteristic polynomial.\n\n Example:\n\n >>> b = roots([1,3,1,5,6])\n >>> poly(b)\n array([1., 3., 1., 5., 6.])\n \"\"\"\n seq_of_zeros = atleast_1d(seq_of_zeros)\n sh = seq_of_zeros.shape\n if len(sh) == 2 and sh[0] == sh[1]:\n seq_of_zeros = _eigvals(seq_of_zeros)\n elif len(sh) ==1:\n pass\n else:\n raise ValueError, \"input must be 1d or square 2d array.\"\n\n if len(seq_of_zeros) == 0:\n return 1.0\n\n a = [1]\n for k in range(len(seq_of_zeros)):\n a = NX.convolve(a, [1, -seq_of_zeros[k]], mode='full')\n\n if issubclass(a.dtype, NX.complexfloating):\n # if complex roots are all complex conjugates, the roots are real.\n roots = NX.asarray(seq_of_zeros, complex)\n pos_roots = sort_complex(NX.compress(roots.imag > 0, roots))\n neg_roots = NX.conjugate(sort_complex(\n NX.compress(roots.imag < 0,roots)))\n if (len(pos_roots) == len(neg_roots) and\n NX.alltrue(neg_roots == pos_roots)):\n a = a.real.copy()\n\n return a\n\ndef roots(p):\n \"\"\" Return the roots of the polynomial coefficients in p.\n\n The values in the rank-1 array p are coefficients of a polynomial.\n If the length of p is n+1 then the polynomial is\n p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]\n \"\"\"\n # If input is scalar, this makes it an array\n p = atleast_1d(p)\n if len(p.shape) != 1:\n raise ValueError,\"Input must be a rank-1 array.\"\n\n # find non-zero array entries\n non_zero = NX.nonzero(NX.ravel(p))\n\n # find the number of trailing zeros -- this is the number of roots at 0.\n trailing_zeros = len(p) - non_zero[-1] - 1\n\n # strip leading and trailing zeros\n p = p[int(non_zero[0]):int(non_zero[-1])+1]\n\n # casting: if incoming array isn't floating point, make it floating point.\n if not issubclass(p.dtype, (NX.floating, NX.complexfloating)):\n p = p.astype(float)\n\n N = len(p)\n if N > 1:\n # build companion matrix and find its eigenvalues (the roots)\n A = diag(NX.ones((N-2,), p.dtype), -1)\n A[0, :] = -p[1:] / p[0]\n roots = _eigvals(A)\n else:\n return NX.array([])\n\n # tack any zeros onto the back of the array\n roots = hstack((roots, NX.zeros(trailing_zeros, roots.dtype)))\n return roots\n\ndef polyint(p, m=1, k=None):\n \"\"\"Return the mth analytical integral of the polynomial p.\n\n If k is None, then zero-valued constants of integration are used.\n otherwise, k should be a list of length m (or a scalar if m=1) to\n represent the constants of integration to use for each integration\n (starting with k[0])\n \"\"\"\n m = int(m)\n if m < 0:\n raise ValueError, \"Order of integral must be positive (see polyder)\"\n if k is None:\n k = NX.zeros(m, float)\n k = atleast_1d(k)\n if len(k) == 1 and m > 1:\n k = k[0]*NX.ones(m, float)\n if len(k) < m:\n raise ValueError, \\\n \"k must be a scalar or a rank-1 array of length 1 or >m.\"\n if m == 0:\n return p\n else:\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n y = NX.zeros(len(p)+1, float)\n y[:-1] = p*1.0/NX.arange(len(p), 0, -1)\n y[-1] = k[0]\n val = polyint(y, m-1, k=k[1:])\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyder(p, m=1):\n \"\"\"Return the mth derivative of the polynomial p.\n \"\"\"\n m = int(m)\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n n = len(p)-1\n y = p[:-1] * NX.arange(n, 0, -1)\n if m < 0:\n raise ValueError, \"Order of derivative must be positive (see polyint)\"\n if m == 0:\n return p\n else:\n val = polyder(y, m-1)\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyfit(x, y, N):\n \"\"\"\n\n Do a best fit polynomial of order N of y to x. Return value is a\n vector of polynomial coefficients [pk ... p1 p0]. Eg, for N=2\n\n p2*x0^2 + p1*x0 + p0 = y1\n p2*x1^2 + p1*x1 + p0 = y1\n p2*x2^2 + p1*x2 + p0 = y2\n .....\n p2*xk^2 + p1*xk + p0 = yk\n\n\n Method: if X is a the Vandermonde Matrix computed from x (see\n http://mathworld.wolfram.com/VandermondeMatrix.html), then the\n polynomial least squares solution is given by the 'p' in\n\n X*p = y\n\n where X is a len(x) x N+1 matrix, p is a N+1 length vector, and y\n is a len(x) x 1 vector\n\n This equation can be solved as\n\n p = (XT*X)^-1 * XT * y\n\n where XT is the transpose of X and -1 denotes the inverse.\n\n For more info, see\n http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html,\n but note that the k's and n's in the superscripts and subscripts\n on that page. The linear algebra is correct, however.\n\n See also polyval\n\n \"\"\"\n x = NX.asarray(x)+0.\n y = NX.asarray(y)+0.\n y = NX.reshape(y, (len(y), 1))\n X = vander(x, N+1)\n c, resids, rank, s = _lstsq(X, y)\n c.shape = (N+1,)\n return c\n\n\n\ndef polyval(p, x):\n \"\"\"Evaluate the polynomial p at x. If x is a polynomial then composition.\n\n Description:\n\n If p is of length N, this function returns the value:\n p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]\n\n x can be a sequence and p(x) will be returned for all elements of x.\n or x can be another polynomial and the composite polynomial p(x) will be\n returned.\n\n Notice: This can produce inaccurate results for polynomials with\n significant variability. Use carefully.\n \"\"\"\n p = NX.asarray(p)\n if isinstance(x, poly1d):\n y = 0\n else:\n x = NX.asarray(x)\n y = NX.zeros_like(x)\n for i in range(len(p)):\n y = x * y + p[i]\n return y\n\ndef polyadd(a1, a2):\n \"\"\"Adds two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 + a2\n elif diff > 0:\n zr = NX.zeros(diff, a1.dtype)\n val = NX.concatenate((zr, a1)) + a2\n else:\n zr = NX.zeros(abs(diff), a2.dtype)\n val = a1 + NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polysub(a1, a2):\n \"\"\"Subtracts two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 - a2\n elif diff > 0:\n zr = NX.zeros(diff, a1)\n val = NX.concatenate((zr, a1)) - a2\n else:\n zr = NX.zeros(abs(diff), a2)\n val = a1 - NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef polymul(a1, a2):\n \"\"\"Multiplies two polynomials represented as sequences.\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n val = NX.convolve(a1, a2)\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polydiv(u, v):\n \"\"\"Computes q and r polynomials so that u(s) = q(s)*v(s) + r(s)\n and deg r < deg v.\n \"\"\"\n truepoly = (isinstance(u, poly1d) or isinstance(u, poly1d))\n u = atleast_1d(u)\n v = atleast_1d(v)\n m = len(u) - 1\n n = len(v) - 1\n scale = 1. / v[0]\n q = NX.zeros((m-n+1,), float)\n r = u.copy()\n for k in range(0, m-n+1):\n d = scale * r[k]\n q[k] = d\n r[k:k+n+1] -= d*v\n while NX.allclose(r[0], 0, rtol=1e-14) and (r.shape[-1] > 1):\n r = r[1:]\n if truepoly:\n q = poly1d(q)\n r = poly1d(r)\n return q, r\n\n_poly_mat = re.compile(r\"[*][*]([0-9]*)\")\ndef _raise_power(astr, wrap=70):\n n = 0\n line1 = ''\n line2 = ''\n output = ' '\n while 1:\n mat = _poly_mat.search(astr, n)\n if mat is None:\n break\n span = mat.span()\n power = mat.groups()[0]\n partstr = astr[n:span[0]]\n n = span[1]\n toadd2 = partstr + ' '*(len(power)-1)\n toadd1 = ' '*(len(partstr)-1) + power\n if ((len(line2)+len(toadd2) > wrap) or \\\n (len(line1)+len(toadd1) > wrap)):\n output += line1 + \"\\n\" + line2 + \"\\n \"\n line1 = toadd1\n line2 = toadd2\n else:\n line2 += partstr + ' '*(len(power)-1)\n line1 += ' '*(len(partstr)-1) + power\n output += line1 + \"\\n\" + line2\n return output + astr[n:]\n\n\nclass poly1d(object):\n \"\"\"A one-dimensional polynomial class.\n\n p = poly1d([1,2,3]) constructs the polynomial x**2 + 2 x + 3\n\n p(0.5) evaluates the polynomial at the location\n p.r is a list of roots\n p.c is the coefficient array [1,2,3]\n p.order is the polynomial order (after leading zeros in p.c are removed)\n p[k] is the coefficient on the kth power of x (backwards from\n sequencing the coefficient array.\n\n polynomials can be added, substracted, multplied and divided (returns\n quotient and remainder).\n asarray(p) will also give the coefficient array, so polynomials can\n be used in all functions that accept arrays.\n\n p = poly1d([1,2,3], variable='lambda') will use lambda in the\n string representation of p.\n \"\"\"\n def __init__(self, c_or_r, r=0, variable=None):\n if isinstance(c_or_r, poly1d):\n for key in c_or_r.__dict__.keys():\n self.__dict__[key] = c_or_r.__dict__[key]\n if variable is not None:\n self.__dict__['variable'] = variable\n return\n if r:\n c_or_r = poly(c_or_r)\n c_or_r = atleast_1d(c_or_r)\n if len(c_or_r.shape) > 1:\n raise ValueError, \"Polynomial must be 1d only.\"\n c_or_r = trim_zeros(c_or_r, trim='f')\n if len(c_or_r) == 0:\n c_or_r = NX.array([0.])\n self.__dict__['coeffs'] = c_or_r\n self.__dict__['order'] = len(c_or_r) - 1\n if variable is None:\n variable = 'x'\n self.__dict__['variable'] = variable\n\n def __array__(self, t=None):\n if t:\n return NX.asarray(self.coeffs, t)\n else:\n return NX.asarray(self.coeffs)\n\n def __repr__(self):\n vals = repr(self.coeffs)\n vals = vals[6:-1]\n return \"poly1d(%s)\" % vals\n\n def __len__(self):\n return self.order\n\n def __str__(self):\n N = self.order\n thestr = \"0\"\n var = self.variable\n for k in range(len(self.coeffs)):\n coefstr ='%.4g' % abs(self.coeffs[k])\n if coefstr[-4:] == '0000':\n coefstr = coefstr[:-5]\n power = (N-k)\n if power == 0:\n if coefstr != '0':\n newstr = '%s' % (coefstr,)\n else:\n if k == 0:\n newstr = '0'\n else:\n newstr = ''\n elif power == 1:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = var\n else:\n newstr = '%s %s' % (coefstr, var)\n else:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = '%s**%d' % (var, power,)\n else:\n newstr = '%s %s**%d' % (coefstr, var, power)\n\n if k > 0:\n if newstr != '':\n if self.coeffs[k] < 0:\n thestr = \"%s - %s\" % (thestr, newstr)\n else:\n thestr = \"%s + %s\" % (thestr, newstr)\n elif (k == 0) and (newstr != '') and (self.coeffs[k] < 0):\n thestr = \"-%s\" % (newstr,)\n else:\n thestr = newstr\n return _raise_power(thestr)\n\n\n def __call__(self, val):\n return polyval(self.coeffs, val)\n\n def __mul__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs * other)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __rmul__(self, other):\n if isscalar(other):\n return poly1d(other * self.coeffs)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __add__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __radd__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __pow__(self, val):\n if not isscalar(val) or int(val) != val or val < 0:\n raise ValueError, \"Power to non-negative integers only.\"\n res = [1]\n for k in range(val):\n res = polymul(self.coeffs, res)\n return poly1d(res)\n\n def __sub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(self.coeffs, other.coeffs))\n\n def __rsub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(other.coeffs, self.coeffs))\n\n def __div__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs/other)\n else:\n other = poly1d(other)\n return polydiv(self, other)\n\n def __rdiv__(self, other):\n if isscalar(other):\n return poly1d(other/self.coeffs)\n else:\n other = poly1d(other)\n return polydiv(other, self)\n\n def __setattr__(self, key, val):\n raise ValueError, \"Attributes cannot be changed this way.\"\n\n def __getattr__(self, key):\n if key in ['r', 'roots']:\n return roots(self.coeffs)\n elif key in ['c','coef','coefficients']:\n return self.coeffs\n elif key in ['o']:\n return self.order\n else:\n return self.__dict__[key]\n\n def __getitem__(self, val):\n ind = self.order - val\n if val > self.order:\n return 0\n if val < 0:\n return 0\n return self.coeffs[ind]\n\n def __setitem__(self, key, val):\n ind = self.order - key\n if key < 0:\n raise ValueError, \"Does not support negative powers.\"\n if key > self.order:\n zr = NX.zeros(key-self.order, self.coeffs.dtype)\n self.__dict__['coeffs'] = NX.concatenate((zr, self.coeffs))\n self.__dict__['order'] = key\n ind = 0\n self.__dict__['coeffs'][ind] = val\n return\n\n def integ(self, m=1, k=0):\n \"\"\"Return the mth analytical integral of this polynomial.\n See the documentation for polyint.\n \"\"\"\n return poly1d(polyint(self.coeffs, m=m, k=k))\n\n def deriv(self, m=1):\n \"\"\"Return the mth derivative of this polynomial.\n \"\"\"\n return poly1d(polyder(self.coeffs, m=m))\n", + "source_code_before": "\"\"\"\nFunctions to operate on polynomials.\n\"\"\"\n\n__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',\n 'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',\n 'polyfit']\n\nimport re\nimport numpy.core.numeric as NX\n\nfrom numpy.core import isscalar\nfrom twodim_base import diag, vander\nfrom shape_base import hstack, atleast_1d\nfrom function_base import trim_zeros, sort_complex\neigvals = None\nlstsq = None\n\ndef get_linalg_funcs():\n \"Look for linear algebra functions in numpy\"\n global eigvals, lstsq\n from numpy.dual import eigvals, lstsq\n return\n\ndef _eigvals(arg):\n \"Return the eigenvalues of the argument\"\n try:\n return eigvals(arg)\n except TypeError:\n get_linalg_funcs()\n return eigvals(arg)\n\ndef _lstsq(X, y):\n \"Do least squares on the arguments\"\n try:\n return lstsq(X, y)\n except TypeError:\n get_linalg_funcs()\n return lstsq(X, y)\n\ndef poly(seq_of_zeros):\n \"\"\" Return a sequence representing a polynomial given a sequence of roots.\n\n If the input is a matrix, return the characteristic polynomial.\n\n Example:\n\n >>> b = roots([1,3,1,5,6])\n >>> poly(b)\n array([1., 3., 1., 5., 6.])\n \"\"\"\n seq_of_zeros = atleast_1d(seq_of_zeros)\n sh = seq_of_zeros.shape\n if len(sh) == 2 and sh[0] == sh[1]:\n seq_of_zeros = _eigvals(seq_of_zeros)\n elif len(sh) ==1:\n pass\n else:\n raise ValueError, \"input must be 1d or square 2d array.\"\n\n if len(seq_of_zeros) == 0:\n return 1.0\n\n a = [1]\n for k in range(len(seq_of_zeros)):\n a = NX.convolve(a, [1, -seq_of_zeros[k]], mode='full')\n\n if issubclass(a.dtype, NX.complexfloating):\n # if complex roots are all complex conjugates, the roots are real.\n roots = NX.asarray(seq_of_zeros, complex)\n pos_roots = sort_complex(NX.compress(roots.imag > 0, roots))\n neg_roots = NX.conjugate(sort_complex(\n NX.compress(roots.imag < 0,roots)))\n if (len(pos_roots) == len(neg_roots) and\n NX.alltrue(neg_roots == pos_roots)):\n a = a.real.copy()\n\n return a\n\ndef roots(p):\n \"\"\" Return the roots of the polynomial coefficients in p.\n\n The values in the rank-1 array p are coefficients of a polynomial.\n If the length of p is n+1 then the polynomial is\n p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]\n \"\"\"\n # If input is scalar, this makes it an array\n p = atleast_1d(p)\n if len(p.shape) != 1:\n raise ValueError,\"Input must be a rank-1 array.\"\n\n # find non-zero array entries\n non_zero = NX.nonzero(NX.ravel(p))\n\n # find the number of trailing zeros -- this is the number of roots at 0.\n trailing_zeros = len(p) - non_zero[-1] - 1\n\n # strip leading and trailing zeros\n p = p[int(non_zero[0]):int(non_zero[-1])+1]\n\n # casting: if incoming array isn't floating point, make it floating point.\n if not issubclass(p.dtype, (NX.floating, NX.complexfloating)):\n p = p.astype(float)\n\n N = len(p)\n if N > 1:\n # build companion matrix and find its eigenvalues (the roots)\n A = diag(NX.ones((N-2,), p.dtype), -1)\n A[0, :] = -p[1:] / p[0]\n roots = _eigvals(A)\n else:\n return NX.array([])\n\n # tack any zeros onto the back of the array\n roots = hstack((roots, NX.zeros(trailing_zeros, roots.dtype)))\n return roots\n\ndef polyint(p, m=1, k=None):\n \"\"\"Return the mth analytical integral of the polynomial p.\n\n If k is None, then zero-valued constants of integration are used.\n otherwise, k should be a list of length m (or a scalar if m=1) to\n represent the constants of integration to use for each integration\n (starting with k[0])\n \"\"\"\n m = int(m)\n if m < 0:\n raise ValueError, \"Order of integral must be positive (see polyder)\"\n if k is None:\n k = NX.zeros(m, float)\n k = atleast_1d(k)\n if len(k) == 1 and m > 1:\n k = k[0]*NX.ones(m, float)\n if len(k) < m:\n raise ValueError, \\\n \"k must be a scalar or a rank-1 array of length 1 or >m.\"\n if m == 0:\n return p\n else:\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n y = NX.zeros(len(p)+1, float)\n y[:-1] = p*1.0/NX.arange(len(p), 0, -1)\n y[-1] = k[0]\n val = polyint(y, m-1, k=k[1:])\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyder(p, m=1):\n \"\"\"Return the mth derivative of the polynomial p.\n \"\"\"\n m = int(m)\n truepoly = isinstance(p, poly1d)\n p = NX.asarray(p)\n n = len(p)-1\n y = p[:-1] * NX.arange(n, 0, -1)\n if m < 0:\n raise ValueError, \"Order of derivative must be positive (see polyint)\"\n if m == 0:\n return p\n else:\n val = polyder(y, m-1)\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polyfit(x, y, N):\n \"\"\"\n\n Do a best fit polynomial of order N of y to x. Return value is a\n vector of polynomial coefficients [pk ... p1 p0]. Eg, for N=2\n\n p2*x0^2 + p1*x0 + p0 = y1\n p2*x1^2 + p1*x1 + p0 = y1\n p2*x2^2 + p1*x2 + p0 = y2\n .....\n p2*xk^2 + p1*xk + p0 = yk\n\n\n Method: if X is a the Vandermonde Matrix computed from x (see\n http://mathworld.wolfram.com/VandermondeMatrix.html), then the\n polynomial least squares solution is given by the 'p' in\n\n X*p = y\n\n where X is a len(x) x N+1 matrix, p is a N+1 length vector, and y\n is a len(x) x 1 vector\n\n This equation can be solved as\n\n p = (XT*X)^-1 * XT * y\n\n where XT is the transpose of X and -1 denotes the inverse.\n\n For more info, see\n http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html,\n but note that the k's and n's in the superscripts and subscripts\n on that page. The linear algebra is correct, however.\n\n See also polyval\n\n \"\"\"\n x = NX.asarray(x)+0.\n y = NX.asarray(y)+0.\n y = NX.reshape(y, (len(y), 1))\n X = vander(x, N+1)\n c, resids, rank, s = _lstsq(X, y)\n c.shape = (N+1,)\n return c\n\n\n\ndef polyval(p, x):\n \"\"\"Evaluate the polynomial p at x. If x is a polynomial then composition.\n\n Description:\n\n If p is of length N, this function returns the value:\n p[0]*(x**N-1) + p[1]*(x**N-2) + ... + p[N-2]*x + p[N-1]\n\n x can be a sequence and p(x) will be returned for all elements of x.\n or x can be another polynomial and the composite polynomial p(x) will be\n returned.\n\n Notice: This can produce inaccurate results for polynomials with\n significant variability. Use carefully.\n \"\"\"\n p = NX.asarray(p)\n if isinstance(x, poly1d):\n y = 0\n else:\n x = NX.asarray(x)\n y = NX.zeros_like(x)\n for i in range(len(p)):\n y = x * y + p[i]\n return y\n\ndef polyadd(a1, a2):\n \"\"\"Adds two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 + a2\n elif diff > 0:\n zr = NX.zeros(diff, a1.dtype)\n val = NX.concatenate((zr, a1)) + a2\n else:\n zr = NX.zeros(abs(diff), a2.dtype)\n val = a1 + NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\ndef polysub(a1, a2):\n \"\"\"Subtracts two polynomials represented as sequences\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n a1 = atleast_1d(a1)\n a2 = atleast_1d(a2)\n diff = len(a2) - len(a1)\n if diff == 0:\n return a1 - a2\n elif diff > 0:\n zr = NX.zeros(diff, a1)\n val = NX.concatenate((zr, a1)) - a2\n else:\n zr = NX.zeros(abs(diff), a2)\n val = a1 - NX.concatenate((zr, a2))\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef polymul(a1, a2):\n \"\"\"Multiplies two polynomials represented as sequences.\n \"\"\"\n truepoly = (isinstance(a1, poly1d) or isinstance(a2, poly1d))\n val = NX.convolve(a1, a2)\n if truepoly:\n val = poly1d(val)\n return val\n\n\ndef deconvolve(signal, divisor):\n \"\"\"Deconvolves divisor out of signal. Requires numpy.signal library\n \"\"\"\n import scipy.signal\n num = atleast_1d(signal)\n den = atleast_1d(divisor)\n N = len(num)\n D = len(den)\n if D > N:\n quot = [];\n rem = num;\n else:\n input = NX.ones(N-D+1, float)\n input[1:] = 0\n quot = numpy.signal.lfilter(num, den, input)\n rem = num - NX.convolve(den, quot, mode='full')\n return quot, rem\n\ndef polydiv(u, v):\n \"\"\"Computes q and r polynomials so that u(s) = q(s)*v(s) + r(s)\n and deg r < deg v.\n \"\"\"\n truepoly = (isinstance(u, poly1d) or isinstance(u, poly1d))\n u = atleast_1d(u)\n v = atleast_1d(v)\n m = len(u) - 1\n n = len(v) - 1\n scale = 1. / v[0]\n q = NX.zeros((m-n+1,), float)\n r = u.copy()\n for k in range(0, m-n+1):\n d = scale * r[k]\n q[k] = d\n r[k:k+n+1] -= d*v\n while NX.allclose(r[0], 0, rtol=1e-14) and (r.shape[-1] > 1):\n r = r[1:]\n if truepoly:\n q = poly1d(q)\n r = poly1d(r)\n return q, r\n\n_poly_mat = re.compile(r\"[*][*]([0-9]*)\")\ndef _raise_power(astr, wrap=70):\n n = 0\n line1 = ''\n line2 = ''\n output = ' '\n while 1:\n mat = _poly_mat.search(astr, n)\n if mat is None:\n break\n span = mat.span()\n power = mat.groups()[0]\n partstr = astr[n:span[0]]\n n = span[1]\n toadd2 = partstr + ' '*(len(power)-1)\n toadd1 = ' '*(len(partstr)-1) + power\n if ((len(line2)+len(toadd2) > wrap) or \\\n (len(line1)+len(toadd1) > wrap)):\n output += line1 + \"\\n\" + line2 + \"\\n \"\n line1 = toadd1\n line2 = toadd2\n else:\n line2 += partstr + ' '*(len(power)-1)\n line1 += ' '*(len(partstr)-1) + power\n output += line1 + \"\\n\" + line2\n return output + astr[n:]\n\n\nclass poly1d(object):\n \"\"\"A one-dimensional polynomial class.\n\n p = poly1d([1,2,3]) constructs the polynomial x**2 + 2 x + 3\n\n p(0.5) evaluates the polynomial at the location\n p.r is a list of roots\n p.c is the coefficient array [1,2,3]\n p.order is the polynomial order (after leading zeros in p.c are removed)\n p[k] is the coefficient on the kth power of x (backwards from\n sequencing the coefficient array.\n\n polynomials can be added, substracted, multplied and divided (returns\n quotient and remainder).\n asarray(p) will also give the coefficient array, so polynomials can\n be used in all functions that accept arrays.\n\n p = poly1d([1,2,3], variable='lambda') will use lambda in the\n string representation of p.\n \"\"\"\n def __init__(self, c_or_r, r=0, variable=None):\n if isinstance(c_or_r, poly1d):\n for key in c_or_r.__dict__.keys():\n self.__dict__[key] = c_or_r.__dict__[key]\n if variable is not None:\n self.__dict__['variable'] = variable\n return\n if r:\n c_or_r = poly(c_or_r)\n c_or_r = atleast_1d(c_or_r)\n if len(c_or_r.shape) > 1:\n raise ValueError, \"Polynomial must be 1d only.\"\n c_or_r = trim_zeros(c_or_r, trim='f')\n if len(c_or_r) == 0:\n c_or_r = NX.array([0.])\n self.__dict__['coeffs'] = c_or_r\n self.__dict__['order'] = len(c_or_r) - 1\n if variable is None:\n variable = 'x'\n self.__dict__['variable'] = variable\n\n def __array__(self, t=None):\n if t:\n return NX.asarray(self.coeffs, t)\n else:\n return NX.asarray(self.coeffs)\n\n def __repr__(self):\n vals = repr(self.coeffs)\n vals = vals[6:-1]\n return \"poly1d(%s)\" % vals\n\n def __len__(self):\n return self.order\n\n def __str__(self):\n N = self.order\n thestr = \"0\"\n var = self.variable\n for k in range(len(self.coeffs)):\n coefstr ='%.4g' % abs(self.coeffs[k])\n if coefstr[-4:] == '0000':\n coefstr = coefstr[:-5]\n power = (N-k)\n if power == 0:\n if coefstr != '0':\n newstr = '%s' % (coefstr,)\n else:\n if k == 0:\n newstr = '0'\n else:\n newstr = ''\n elif power == 1:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = var\n else:\n newstr = '%s %s' % (coefstr, var)\n else:\n if coefstr == '0':\n newstr = ''\n elif coefstr == 'b':\n newstr = '%s**%d' % (var, power,)\n else:\n newstr = '%s %s**%d' % (coefstr, var, power)\n\n if k > 0:\n if newstr != '':\n if self.coeffs[k] < 0:\n thestr = \"%s - %s\" % (thestr, newstr)\n else:\n thestr = \"%s + %s\" % (thestr, newstr)\n elif (k == 0) and (newstr != '') and (self.coeffs[k] < 0):\n thestr = \"-%s\" % (newstr,)\n else:\n thestr = newstr\n return _raise_power(thestr)\n\n\n def __call__(self, val):\n return polyval(self.coeffs, val)\n\n def __mul__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs * other)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __rmul__(self, other):\n if isscalar(other):\n return poly1d(other * self.coeffs)\n else:\n other = poly1d(other)\n return poly1d(polymul(self.coeffs, other.coeffs))\n\n def __add__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __radd__(self, other):\n other = poly1d(other)\n return poly1d(polyadd(self.coeffs, other.coeffs))\n\n def __pow__(self, val):\n if not isscalar(val) or int(val) != val or val < 0:\n raise ValueError, \"Power to non-negative integers only.\"\n res = [1]\n for k in range(val):\n res = polymul(self.coeffs, res)\n return poly1d(res)\n\n def __sub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(self.coeffs, other.coeffs))\n\n def __rsub__(self, other):\n other = poly1d(other)\n return poly1d(polysub(other.coeffs, self.coeffs))\n\n def __div__(self, other):\n if isscalar(other):\n return poly1d(self.coeffs/other)\n else:\n other = poly1d(other)\n return polydiv(self, other)\n\n def __rdiv__(self, other):\n if isscalar(other):\n return poly1d(other/self.coeffs)\n else:\n other = poly1d(other)\n return polydiv(other, self)\n\n def __setattr__(self, key, val):\n raise ValueError, \"Attributes cannot be changed this way.\"\n\n def __getattr__(self, key):\n if key in ['r', 'roots']:\n return roots(self.coeffs)\n elif key in ['c','coef','coefficients']:\n return self.coeffs\n elif key in ['o']:\n return self.order\n else:\n return self.__dict__[key]\n\n def __getitem__(self, val):\n ind = self.order - val\n if val > self.order:\n return 0\n if val < 0:\n return 0\n return self.coeffs[ind]\n\n def __setitem__(self, key, val):\n ind = self.order - key\n if key < 0:\n raise ValueError, \"Does not support negative powers.\"\n if key > self.order:\n zr = NX.zeros(key-self.order, self.coeffs.dtype)\n self.__dict__['coeffs'] = NX.concatenate((zr, self.coeffs))\n self.__dict__['order'] = key\n ind = 0\n self.__dict__['coeffs'][ind] = val\n return\n\n def integ(self, m=1, k=0):\n \"\"\"Return the mth analytical integral of this polynomial.\n See the documentation for polyint.\n \"\"\"\n return poly1d(polyint(self.coeffs, m=m, k=k))\n\n def deriv(self, m=1):\n \"\"\"Return the mth derivative of this polynomial.\n \"\"\"\n return poly1d(polyder(self.coeffs, m=m))\n", + "methods": [ + { + "name": "get_linalg_funcs", + "long_name": "get_linalg_funcs( )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [], + "start_line": 19, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_eigvals", + "long_name": "_eigvals( arg )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 24, + "parameters": [ + "arg" + ], + "start_line": 25, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_lstsq", + "long_name": "_lstsq( X , y )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 30, + "parameters": [ + "X", + "y" + ], + "start_line": 33, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "poly", + "long_name": "poly( seq_of_zeros )", + "filename": "polynomial.py", + "nloc": 23, + "complexity": 9, + "token_count": 200, + "parameters": [ + "seq_of_zeros" + ], + "start_line": 41, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "roots", + "long_name": "roots( p )", + "filename": "polynomial.py", + "nloc": 18, + "complexity": 4, + "token_count": 192, + "parameters": [ + "p" + ], + "start_line": 80, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "polyint", + "long_name": "polyint( p , m = 1 , k = None )", + "filename": "polynomial.py", + "nloc": 24, + "complexity": 8, + "token_count": 196, + "parameters": [ + "p", + "m", + "k" + ], + "start_line": 118, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "polyder", + "long_name": "polyder( p , m = 1 )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 4, + "token_count": 99, + "parameters": [ + "p", + "m" + ], + "start_line": 150, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polyfit", + "long_name": "polyfit( x , y , N )", + "filename": "polynomial.py", + "nloc": 8, + "complexity": 1, + "token_count": 85, + "parameters": [ + "x", + "y", + "N" + ], + "start_line": 168, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "polyval", + "long_name": "polyval( p , x )", + "filename": "polynomial.py", + "nloc": 10, + "complexity": 3, + "token_count": 68, + "parameters": [ + "p", + "x" + ], + "start_line": 214, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "polyadd", + "long_name": "polyadd( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 130, + "parameters": [ + "a1", + "a2" + ], + "start_line": 239, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polysub", + "long_name": "polysub( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 126, + "parameters": [ + "a1", + "a2" + ], + "start_line": 258, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polymul", + "long_name": "polymul( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 3, + "token_count": 46, + "parameters": [ + "a1", + "a2" + ], + "start_line": 278, + "end_line": 285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "polydiv", + "long_name": "polydiv( u , v )", + "filename": "polynomial.py", + "nloc": 19, + "complexity": 6, + "token_count": 185, + "parameters": [ + "u", + "v" + ], + "start_line": 287, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_raise_power", + "long_name": "_raise_power( astr , wrap = 70 )", + "filename": "polynomial.py", + "nloc": 25, + "complexity": 5, + "token_count": 194, + "parameters": [ + "astr", + "wrap" + ], + "start_line": 311, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , c_or_r , r = 0 , variable = None )", + "filename": "polynomial.py", + "nloc": 20, + "complexity": 8, + "token_count": 157, + "parameters": [ + "self", + "c_or_r", + "r", + "variable" + ], + "start_line": 358, + "end_line": 377, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "t" + ], + "start_line": 379, + "end_line": 383, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "polynomial.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 385, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self" + ], + "start_line": 390, + "end_line": 391, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "polynomial.py", + "nloc": 42, + "complexity": 17, + "token_count": 254, + "parameters": [ + "self" + ], + "start_line": 393, + "end_line": 435, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "val" + ], + "start_line": 438, + "end_line": 439, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 441, + "end_line": 446, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 448, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 455, + "end_line": 457, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__radd__", + "long_name": "__radd__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 459, + "end_line": 461, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 5, + "token_count": 57, + "parameters": [ + "self", + "val" + ], + "start_line": 463, + "end_line": 469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 471, + "end_line": 473, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 475, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 479, + "end_line": 484, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 486, + "end_line": 491, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__setattr__", + "long_name": "__setattr__( self , key , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 493, + "end_line": 494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , key )", + "filename": "polynomial.py", + "nloc": 9, + "complexity": 4, + "token_count": 58, + "parameters": [ + "self", + "key" + ], + "start_line": 496, + "end_line": 504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 3, + "token_count": 37, + "parameters": [ + "self", + "val" + ], + "start_line": 506, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , key , val )", + "filename": "polynomial.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 514, + "end_line": 524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "integ", + "long_name": "integ( self , m = 1 , k = 0 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "m", + "k" + ], + "start_line": 526, + "end_line": 530, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "deriv", + "long_name": "deriv( self , m = 1 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "m" + ], + "start_line": 532, + "end_line": 535, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "get_linalg_funcs", + "long_name": "get_linalg_funcs( )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [], + "start_line": 19, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_eigvals", + "long_name": "_eigvals( arg )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 24, + "parameters": [ + "arg" + ], + "start_line": 25, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "_lstsq", + "long_name": "_lstsq( X , y )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 2, + "token_count": 30, + "parameters": [ + "X", + "y" + ], + "start_line": 33, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "poly", + "long_name": "poly( seq_of_zeros )", + "filename": "polynomial.py", + "nloc": 23, + "complexity": 9, + "token_count": 200, + "parameters": [ + "seq_of_zeros" + ], + "start_line": 41, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 0 + }, + { + "name": "roots", + "long_name": "roots( p )", + "filename": "polynomial.py", + "nloc": 18, + "complexity": 4, + "token_count": 192, + "parameters": [ + "p" + ], + "start_line": 80, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "polyint", + "long_name": "polyint( p , m = 1 , k = None )", + "filename": "polynomial.py", + "nloc": 24, + "complexity": 8, + "token_count": 196, + "parameters": [ + "p", + "m", + "k" + ], + "start_line": 118, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 0 + }, + { + "name": "polyder", + "long_name": "polyder( p , m = 1 )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 4, + "token_count": 99, + "parameters": [ + "p", + "m" + ], + "start_line": 150, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polyfit", + "long_name": "polyfit( x , y , N )", + "filename": "polynomial.py", + "nloc": 8, + "complexity": 1, + "token_count": 85, + "parameters": [ + "x", + "y", + "N" + ], + "start_line": 168, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 0 + }, + { + "name": "polyval", + "long_name": "polyval( p , x )", + "filename": "polynomial.py", + "nloc": 10, + "complexity": 3, + "token_count": 68, + "parameters": [ + "p", + "x" + ], + "start_line": 214, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "polyadd", + "long_name": "polyadd( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 130, + "parameters": [ + "a1", + "a2" + ], + "start_line": 239, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polysub", + "long_name": "polysub( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 16, + "complexity": 5, + "token_count": 126, + "parameters": [ + "a1", + "a2" + ], + "start_line": 258, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "polymul", + "long_name": "polymul( a1 , a2 )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 3, + "token_count": 46, + "parameters": [ + "a1", + "a2" + ], + "start_line": 278, + "end_line": 285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "deconvolve", + "long_name": "deconvolve( signal , divisor )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 2, + "token_count": 107, + "parameters": [ + "signal", + "divisor" + ], + "start_line": 288, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "polydiv", + "long_name": "polydiv( u , v )", + "filename": "polynomial.py", + "nloc": 19, + "complexity": 6, + "token_count": 185, + "parameters": [ + "u", + "v" + ], + "start_line": 306, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "_raise_power", + "long_name": "_raise_power( astr , wrap = 70 )", + "filename": "polynomial.py", + "nloc": 25, + "complexity": 5, + "token_count": 194, + "parameters": [ + "astr", + "wrap" + ], + "start_line": 330, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , c_or_r , r = 0 , variable = None )", + "filename": "polynomial.py", + "nloc": 20, + "complexity": 8, + "token_count": 157, + "parameters": [ + "self", + "c_or_r", + "r", + "variable" + ], + "start_line": 377, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "__array__", + "long_name": "__array__( self , t = None )", + "filename": "polynomial.py", + "nloc": 5, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "t" + ], + "start_line": 398, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "polynomial.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 404, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self" + ], + "start_line": 409, + "end_line": 410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__str__", + "long_name": "__str__( self )", + "filename": "polynomial.py", + "nloc": 42, + "complexity": 17, + "token_count": 254, + "parameters": [ + "self" + ], + "start_line": 412, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "val" + ], + "start_line": 457, + "end_line": 458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__mul__", + "long_name": "__mul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 460, + "end_line": 465, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rmul__", + "long_name": "__rmul__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 44, + "parameters": [ + "self", + "other" + ], + "start_line": 467, + "end_line": 472, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__add__", + "long_name": "__add__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 474, + "end_line": 476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__radd__", + "long_name": "__radd__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 478, + "end_line": 480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__pow__", + "long_name": "__pow__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 5, + "token_count": 57, + "parameters": [ + "self", + "val" + ], + "start_line": 482, + "end_line": 488, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__sub__", + "long_name": "__sub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 490, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__rsub__", + "long_name": "__rsub__( self , other )", + "filename": "polynomial.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "other" + ], + "start_line": 494, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__div__", + "long_name": "__div__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 498, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__rdiv__", + "long_name": "__rdiv__( self , other )", + "filename": "polynomial.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 505, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "__setattr__", + "long_name": "__setattr__( self , key , val )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 512, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getattr__", + "long_name": "__getattr__( self , key )", + "filename": "polynomial.py", + "nloc": 9, + "complexity": 4, + "token_count": 58, + "parameters": [ + "self", + "key" + ], + "start_line": 515, + "end_line": 523, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , val )", + "filename": "polynomial.py", + "nloc": 7, + "complexity": 3, + "token_count": 37, + "parameters": [ + "self", + "val" + ], + "start_line": 525, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , key , val )", + "filename": "polynomial.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "self", + "key", + "val" + ], + "start_line": 533, + "end_line": 543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "integ", + "long_name": "integ( self , m = 1 , k = 0 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "m", + "k" + ], + "start_line": 545, + "end_line": 549, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "deriv", + "long_name": "deriv( self , m = 1 )", + "filename": "polynomial.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "m" + ], + "start_line": 551, + "end_line": 554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "deconvolve", + "long_name": "deconvolve( signal , divisor )", + "filename": "polynomial.py", + "nloc": 15, + "complexity": 2, + "token_count": 107, + "parameters": [ + "signal", + "divisor" + ], + "start_line": 288, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + } + ], + "nloc": 385, + "complexity": 118, + "token_count": 2789, + "diff_parsed": { + "added": [], + "deleted": [ + "", + "def deconvolve(signal, divisor):", + " \"\"\"Deconvolves divisor out of signal. Requires numpy.signal library", + " \"\"\"", + " import scipy.signal", + " num = atleast_1d(signal)", + " den = atleast_1d(divisor)", + " N = len(num)", + " D = len(den)", + " if D > N:", + " quot = [];", + " rem = num;", + " else:", + " input = NX.ones(N-D+1, float)", + " input[1:] = 0", + " quot = numpy.signal.lfilter(num, den, input)", + " rem = num - NX.convolve(den, quot, mode='full')", + " return quot, rem", + "" + ] + } + } + ] + }, + { + "hash": "8b1e2f929fdfb79e0a446a1fb7bec33a799d492b", + "msg": "Add a few more docstrings using add_docstring.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2006-01-05T10:28:41+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T10:28:41+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "b97663c8b33bbce12926887bf6ddac68fbadb42d" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 8, + "insertions": 68, + "lines": 76, + "files": 6, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.15789473684210525, + "dmm_unit_interfacing": 0.3157894736842105, + "modified_files": [ + { + "old_path": "COMPATIBILITY", + "new_path": "COMPATIBILITY", + "filename": "COMPATIBILITY", + "extension": "COMPATIBILITY", + "change_type": "MODIFY", + "diff": "@@ -1,6 +1,7 @@\n \n \n-X.flat returns an indexable 1-D iterator (mostly similar to an array but always 1-d)\n+X.flat returns an indexable 1-D iterator (mostly similar to an array \n+but always 1-d) --- only has .copy and .__array__ attributes of an array!!!\n \n .typecode() --> .dtypechar\n \n@@ -10,6 +11,8 @@ X.flat returns an indexable 1-D iterator (mostly similar to an array but always\n \n .itemsize() -> .itemsize\n \n+.toscalar() -> .item()\n+\n If you used typecode characters:\n \n 'c' -> 'S1'\n@@ -22,11 +25,12 @@ If you used typecode characters:\n \n C -level\n \n-some API calls that used to take PyObject * now take PyArrayObject * (this should only cause warnings during compile and not actual problems). \n+some API calls that used to take PyObject * now take PyArrayObject * \n+(this should only cause warnings during compile and not actual problems). \n PyArray_Take \n \n These commands now return a buffer that must be freed once it is used\n-using PyMemData_FREE(ptr) or PyMemData_XFREE(ptr);\n+using PyMemData_FREE(ptr);\n \n a->descr->zero --> PyArray_Zero(a)\n a->descr->one --> PyArray_One(a)\n@@ -36,7 +40,8 @@ Numeric/arrayobject.h --> numpy/arrayobject.h\n \n # These will actually work and are defines for PyArray_BYTE, \n # but you really should change it in your code\n-PyArray_CHAR --> PyArray_BYTE (or PyArray_STRING which is more flexible) \n+PyArray_CHAR --> PyArray_BYTE \n+ (or PyArray_STRING which is more flexible) \n PyArray_SBYTE --> PyArray_BYTE\n \n Any uses of character codes will need adjusting....\n@@ -44,8 +49,8 @@ use PyArray_XXXLTR where XXX is the name of the type.\n \n \n If you used function pointers directly (why did you do that?),\n-the arguments have changed. Everything that was an int is now an intp. Also, \n-arrayobjects should be passed in at the end. \n+the arguments have changed. Everything that was an int is now an intp. \n+Also, arrayobjects should be passed in at the end. \n \n a->descr->cast[i](fromdata, fromstep, todata, tostep, n)\n a->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out)\n", + "added_lines": 11, + "deleted_lines": 6, + "source_code": "\n\nX.flat returns an indexable 1-D iterator (mostly similar to an array \nbut always 1-d) --- only has .copy and .__array__ attributes of an array!!!\n\n.typecode() --> .dtypechar\n\n.iscontiguous() --> .flags['CONTIGUOUS'] or .flags.contiguous\n\n.byteswapped() -> .byteswap()\n\n.itemsize() -> .itemsize\n\n.toscalar() -> .item()\n\nIf you used typecode characters:\n\n'c' -> 'S1'\n'b' -> 'B'\n'1' -> 'b'\n's' -> 'h'\n'w' -> 'H'\n'u' -> 'I'\n\n\nC -level\n\nsome API calls that used to take PyObject * now take PyArrayObject * \n(this should only cause warnings during compile and not actual problems). \n PyArray_Take \n\nThese commands now return a buffer that must be freed once it is used\nusing PyMemData_FREE(ptr);\n\na->descr->zero --> PyArray_Zero(a)\na->descr->one --> PyArray_One(a)\n\nNumeric/arrayobject.h --> numpy/arrayobject.h\n\n\n# These will actually work and are defines for PyArray_BYTE, \n# but you really should change it in your code\nPyArray_CHAR --> PyArray_BYTE \n (or PyArray_STRING which is more flexible) \nPyArray_SBYTE --> PyArray_BYTE\n\nAny uses of character codes will need adjusting....\nuse PyArray_XXXLTR where XXX is the name of the type.\n\n\nIf you used function pointers directly (why did you do that?),\nthe arguments have changed. Everything that was an int is now an intp. \nAlso, arrayobjects should be passed in at the end. \n\na->descr->cast[i](fromdata, fromstep, todata, tostep, n)\na->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out)\n anything but single-stepping is not supported by this function\n use the PyArray_CastXXXX functions.\n\n", + "source_code_before": "\n\nX.flat returns an indexable 1-D iterator (mostly similar to an array but always 1-d)\n\n.typecode() --> .dtypechar\n\n.iscontiguous() --> .flags['CONTIGUOUS'] or .flags.contiguous\n\n.byteswapped() -> .byteswap()\n\n.itemsize() -> .itemsize\n\nIf you used typecode characters:\n\n'c' -> 'S1'\n'b' -> 'B'\n'1' -> 'b'\n's' -> 'h'\n'w' -> 'H'\n'u' -> 'I'\n\n\nC -level\n\nsome API calls that used to take PyObject * now take PyArrayObject * (this should only cause warnings during compile and not actual problems). \n PyArray_Take \n\nThese commands now return a buffer that must be freed once it is used\nusing PyMemData_FREE(ptr) or PyMemData_XFREE(ptr);\n\na->descr->zero --> PyArray_Zero(a)\na->descr->one --> PyArray_One(a)\n\nNumeric/arrayobject.h --> numpy/arrayobject.h\n\n\n# These will actually work and are defines for PyArray_BYTE, \n# but you really should change it in your code\nPyArray_CHAR --> PyArray_BYTE (or PyArray_STRING which is more flexible) \nPyArray_SBYTE --> PyArray_BYTE\n\nAny uses of character codes will need adjusting....\nuse PyArray_XXXLTR where XXX is the name of the type.\n\n\nIf you used function pointers directly (why did you do that?),\nthe arguments have changed. Everything that was an int is now an intp. Also, \narrayobjects should be passed in at the end. \n\na->descr->cast[i](fromdata, fromstep, todata, tostep, n)\na->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out)\n anything but single-stepping is not supported by this function\n use the PyArray_CastXXXX functions.\n\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "X.flat returns an indexable 1-D iterator (mostly similar to an array", + "but always 1-d) --- only has .copy and .__array__ attributes of an array!!!", + ".toscalar() -> .item()", + "", + "some API calls that used to take PyObject * now take PyArrayObject *", + "(this should only cause warnings during compile and not actual problems).", + "using PyMemData_FREE(ptr);", + "PyArray_CHAR --> PyArray_BYTE", + " (or PyArray_STRING which is more flexible)", + "the arguments have changed. Everything that was an int is now an intp.", + "Also, arrayobjects should be passed in at the end." + ], + "deleted": [ + "X.flat returns an indexable 1-D iterator (mostly similar to an array but always 1-d)", + "some API calls that used to take PyObject * now take PyArrayObject * (this should only cause warnings during compile and not actual problems).", + "using PyMemData_FREE(ptr) or PyMemData_XFREE(ptr);", + "PyArray_CHAR --> PyArray_BYTE (or PyArray_STRING which is more flexible)", + "the arguments have changed. Everything that was an int is now an intp. Also,", + "arrayobjects should be passed in at the end." + ] + } + }, + { + "old_path": null, + "new_path": "DEV_README.txt", + "filename": "DEV_README.txt", + "extension": "txt", + "change_type": "ADD", + "diff": "@@ -0,0 +1,15 @@\n+\n+Thank you for your willingness to help make NumPy the best array system\n+available.\n+\n+The only rules we like to follow are to try hard to keep the SVN \n+repository in a buildable state and to not indiscriminately muck with \n+others' code. \n+\n+Simple changes and obvious improvements are always welcome. Changes\n+that fundamentally change behavior need discussion on scipy-dev@scipy.org \n+before anything is done.\n+\n+Please add meaningful comments when you check changes in. These comments\n+form the basis of the change-log.\n+\n", + "added_lines": 15, + "deleted_lines": 0, + "source_code": "\nThank you for your willingness to help make NumPy the best array system\navailable.\n\nThe only rules we like to follow are to try hard to keep the SVN \nrepository in a buildable state and to not indiscriminately muck with \nothers' code. \n\nSimple changes and obvious improvements are always welcome. Changes\nthat fundamentally change behavior need discussion on scipy-dev@scipy.org \nbefore anything is done.\n\nPlease add meaningful comments when you check changes in. These comments\nform the basis of the change-log.\n\n", + "source_code_before": null, + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [ + "", + "Thank you for your willingness to help make NumPy the best array system", + "available.", + "", + "The only rules we like to follow are to try hard to keep the SVN", + "repository in a buildable state and to not indiscriminately muck with", + "others' code.", + "", + "Simple changes and obvious improvements are always welcome. Changes", + "that fundamentally change behavior need discussion on scipy-dev@scipy.org", + "before anything is done.", + "", + "Please add meaningful comments when you check changes in. These comments", + "form the basis of the change-log.", + "" + ], + "deleted": [] + } + }, + { + "old_path": "numpy/__init__.py", + "new_path": "numpy/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -42,4 +42,6 @@\n \n test = ScipyTest('numpy').test\n \n+ import add_newdocs\n+\n # TODO: Fix __doc__\n", + "added_lines": 2, + "deleted_lines": 0, + "source_code": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __config__ import show as show_config\nexcept ImportError:\n show_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nif show_config is None:\n print >> sys.stderr, 'Running from numpy source directory.'\nelse:\n from version import version as __version__\n from testing import ScipyTest\n from core import *\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n\n test = ScipyTest('numpy').test\n\n import add_newdocs\n\n # TODO: Fix __doc__\n", + "source_code_before": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __config__ import show as show_config\nexcept ImportError:\n show_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nif show_config is None:\n print >> sys.stderr, 'Running from numpy source directory.'\nelse:\n from version import version as __version__\n from testing import ScipyTest\n from core import *\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n\n test = ScipyTest('numpy').test\n\n # TODO: Fix __doc__\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 39, + "complexity": 0, + "token_count": 116, + "diff_parsed": { + "added": [ + " import add_newdocs", + "" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "numpy/add_newdocs.py", + "filename": "add_newdocs.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,16 @@\n+\n+from lib import add_newdoc\n+\n+add_newdoc('numpy.core','dtypedescr',\n+ [('fields', \"Fields of the data-typedescr if any.\"),\n+ ('alignment', \"Needed alignment for this data-type\"),\n+ ('byteorder',\n+ \"Little-endian (<), big-endian (>), native (=), or \"\\\n+ \"not-applicable (|)\"),\n+ ('char', \"Letter typecode for this descriptor\"),\n+ ('dtype', \"Typeobject associated with this descriptor\"),\n+ ('kind', \"Character giving type-family of this descriptor\"),\n+ ('itemsize', \"Size of each item\"),\n+ ('num', \"Internally-used number for builtin base\")\n+ ]\n+ )\n", + "added_lines": 16, + "deleted_lines": 0, + "source_code": "\nfrom lib import add_newdoc\n\nadd_newdoc('numpy.core','dtypedescr',\n [('fields', \"Fields of the data-typedescr if any.\"),\n ('alignment', \"Needed alignment for this data-type\"),\n ('byteorder',\n \"Little-endian (<), big-endian (>), native (=), or \"\\\n \"not-applicable (|)\"),\n ('char', \"Letter typecode for this descriptor\"),\n ('dtype', \"Typeobject associated with this descriptor\"),\n ('kind', \"Character giving type-family of this descriptor\"),\n ('itemsize', \"Size of each item\"),\n ('num', \"Internally-used number for builtin base\")\n ]\n )\n", + "source_code_before": null, + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 14, + "complexity": 0, + "token_count": 62, + "diff_parsed": { + "added": [ + "", + "from lib import add_newdoc", + "", + "add_newdoc('numpy.core','dtypedescr',", + " [('fields', \"Fields of the data-typedescr if any.\"),", + " ('alignment', \"Needed alignment for this data-type\"),", + " ('byteorder',", + " \"Little-endian (<), big-endian (>), native (=), or \"\\", + " \"not-applicable (|)\"),", + " ('char', \"Letter typecode for this descriptor\"),", + " ('dtype', \"Typeobject associated with this descriptor\"),", + " ('kind', \"Character giving type-family of this descriptor\"),", + " ('itemsize', \"Size of each item\"),", + " ('num', \"Internally-used number for builtin base\")", + " ]", + " )" + ], + "deleted": [] + } + }, + { + "old_path": "numpy/lib/function_base.py", + "new_path": "numpy/lib/function_base.py", + "filename": "function_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,7 +7,7 @@\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n- 'kaiser', 'trapz', 'i0'\n+ 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring',\n ]\n \n import types\n@@ -24,7 +24,7 @@\n from type_check import ScalarType\n from shape_base import atleast_1d\n from twodim_base import diag\n-from _compiled_base import digitize, bincount, _insert\n+from _compiled_base import digitize, bincount, _insert, add_docstring\n \n #end Fernando's utilities\n \n@@ -829,3 +829,18 @@ def trapz(y, x=None, dx=1.0, axis=-1):\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n+\n+#always succeed\n+def add_newdoc(place, obj, doc):\n+ try:\n+ new = {}\n+ exec 'from %s import %s' % (place, obj) in new\n+ if isinstance(doc, str):\n+ add_docstring(new[obj], doc.strip())\n+ elif isinstance(doc, tuple):\n+ add_docstring(getattr(new[obj], doc[0]), doc[1].strip())\n+ elif isinstance(doc, list):\n+ for val in doc:\n+ add_docstring(getattr(new[obj], val[0]), val[1].strip())\n+ except:\n+ pass\n", + "added_lines": 17, + "deleted_lines": 2, + "source_code": "\nl__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', 'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring',\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n asarray, empty, empty_like\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert, add_docstring\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\n## Code from cephes for i0\n\n_i0A = [\n-4.41534164647933937950E-18,\n 3.33079451882223809783E-17,\n-2.43127984654795469359E-16,\n 1.71539128555513303061E-15,\n-1.16853328779934516808E-14,\n 7.67618549860493561688E-14,\n-4.85644678311192946090E-13,\n 2.95505266312963983461E-12,\n-1.72682629144155570723E-11,\n 9.67580903537323691224E-11,\n-5.18979560163526290666E-10,\n 2.65982372468238665035E-9,\n-1.30002500998624804212E-8,\n 6.04699502254191894932E-8,\n-2.67079385394061173391E-7,\n 1.11738753912010371815E-6,\n-4.41673835845875056359E-6,\n 1.64484480707288970893E-5,\n-5.75419501008210370398E-5,\n 1.88502885095841655729E-4,\n-5.76375574538582365885E-4,\n 1.63947561694133579842E-3,\n-4.32430999505057594430E-3,\n 1.05464603945949983183E-2,\n-2.37374148058994688156E-2,\n 4.93052842396707084878E-2,\n-9.49010970480476444210E-2,\n 1.71620901522208775349E-1,\n-3.04682672343198398683E-1,\n 6.76795274409476084995E-1]\n\n_i0B = [\n-7.23318048787475395456E-18,\n-4.83050448594418207126E-18,\n 4.46562142029675999901E-17,\n 3.46122286769746109310E-17,\n-2.82762398051658348494E-16,\n-3.42548561967721913462E-16,\n 1.77256013305652638360E-15,\n 3.81168066935262242075E-15,\n-9.55484669882830764870E-15,\n-4.15056934728722208663E-14,\n 1.54008621752140982691E-14,\n 3.85277838274214270114E-13,\n 7.18012445138366623367E-13,\n-1.79417853150680611778E-12,\n-1.32158118404477131188E-11,\n-3.14991652796324136454E-11,\n 1.18891471078464383424E-11,\n 4.94060238822496958910E-10,\n 3.39623202570838634515E-9,\n 2.26666899049817806459E-8,\n 2.04891858946906374183E-7,\n 2.89137052083475648297E-6,\n 6.88975834691682398426E-5,\n 3.36911647825569408990E-3,\n 8.04490411014108831608E-1]\n\ndef _chbevl(x, vals):\n b0 = vals[0]\n b1 = 0.0\n\n for i in xrange(1,len(vals)):\n b2 = b1\n b1 = b0\n b0 = x*b1 - b2 + vals[i]\n\n return 0.5*(b0 - b2)\n \n\ndef _i0_1(x):\n return exp(x) * _chbevl(x/2.0-2, _i0A)\n\ndef _i0_2(x):\n return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n\ndef i0(x):\n x = atleast_1d(x)\n y = empty_like(x)\n ind = (x<0)\n x[ind] = -x[ind]\n ind = (x<=8.0)\n y[ind] = _i0_1(x[ind])\n ind2 = ~ind\n y[ind2] = _i0_2(x[ind2])\n return y.squeeze() \n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n\n#always succeed\ndef add_newdoc(place, obj, doc):\n try:\n new = {}\n exec 'from %s import %s' % (place, obj) in new\n if isinstance(doc, str):\n add_docstring(new[obj], doc.strip())\n elif isinstance(doc, tuple):\n add_docstring(getattr(new[obj], doc[0]), doc[1].strip())\n elif isinstance(doc, list):\n for val in doc:\n add_docstring(getattr(new[obj], val[0]), val[1].strip())\n except:\n pass\n", + "source_code_before": "\nl__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', 'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz', 'i0'\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n asarray, empty, empty_like\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\n## Code from cephes for i0\n\n_i0A = [\n-4.41534164647933937950E-18,\n 3.33079451882223809783E-17,\n-2.43127984654795469359E-16,\n 1.71539128555513303061E-15,\n-1.16853328779934516808E-14,\n 7.67618549860493561688E-14,\n-4.85644678311192946090E-13,\n 2.95505266312963983461E-12,\n-1.72682629144155570723E-11,\n 9.67580903537323691224E-11,\n-5.18979560163526290666E-10,\n 2.65982372468238665035E-9,\n-1.30002500998624804212E-8,\n 6.04699502254191894932E-8,\n-2.67079385394061173391E-7,\n 1.11738753912010371815E-6,\n-4.41673835845875056359E-6,\n 1.64484480707288970893E-5,\n-5.75419501008210370398E-5,\n 1.88502885095841655729E-4,\n-5.76375574538582365885E-4,\n 1.63947561694133579842E-3,\n-4.32430999505057594430E-3,\n 1.05464603945949983183E-2,\n-2.37374148058994688156E-2,\n 4.93052842396707084878E-2,\n-9.49010970480476444210E-2,\n 1.71620901522208775349E-1,\n-3.04682672343198398683E-1,\n 6.76795274409476084995E-1]\n\n_i0B = [\n-7.23318048787475395456E-18,\n-4.83050448594418207126E-18,\n 4.46562142029675999901E-17,\n 3.46122286769746109310E-17,\n-2.82762398051658348494E-16,\n-3.42548561967721913462E-16,\n 1.77256013305652638360E-15,\n 3.81168066935262242075E-15,\n-9.55484669882830764870E-15,\n-4.15056934728722208663E-14,\n 1.54008621752140982691E-14,\n 3.85277838274214270114E-13,\n 7.18012445138366623367E-13,\n-1.79417853150680611778E-12,\n-1.32158118404477131188E-11,\n-3.14991652796324136454E-11,\n 1.18891471078464383424E-11,\n 4.94060238822496958910E-10,\n 3.39623202570838634515E-9,\n 2.26666899049817806459E-8,\n 2.04891858946906374183E-7,\n 2.89137052083475648297E-6,\n 6.88975834691682398426E-5,\n 3.36911647825569408990E-3,\n 8.04490411014108831608E-1]\n\ndef _chbevl(x, vals):\n b0 = vals[0]\n b1 = 0.0\n\n for i in xrange(1,len(vals)):\n b2 = b1\n b1 = b0\n b0 = x*b1 - b2 + vals[i]\n\n return 0.5*(b0 - b2)\n \n\ndef _i0_1(x):\n return exp(x) * _chbevl(x/2.0-2, _i0A)\n\ndef _i0_2(x):\n return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n\ndef i0(x):\n x = atleast_1d(x)\n y = empty_like(x)\n ind = (x<0)\n x[ind] = -x[ind]\n ind = (x<=8.0)\n y[ind] = _i0_1(x[ind])\n ind2 = ~ind\n y[ind2] = _i0_2(x[ind2])\n return y.squeeze() \n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n", + "methods": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 32, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 54, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 69, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 90, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 171, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 224, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 280, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 287, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 362, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 382, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 398, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 415, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 433, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 455, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 464, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 472, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 487, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 495, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 503, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 519, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 564, + "end_line": 589, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 591, + "end_line": 621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 623, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 664, + "end_line": 669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 671, + "end_line": 675, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 677, + "end_line": 681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 683, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 689, + "end_line": 693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 795, + "end_line": 799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 801, + "end_line": 804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 806, + "end_line": 815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 817, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "add_newdoc", + "long_name": "add_newdoc( place , obj , doc )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 6, + "token_count": 118, + "parameters": [ + "place", + "obj", + "doc" + ], + "start_line": 834, + "end_line": 846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 32, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 54, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 69, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 90, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 171, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 224, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 280, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 287, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 362, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 382, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 398, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 415, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 433, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 455, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 464, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 472, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 487, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 495, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 503, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 519, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 564, + "end_line": 589, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 591, + "end_line": 621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 623, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 664, + "end_line": 669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 671, + "end_line": 675, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 677, + "end_line": 681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 683, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 689, + "end_line": 693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 795, + "end_line": 799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 801, + "end_line": 804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 806, + "end_line": 815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 817, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "add_newdoc", + "long_name": "add_newdoc( place , obj , doc )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 6, + "token_count": 118, + "parameters": [ + "place", + "obj", + "doc" + ], + "start_line": 834, + "end_line": 846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "nloc": 561, + "complexity": 140, + "token_count": 4415, + "diff_parsed": { + "added": [ + " 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring',", + "from _compiled_base import digitize, bincount, _insert, add_docstring", + "", + "#always succeed", + "def add_newdoc(place, obj, doc):", + " try:", + " new = {}", + " exec 'from %s import %s' % (place, obj) in new", + " if isinstance(doc, str):", + " add_docstring(new[obj], doc.strip())", + " elif isinstance(doc, tuple):", + " add_docstring(getattr(new[obj], doc[0]), doc[1].strip())", + " elif isinstance(doc, list):", + " for val in doc:", + " add_docstring(getattr(new[obj], val[0]), val[1].strip())", + " except:", + " pass" + ], + "deleted": [ + " 'kaiser', 'trapz', 'i0'", + "from _compiled_base import digitize, bincount, _insert" + ] + } + }, + { + "old_path": "numpy/lib/src/_compiled_base.c", + "new_path": "numpy/lib/src/_compiled_base.c", + "filename": "_compiled_base.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -339,6 +339,7 @@ arr_insert(PyObject *self, PyObject *args, PyObject *kwdict)\n \n static PyTypeObject *PyMemberDescr_TypePtr=NULL;\n static PyTypeObject *PyGetSetDescr_TypePtr=NULL;\n+static PyTypeObject *PyMethodDescr_TypePtr=NULL;\n \n /* Can only be called if doc is currently NULL\n */\n@@ -377,6 +378,9 @@ arr_add_docstring(PyObject *dummy, PyObject *args)\n \t\t_ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name)\n else if _TESTDOC2(GetSetDescr) \n \t\t_ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name)\n+\telse if _TESTDOC2(MethodDescr)\n+ _ADDDOC(MethodDescr, new->d_method->ml_doc, \n+\t\t\tnew->d_method->ml_name)\n \telse {\n \t\tPyErr_SetString(PyExc_TypeError, \n \t\t\t\t\"Cannot set a docstring for that object\");\n@@ -418,6 +422,9 @@ define_types(void)\n \tmyobj = PyDict_GetItemString(tp_dict, \"alignment\");\n \tif (myobj == NULL) return;\n \tPyMemberDescr_TypePtr = myobj->ob_type;\n+\tmyobj = PyDict_GetItemString(tp_dict, \"newbyteorder\");\n+\tif (myobj == NULL) return;\n+\tPyMethodDescr_TypePtr = myobj->ob_type;\n \treturn;\n }\n \n", + "added_lines": 7, + "deleted_lines": 0, + "source_code": "#include \"Python.h\"\n#include \"structmember.h\"\n#include \"numpy/arrayobject.h\"\n\nstatic PyObject *ErrorObject;\n#define Py_Try(BOOLEAN) {if (!(BOOLEAN)) goto fail;}\n#define Py_Assert(BOOLEAN,MESS) {if (!(BOOLEAN)) {\t\t\t\\\n\t PyErr_SetString(ErrorObject, (MESS));\t\t\t\\\n\t goto fail;}\t\t\t\t\t\t\t\\\n }\n\nstatic intp \nincr_slot_ (double x, double *bins, intp lbins)\n{\n intp i ;\n for ( i = 0 ; i < lbins ; i ++ )\n\tif ( x < bins [i] )\n\t return i ;\n return lbins ;\n}\n\nstatic intp \ndecr_slot_ (double x, double * bins, intp lbins)\n{\n intp i ;\n for ( i = lbins - 1 ; i >= 0; i -- )\n\tif (x < bins [i])\n\t return i + 1 ;\n return 0 ;\n}\n\nstatic int \nmonotonic_ (double * a, int lena)\n{\n int i;\n if (a [0] <= a [1]) /* possibly monotonic increasing */\n\t{\n\t for (i = 1 ; i < lena - 1; i ++)\n\t\tif (a [i] > a [i + 1]) return 0 ;\n\t return 1 ;\n\t}\n else /* possibly monotonic decreasing */\n\t{\n\t for (i = 1 ; i < lena - 1; i ++)\n\t\tif (a [i] < a [i + 1]) return 0 ;\n\t return -1 ;\n\t} \n}\n\n\n\nstatic intp\nmxx (intp *i , intp len)\n{\n /* find the index of the maximum element of an integer array */\n intp mx = 0, max = i[0] ;\n intp j ;\n for ( j = 1 ; j < len; j ++ )\n\tif ( i [j] > max )\n\t {max = i [j] ;\n\t mx = j ;}\n return mx;\n}\n\nstatic intp \nmnx (intp *i , intp len)\n{\n /* find the index of the minimum element of an integer array */\n intp mn = 0, min = i [0] ;\n intp j ;\n for ( j = 1 ; j < len; j ++ )\n\tif ( i [j] < min )\n\t {min = i [j] ;\n\t mn = j ;}\n return mn;\n}\n\n\nstatic PyObject *\narr_bincount(PyObject *self, PyObject *args, PyObject *kwds)\n{\n /* histogram accepts one or two arguments. The first is an array\n * of non-negative integers and the second, if present, is an\n * array of weights, which must be promotable to double.\n * Call these arguments list and weight. Both must be one-\n * dimensional. len (weight) == len(list)\n * If weight is not present:\n * histogram (list) [i] is the number of occurrences of i in list.\n * If weight is present:\n * histogram (list, weight) [i] is the sum of all weight [j]\n * where list [j] == i. */\n /* self is not used */\n PyArray_Descr *type;\n PyObject *list = NULL, *weight=Py_None ;\n PyObject *lst=NULL, *ans=NULL, *wts=NULL;\n intp *numbers, *ians, len , mxi, mni, ans_size;\n int i;\n double *weights , *dans;\n static char *kwlist[] = {\"list\", \"weights\", NULL};\n\n\n Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"O|O\", kwlist,\n\t\t\t\t &list, &weight));\n Py_Try(lst = PyArray_ContiguousFromAny(list, PyArray_INTP, 1, 1));\n len = PyArray_SIZE(lst);\n numbers = (intp *) PyArray_DATA(lst);\n mxi = mxx (numbers, len) ;\n mni = mnx (numbers, len) ;\n Py_Assert(numbers[mni] >= 0, \n\t \"irst argument of bincount must be non-negative\");\n ans_size = numbers [mxi] + 1 ;\n type = PyArray_DescrFromType(PyArray_INTP);\n if (weight == Py_None) {\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, type, 0));\n\tians = (intp *)(PyArray_DATA(ans));\n\tfor (i = 0 ; i < len ; i++)\n\t ians [numbers [i]] += 1 ;\n\tPy_DECREF(lst);\n }\n else {\n\t Py_Try(wts = PyArray_ContiguousFromAny(weight, \n\t\t\t\t\t\t PyArray_DOUBLE, 1, 1));\n\tweights = (double *)PyArray_DATA (wts);\n\tPy_Assert(PyArray_SIZE(wts) == len, \"bincount: length of weights \" \\\n\t\t \"does not match that of list\");\n\ttype = PyArray_DescrFromType(PyArray_DOUBLE);\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, type, 0));\n\tdans = (double *)PyArray_DATA (ans);\n\tfor (i = 0 ; i < len ; i++) {\n\t dans[numbers[i]] += weights[i];\n\t}\n\tPy_DECREF(lst);\n\tPy_DECREF(wts);\n }\n return ans;\n\n fail:\n Py_XDECREF(lst);\n Py_XDECREF(wts);\n Py_XDECREF(ans);\n return NULL;\n}\n\n\nstatic PyObject *\narr_digitize(PyObject *self, PyObject *args, PyObject *kwds)\n{\n /* digitize (x, bins) returns an array of python integers the same\n length of x. The values i returned are such that\n bins [i - 1] <= x < bins [i] if bins is monotonically increasing,\n or bins [i - 1] > x >= bins [i] if bins is monotonically decreasing.\n Beyond the bounds of bins, returns either i = 0 or i = len (bins)\n as appropriate. */\n /* self is not used */\n PyObject *ox, *obins ;\n PyObject *ax=NULL, *abins=NULL, *aret=NULL;\n double *dx, *dbins ; \n intp lbins, lx ; /* lengths */\n intp *iret;\n int m, i ;\n static char *kwlist[] = {\"x\", \"bins\", NULL};\n PyArray_Descr *type;\n\n Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"OO\", kwlist, \n\t\t\t\t &ox, &obins));\n\n type = PyArray_DescrFromType(PyArray_DOUBLE);\n Py_Try(ax=PyArray_FromAny(ox, type, 1, 1, CARRAY_FLAGS));\n Py_Try(abins = PyArray_FromAny(obins, type, 1, 1, CARRAY_FLAGS));\n \n lx = PyArray_SIZE(ax);\n dx = (double *)PyArray_DATA(ax);\n lbins = PyArray_SIZE(abins);\n dbins = (double *)PyArray_DATA(abins);\n Py_Try(aret = PyArray_SimpleNew(1, &lx, PyArray_INTP));\n iret = (intp *)PyArray_DATA(aret);\n\n Py_Assert(lx > 0 && lbins > 0, \n\t \"x and bins both must have non-zero length\");\n \n if (lbins == 1) {\n\tfor (i=0 ; i= dbins[0])\n iret[i] = 1;\n else \n iret[i] = 0;\n }\n else {\n m = monotonic_ (dbins, lbins) ;\n\tif ( m == -1 ) {\n for ( i = 0 ; i < lx ; i ++ )\n\t\tiret [i] = decr_slot_ (dx [i], dbins, lbins) ;\n\t}\n else if ( m == 1 ) {\n for ( i = 0 ; i < lx ; i ++ )\n iret [i] = incr_slot_ ((float)dx [i], dbins, lbins) ;\n }\n else Py_Assert(0, \"bins must be montonically increasing or decreasing\");\n }\n\n Py_DECREF(ax);\n Py_DECREF(abins);\n return aret;\n\n fail:\n Py_XDECREF(ax);\n Py_XDECREF(abins);\n Py_XDECREF(aret);\n return NULL;\n}\n\n\n\nstatic char arr_insert__doc__[] = \"Insert vals sequentially into equivalent 1-d positions indicated by mask.\";\n\nstatic PyObject *\narr_insert(PyObject *self, PyObject *args, PyObject *kwdict)\n{\n /* Returns input array with values inserted sequentially into places \n indicated by the mask\n */\n PyObject *mask=NULL, *vals=NULL;\n PyArrayObject *ainput=NULL, *amask=NULL, *avals=NULL, \n\t *tmp=NULL;\n int numvals, totmask, sameshape;\n char *input_data, *mptr, *vptr, *zero=NULL;\n int melsize, delsize, copied, nd;\n intp *instrides, *inshape;\n int mindx, rem_indx, indx, i, k, objarray;\n \n static char *kwlist[] = {\"input\",\"mask\",\"vals\",NULL};\n\n if (!PyArg_ParseTupleAndKeywords(args, kwdict, \"O&OO\", kwlist, \n\t\t\t\t PyArray_Converter, &ainput, \n\t\t\t\t &mask, &vals))\n goto fail;\n \n amask = (PyArrayObject *) PyArray_FROM_OF(mask, CARRAY_FLAGS);\n if (amask == NULL) goto fail;\n /* Cast an object array */\n if (amask->descr->type_num == PyArray_OBJECT) {\n\ttmp = (PyArrayObject *)PyArray_Cast(amask, PyArray_INTP);\n\tif (tmp == NULL) goto fail;\n\tPy_DECREF(amask);\n\tamask = tmp;\n }\n\n sameshape = 1;\n if (amask->nd == ainput->nd) {\n\tfor (k=0; k < amask->nd; k++) \n\t if (amask->dimensions[k] != ainput->dimensions[k])\n\t\tsameshape = 0;\n }\n else { /* Test to see if amask is 1d */\n\tif (amask->nd != 1) sameshape = 0;\n\telse if ((PyArray_SIZE(ainput)) != PyArray_SIZE(amask)) sameshape = 0;\n }\n if (!sameshape) {\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"mask array must be 1-d or same shape as input array\");\n\tgoto fail;\n }\n\n avals = (PyArrayObject *)PyArray_FromObject(vals, ainput->descr->type_num, 0, 1);\n if (avals == NULL) goto fail;\n\n numvals = PyArray_SIZE(avals);\n nd = ainput->nd;\n input_data = ainput->data;\n mptr = amask->data;\n melsize = amask->descr->elsize;\n vptr = avals->data;\n delsize = avals->descr->elsize;\n zero = PyArray_Zero(amask);\n if (zero == NULL) \n\t goto fail;\n objarray = (ainput->descr->type_num == PyArray_OBJECT);\n \n /* Handle zero-dimensional case separately */\n if (nd == 0) {\n\tif (memcmp(mptr,zero,melsize) != 0) {\n\t /* Copy value element over to input array */\n\t memcpy(input_data,vptr,delsize);\n\t if (objarray) Py_INCREF(*((PyObject **)vptr));\n\t}\n\tPy_DECREF(amask);\n\tPy_DECREF(avals);\n\tPyDataMem_FREE(zero);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n }\n\n /* Walk through mask array, when non-zero is encountered\n copy next value in the vals array to the input array.\n If we get through the value array, repeat it as necessary. \n */\n totmask = (int) PyArray_SIZE(amask);\n copied = 0;\n instrides = ainput->strides;\n inshape = ainput->dimensions;\n for (mindx = 0; mindx < totmask; mindx++) { \n\tif (memcmp(mptr,zero,melsize) != 0) { \n\t /* compute indx into input array \n\t */\n\t rem_indx = mindx;\n\t indx = 0;\n\t for(i=nd-1; i > 0; --i) {\n\t\tindx += (rem_indx % inshape[i]) * instrides[i];\n\t\trem_indx /= inshape[i];\n\t }\n\t indx += rem_indx * instrides[0];\n\t /* fprintf(stderr, \"mindx = %d, indx=%d\\n\", mindx, indx); */\n\t /* Copy value element over to input array */\n\t memcpy(input_data+indx,vptr,delsize);\n\t if (objarray) Py_INCREF(*((PyObject **)vptr));\n\t vptr += delsize;\n\t copied += 1;\n\t /* If we move past value data. Reset */\n\t if (copied >= numvals) vptr = avals->data;\n\t}\n\tmptr += melsize;\n }\n\n Py_DECREF(amask);\n Py_DECREF(avals);\n PyDataMem_FREE(zero);\n Py_DECREF(ainput);\n Py_INCREF(Py_None);\n return Py_None;\n \n fail:\n PyDataMem_FREE(zero);\n Py_XDECREF(ainput);\n Py_XDECREF(amask);\n Py_XDECREF(avals);\n return NULL;\n}\n\n\nstatic PyTypeObject *PyMemberDescr_TypePtr=NULL;\nstatic PyTypeObject *PyGetSetDescr_TypePtr=NULL;\nstatic PyTypeObject *PyMethodDescr_TypePtr=NULL;\n\n/* Can only be called if doc is currently NULL\n*/\nstatic PyObject *\narr_add_docstring(PyObject *dummy, PyObject *args)\n{\n\tPyObject *obj;\n\tPyObject *str;\n\tchar *docstr;\n\tstatic char *msg = \"already has a docstring\";\n\t\n\tif (!PyArg_ParseTuple(args, \"OO!\", &obj, &PyString_Type, &str))\n\t\treturn NULL;\n\n\tdocstr = PyString_AS_STRING(str);\n\n#define _TESTDOC1(typebase) (obj->ob_type == &Py##typebase##_Type)\n#define _TESTDOC2(typebase) (obj->ob_type == Py##typebase##_TypePtr)\n#define _ADDDOC(typebase, doc, name) {\t\t\t\t\t\\\n\t\tPy##typebase##Object *new = (Py##typebase##Object *)obj; \\\n\t\tif (!(doc)) {\t\t\t\t\t\t\\\n\t\t\tdoc = docstr;\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tPyErr_Format(PyExc_RuntimeError,\t\t\\\n\t\t\t\t \"%s method %s\",name, msg);\t\t\\\n\t\t\treturn NULL;\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\n\t\n\tif _TESTDOC1(CFunction) \n\t\t_ADDDOC(CFunction, new->m_ml->ml_doc, new->m_ml->ml_name)\n\telse if _TESTDOC1(Type) \n\t\t_ADDDOC(Type, new->tp_doc, new->tp_name)\n else if _TESTDOC2(MemberDescr) \n\t\t_ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name)\n else if _TESTDOC2(GetSetDescr) \n\t\t_ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name)\n\telse if _TESTDOC2(MethodDescr)\n _ADDDOC(MethodDescr, new->d_method->ml_doc, \n\t\t\tnew->d_method->ml_name)\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot set a docstring for that object\");\n\t\treturn NULL;\n\t}\n\n#undef _TESTDOC1\n#undef _TESTDOC2\n#undef _ADDDOC\n\t\n\tPy_INCREF(str);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic struct PyMethodDef methods[] = {\n {\"_insert\",\t (PyCFunction)arr_insert, METH_VARARGS | METH_KEYWORDS, \n arr_insert__doc__},\n {\"bincount\", (PyCFunction)arr_bincount, \n METH_VARARGS | METH_KEYWORDS, NULL},\n {\"digitize\", (PyCFunction)arr_digitize, METH_VARARGS | METH_KEYWORDS,\n NULL},\n {\"add_docstring\", (PyCFunction)arr_add_docstring, METH_VARARGS,\n NULL},\n {NULL, NULL} /* sentinel */\n};\n\nstatic void\ndefine_types(void) \n{\n\tPyObject *tp_dict;\n\tPyObject *myobj;\n\n\ttp_dict = PyArrayDescr_Type.tp_dict;\n\t/* Get \"subdescr\" */\n\tmyobj = PyDict_GetItemString(tp_dict, \"fields\");\n\tif (myobj == NULL) return;\n\tPyGetSetDescr_TypePtr = myobj->ob_type;\n\tmyobj = PyDict_GetItemString(tp_dict, \"alignment\");\n\tif (myobj == NULL) return;\n\tPyMemberDescr_TypePtr = myobj->ob_type;\n\tmyobj = PyDict_GetItemString(tp_dict, \"newbyteorder\");\n\tif (myobj == NULL) return;\n\tPyMethodDescr_TypePtr = myobj->ob_type;\n\treturn;\n}\n\n/* Initialization function for the module (*must* be called initArray) */\n\nDL_EXPORT(void) init_compiled_base(void) {\n PyObject *m, *d, *s;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"_compiled_base\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"0.5\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n ErrorObject = PyString_FromString(\"numpy.lib._compiled_base.error\");\n PyDict_SetItemString(d, \"error\", ErrorObject);\n Py_DECREF(ErrorObject);\n\n\n /* define PyGetSetDescr_Type and PyMemberDescr_Type */\n define_types();\n \n /* Check for errors */\n if (PyErr_Occurred())\n\t Py_FatalError(\"can't initialize module _compiled_base\");\n}\n", + "source_code_before": "#include \"Python.h\"\n#include \"structmember.h\"\n#include \"numpy/arrayobject.h\"\n\nstatic PyObject *ErrorObject;\n#define Py_Try(BOOLEAN) {if (!(BOOLEAN)) goto fail;}\n#define Py_Assert(BOOLEAN,MESS) {if (!(BOOLEAN)) {\t\t\t\\\n\t PyErr_SetString(ErrorObject, (MESS));\t\t\t\\\n\t goto fail;}\t\t\t\t\t\t\t\\\n }\n\nstatic intp \nincr_slot_ (double x, double *bins, intp lbins)\n{\n intp i ;\n for ( i = 0 ; i < lbins ; i ++ )\n\tif ( x < bins [i] )\n\t return i ;\n return lbins ;\n}\n\nstatic intp \ndecr_slot_ (double x, double * bins, intp lbins)\n{\n intp i ;\n for ( i = lbins - 1 ; i >= 0; i -- )\n\tif (x < bins [i])\n\t return i + 1 ;\n return 0 ;\n}\n\nstatic int \nmonotonic_ (double * a, int lena)\n{\n int i;\n if (a [0] <= a [1]) /* possibly monotonic increasing */\n\t{\n\t for (i = 1 ; i < lena - 1; i ++)\n\t\tif (a [i] > a [i + 1]) return 0 ;\n\t return 1 ;\n\t}\n else /* possibly monotonic decreasing */\n\t{\n\t for (i = 1 ; i < lena - 1; i ++)\n\t\tif (a [i] < a [i + 1]) return 0 ;\n\t return -1 ;\n\t} \n}\n\n\n\nstatic intp\nmxx (intp *i , intp len)\n{\n /* find the index of the maximum element of an integer array */\n intp mx = 0, max = i[0] ;\n intp j ;\n for ( j = 1 ; j < len; j ++ )\n\tif ( i [j] > max )\n\t {max = i [j] ;\n\t mx = j ;}\n return mx;\n}\n\nstatic intp \nmnx (intp *i , intp len)\n{\n /* find the index of the minimum element of an integer array */\n intp mn = 0, min = i [0] ;\n intp j ;\n for ( j = 1 ; j < len; j ++ )\n\tif ( i [j] < min )\n\t {min = i [j] ;\n\t mn = j ;}\n return mn;\n}\n\n\nstatic PyObject *\narr_bincount(PyObject *self, PyObject *args, PyObject *kwds)\n{\n /* histogram accepts one or two arguments. The first is an array\n * of non-negative integers and the second, if present, is an\n * array of weights, which must be promotable to double.\n * Call these arguments list and weight. Both must be one-\n * dimensional. len (weight) == len(list)\n * If weight is not present:\n * histogram (list) [i] is the number of occurrences of i in list.\n * If weight is present:\n * histogram (list, weight) [i] is the sum of all weight [j]\n * where list [j] == i. */\n /* self is not used */\n PyArray_Descr *type;\n PyObject *list = NULL, *weight=Py_None ;\n PyObject *lst=NULL, *ans=NULL, *wts=NULL;\n intp *numbers, *ians, len , mxi, mni, ans_size;\n int i;\n double *weights , *dans;\n static char *kwlist[] = {\"list\", \"weights\", NULL};\n\n\n Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"O|O\", kwlist,\n\t\t\t\t &list, &weight));\n Py_Try(lst = PyArray_ContiguousFromAny(list, PyArray_INTP, 1, 1));\n len = PyArray_SIZE(lst);\n numbers = (intp *) PyArray_DATA(lst);\n mxi = mxx (numbers, len) ;\n mni = mnx (numbers, len) ;\n Py_Assert(numbers[mni] >= 0, \n\t \"irst argument of bincount must be non-negative\");\n ans_size = numbers [mxi] + 1 ;\n type = PyArray_DescrFromType(PyArray_INTP);\n if (weight == Py_None) {\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, type, 0));\n\tians = (intp *)(PyArray_DATA(ans));\n\tfor (i = 0 ; i < len ; i++)\n\t ians [numbers [i]] += 1 ;\n\tPy_DECREF(lst);\n }\n else {\n\t Py_Try(wts = PyArray_ContiguousFromAny(weight, \n\t\t\t\t\t\t PyArray_DOUBLE, 1, 1));\n\tweights = (double *)PyArray_DATA (wts);\n\tPy_Assert(PyArray_SIZE(wts) == len, \"bincount: length of weights \" \\\n\t\t \"does not match that of list\");\n\ttype = PyArray_DescrFromType(PyArray_DOUBLE);\n\tPy_Try(ans = PyArray_Zeros(1, &ans_size, type, 0));\n\tdans = (double *)PyArray_DATA (ans);\n\tfor (i = 0 ; i < len ; i++) {\n\t dans[numbers[i]] += weights[i];\n\t}\n\tPy_DECREF(lst);\n\tPy_DECREF(wts);\n }\n return ans;\n\n fail:\n Py_XDECREF(lst);\n Py_XDECREF(wts);\n Py_XDECREF(ans);\n return NULL;\n}\n\n\nstatic PyObject *\narr_digitize(PyObject *self, PyObject *args, PyObject *kwds)\n{\n /* digitize (x, bins) returns an array of python integers the same\n length of x. The values i returned are such that\n bins [i - 1] <= x < bins [i] if bins is monotonically increasing,\n or bins [i - 1] > x >= bins [i] if bins is monotonically decreasing.\n Beyond the bounds of bins, returns either i = 0 or i = len (bins)\n as appropriate. */\n /* self is not used */\n PyObject *ox, *obins ;\n PyObject *ax=NULL, *abins=NULL, *aret=NULL;\n double *dx, *dbins ; \n intp lbins, lx ; /* lengths */\n intp *iret;\n int m, i ;\n static char *kwlist[] = {\"x\", \"bins\", NULL};\n PyArray_Descr *type;\n\n Py_Try(PyArg_ParseTupleAndKeywords(args, kwds, \"OO\", kwlist, \n\t\t\t\t &ox, &obins));\n\n type = PyArray_DescrFromType(PyArray_DOUBLE);\n Py_Try(ax=PyArray_FromAny(ox, type, 1, 1, CARRAY_FLAGS));\n Py_Try(abins = PyArray_FromAny(obins, type, 1, 1, CARRAY_FLAGS));\n \n lx = PyArray_SIZE(ax);\n dx = (double *)PyArray_DATA(ax);\n lbins = PyArray_SIZE(abins);\n dbins = (double *)PyArray_DATA(abins);\n Py_Try(aret = PyArray_SimpleNew(1, &lx, PyArray_INTP));\n iret = (intp *)PyArray_DATA(aret);\n\n Py_Assert(lx > 0 && lbins > 0, \n\t \"x and bins both must have non-zero length\");\n \n if (lbins == 1) {\n\tfor (i=0 ; i= dbins[0])\n iret[i] = 1;\n else \n iret[i] = 0;\n }\n else {\n m = monotonic_ (dbins, lbins) ;\n\tif ( m == -1 ) {\n for ( i = 0 ; i < lx ; i ++ )\n\t\tiret [i] = decr_slot_ (dx [i], dbins, lbins) ;\n\t}\n else if ( m == 1 ) {\n for ( i = 0 ; i < lx ; i ++ )\n iret [i] = incr_slot_ ((float)dx [i], dbins, lbins) ;\n }\n else Py_Assert(0, \"bins must be montonically increasing or decreasing\");\n }\n\n Py_DECREF(ax);\n Py_DECREF(abins);\n return aret;\n\n fail:\n Py_XDECREF(ax);\n Py_XDECREF(abins);\n Py_XDECREF(aret);\n return NULL;\n}\n\n\n\nstatic char arr_insert__doc__[] = \"Insert vals sequentially into equivalent 1-d positions indicated by mask.\";\n\nstatic PyObject *\narr_insert(PyObject *self, PyObject *args, PyObject *kwdict)\n{\n /* Returns input array with values inserted sequentially into places \n indicated by the mask\n */\n PyObject *mask=NULL, *vals=NULL;\n PyArrayObject *ainput=NULL, *amask=NULL, *avals=NULL, \n\t *tmp=NULL;\n int numvals, totmask, sameshape;\n char *input_data, *mptr, *vptr, *zero=NULL;\n int melsize, delsize, copied, nd;\n intp *instrides, *inshape;\n int mindx, rem_indx, indx, i, k, objarray;\n \n static char *kwlist[] = {\"input\",\"mask\",\"vals\",NULL};\n\n if (!PyArg_ParseTupleAndKeywords(args, kwdict, \"O&OO\", kwlist, \n\t\t\t\t PyArray_Converter, &ainput, \n\t\t\t\t &mask, &vals))\n goto fail;\n \n amask = (PyArrayObject *) PyArray_FROM_OF(mask, CARRAY_FLAGS);\n if (amask == NULL) goto fail;\n /* Cast an object array */\n if (amask->descr->type_num == PyArray_OBJECT) {\n\ttmp = (PyArrayObject *)PyArray_Cast(amask, PyArray_INTP);\n\tif (tmp == NULL) goto fail;\n\tPy_DECREF(amask);\n\tamask = tmp;\n }\n\n sameshape = 1;\n if (amask->nd == ainput->nd) {\n\tfor (k=0; k < amask->nd; k++) \n\t if (amask->dimensions[k] != ainput->dimensions[k])\n\t\tsameshape = 0;\n }\n else { /* Test to see if amask is 1d */\n\tif (amask->nd != 1) sameshape = 0;\n\telse if ((PyArray_SIZE(ainput)) != PyArray_SIZE(amask)) sameshape = 0;\n }\n if (!sameshape) {\n\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\"mask array must be 1-d or same shape as input array\");\n\tgoto fail;\n }\n\n avals = (PyArrayObject *)PyArray_FromObject(vals, ainput->descr->type_num, 0, 1);\n if (avals == NULL) goto fail;\n\n numvals = PyArray_SIZE(avals);\n nd = ainput->nd;\n input_data = ainput->data;\n mptr = amask->data;\n melsize = amask->descr->elsize;\n vptr = avals->data;\n delsize = avals->descr->elsize;\n zero = PyArray_Zero(amask);\n if (zero == NULL) \n\t goto fail;\n objarray = (ainput->descr->type_num == PyArray_OBJECT);\n \n /* Handle zero-dimensional case separately */\n if (nd == 0) {\n\tif (memcmp(mptr,zero,melsize) != 0) {\n\t /* Copy value element over to input array */\n\t memcpy(input_data,vptr,delsize);\n\t if (objarray) Py_INCREF(*((PyObject **)vptr));\n\t}\n\tPy_DECREF(amask);\n\tPy_DECREF(avals);\n\tPyDataMem_FREE(zero);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n }\n\n /* Walk through mask array, when non-zero is encountered\n copy next value in the vals array to the input array.\n If we get through the value array, repeat it as necessary. \n */\n totmask = (int) PyArray_SIZE(amask);\n copied = 0;\n instrides = ainput->strides;\n inshape = ainput->dimensions;\n for (mindx = 0; mindx < totmask; mindx++) { \n\tif (memcmp(mptr,zero,melsize) != 0) { \n\t /* compute indx into input array \n\t */\n\t rem_indx = mindx;\n\t indx = 0;\n\t for(i=nd-1; i > 0; --i) {\n\t\tindx += (rem_indx % inshape[i]) * instrides[i];\n\t\trem_indx /= inshape[i];\n\t }\n\t indx += rem_indx * instrides[0];\n\t /* fprintf(stderr, \"mindx = %d, indx=%d\\n\", mindx, indx); */\n\t /* Copy value element over to input array */\n\t memcpy(input_data+indx,vptr,delsize);\n\t if (objarray) Py_INCREF(*((PyObject **)vptr));\n\t vptr += delsize;\n\t copied += 1;\n\t /* If we move past value data. Reset */\n\t if (copied >= numvals) vptr = avals->data;\n\t}\n\tmptr += melsize;\n }\n\n Py_DECREF(amask);\n Py_DECREF(avals);\n PyDataMem_FREE(zero);\n Py_DECREF(ainput);\n Py_INCREF(Py_None);\n return Py_None;\n \n fail:\n PyDataMem_FREE(zero);\n Py_XDECREF(ainput);\n Py_XDECREF(amask);\n Py_XDECREF(avals);\n return NULL;\n}\n\n\nstatic PyTypeObject *PyMemberDescr_TypePtr=NULL;\nstatic PyTypeObject *PyGetSetDescr_TypePtr=NULL;\n\n/* Can only be called if doc is currently NULL\n*/\nstatic PyObject *\narr_add_docstring(PyObject *dummy, PyObject *args)\n{\n\tPyObject *obj;\n\tPyObject *str;\n\tchar *docstr;\n\tstatic char *msg = \"already has a docstring\";\n\t\n\tif (!PyArg_ParseTuple(args, \"OO!\", &obj, &PyString_Type, &str))\n\t\treturn NULL;\n\n\tdocstr = PyString_AS_STRING(str);\n\n#define _TESTDOC1(typebase) (obj->ob_type == &Py##typebase##_Type)\n#define _TESTDOC2(typebase) (obj->ob_type == Py##typebase##_TypePtr)\n#define _ADDDOC(typebase, doc, name) {\t\t\t\t\t\\\n\t\tPy##typebase##Object *new = (Py##typebase##Object *)obj; \\\n\t\tif (!(doc)) {\t\t\t\t\t\t\\\n\t\t\tdoc = docstr;\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t\telse {\t\t\t\t\t\t\t\\\n\t\t\tPyErr_Format(PyExc_RuntimeError,\t\t\\\n\t\t\t\t \"%s method %s\",name, msg);\t\t\\\n\t\t\treturn NULL;\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t}\n\t\n\tif _TESTDOC1(CFunction) \n\t\t_ADDDOC(CFunction, new->m_ml->ml_doc, new->m_ml->ml_name)\n\telse if _TESTDOC1(Type) \n\t\t_ADDDOC(Type, new->tp_doc, new->tp_name)\n else if _TESTDOC2(MemberDescr) \n\t\t_ADDDOC(MemberDescr, new->d_member->doc, new->d_member->name)\n else if _TESTDOC2(GetSetDescr) \n\t\t_ADDDOC(GetSetDescr, new->d_getset->doc, new->d_getset->name)\n\telse {\n\t\tPyErr_SetString(PyExc_TypeError, \n\t\t\t\t\"Cannot set a docstring for that object\");\n\t\treturn NULL;\n\t}\n\n#undef _TESTDOC1\n#undef _TESTDOC2\n#undef _ADDDOC\n\t\n\tPy_INCREF(str);\n\tPy_INCREF(Py_None);\n\treturn Py_None;\n}\n\nstatic struct PyMethodDef methods[] = {\n {\"_insert\",\t (PyCFunction)arr_insert, METH_VARARGS | METH_KEYWORDS, \n arr_insert__doc__},\n {\"bincount\", (PyCFunction)arr_bincount, \n METH_VARARGS | METH_KEYWORDS, NULL},\n {\"digitize\", (PyCFunction)arr_digitize, METH_VARARGS | METH_KEYWORDS,\n NULL},\n {\"add_docstring\", (PyCFunction)arr_add_docstring, METH_VARARGS,\n NULL},\n {NULL, NULL} /* sentinel */\n};\n\nstatic void\ndefine_types(void) \n{\n\tPyObject *tp_dict;\n\tPyObject *myobj;\n\n\ttp_dict = PyArrayDescr_Type.tp_dict;\n\t/* Get \"subdescr\" */\n\tmyobj = PyDict_GetItemString(tp_dict, \"fields\");\n\tif (myobj == NULL) return;\n\tPyGetSetDescr_TypePtr = myobj->ob_type;\n\tmyobj = PyDict_GetItemString(tp_dict, \"alignment\");\n\tif (myobj == NULL) return;\n\tPyMemberDescr_TypePtr = myobj->ob_type;\n\treturn;\n}\n\n/* Initialization function for the module (*must* be called initArray) */\n\nDL_EXPORT(void) init_compiled_base(void) {\n PyObject *m, *d, *s;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"_compiled_base\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"0.5\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n ErrorObject = PyString_FromString(\"numpy.lib._compiled_base.error\");\n PyDict_SetItemString(d, \"error\", ErrorObject);\n Py_DECREF(ErrorObject);\n\n\n /* define PyGetSetDescr_Type and PyMemberDescr_Type */\n define_types();\n \n /* Check for errors */\n if (PyErr_Occurred())\n\t Py_FatalError(\"can't initialize module _compiled_base\");\n}\n", + "methods": [ + { + "name": "incr_slot_", + "long_name": "incr_slot_( double x , double * bins , intp lbins)", + "filename": "_compiled_base.c", + "nloc": 8, + "complexity": 3, + "token_count": 45, + "parameters": [ + "x", + "bins", + "lbins" + ], + "start_line": 13, + "end_line": 20, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "decr_slot_", + "long_name": "decr_slot_( double x , double * bins , intp lbins)", + "filename": "_compiled_base.c", + "nloc": 8, + "complexity": 3, + "token_count": 49, + "parameters": [ + "x", + "bins", + "lbins" + ], + "start_line": 23, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "monotonic_", + "long_name": "monotonic_( double * a , int lena)", + "filename": "_compiled_base.c", + "nloc": 16, + "complexity": 6, + "token_count": 102, + "parameters": [ + "a", + "lena" + ], + "start_line": 33, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "mxx", + "long_name": "mxx( intp * i , intp len)", + "filename": "_compiled_base.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "i", + "len" + ], + "start_line": 53, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "mnx", + "long_name": "mnx( intp * i , intp len)", + "filename": "_compiled_base.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "i", + "len" + ], + "start_line": 66, + "end_line": 76, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arr_bincount", + "long_name": "arr_bincount( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "_compiled_base.c", + "nloc": 49, + "complexity": 4, + "token_count": 393, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 80, + "end_line": 142, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "arr_digitize", + "long_name": "arr_digitize( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "_compiled_base.c", + "nloc": 51, + "complexity": 9, + "token_count": 399, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 146, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + }, + { + "name": "arr_insert", + "long_name": "arr_insert( PyObject * self , PyObject * args , PyObject * kwdict)", + "filename": "_compiled_base.c", + "nloc": 96, + "complexity": 21, + "token_count": 705, + "parameters": [ + "self", + "args", + "kwdict" + ], + "start_line": 217, + "end_line": 337, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 121, + "top_nesting_level": 0 + }, + { + "name": "arr_add_docstring", + "long_name": "arr_add_docstring( PyObject * dummy , PyObject * args)", + "filename": "_compiled_base.c", + "nloc": 29, + "complexity": 7, + "token_count": 191, + "parameters": [ + "dummy", + "args" + ], + "start_line": 347, + "end_line": 397, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "define_types", + "long_name": "define_types()", + "filename": "_compiled_base.c", + "nloc": 16, + "complexity": 4, + "token_count": 91, + "parameters": [], + "start_line": 412, + "end_line": 429, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "init_compiled_base", + "long_name": "init_compiled_base()", + "filename": "_compiled_base.c", + "nloc": 15, + "complexity": 2, + "token_count": 92, + "parameters": [], + "start_line": 433, + "end_line": 460, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "incr_slot_", + "long_name": "incr_slot_( double x , double * bins , intp lbins)", + "filename": "_compiled_base.c", + "nloc": 8, + "complexity": 3, + "token_count": 45, + "parameters": [ + "x", + "bins", + "lbins" + ], + "start_line": 13, + "end_line": 20, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "decr_slot_", + "long_name": "decr_slot_( double x , double * bins , intp lbins)", + "filename": "_compiled_base.c", + "nloc": 8, + "complexity": 3, + "token_count": 49, + "parameters": [ + "x", + "bins", + "lbins" + ], + "start_line": 23, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "monotonic_", + "long_name": "monotonic_( double * a , int lena)", + "filename": "_compiled_base.c", + "nloc": 16, + "complexity": 6, + "token_count": 102, + "parameters": [ + "a", + "lena" + ], + "start_line": 33, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "mxx", + "long_name": "mxx( intp * i , intp len)", + "filename": "_compiled_base.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "i", + "len" + ], + "start_line": 53, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "mnx", + "long_name": "mnx( intp * i , intp len)", + "filename": "_compiled_base.c", + "nloc": 10, + "complexity": 3, + "token_count": 64, + "parameters": [ + "i", + "len" + ], + "start_line": 66, + "end_line": 76, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "arr_bincount", + "long_name": "arr_bincount( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "_compiled_base.c", + "nloc": 49, + "complexity": 4, + "token_count": 393, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 80, + "end_line": 142, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 63, + "top_nesting_level": 0 + }, + { + "name": "arr_digitize", + "long_name": "arr_digitize( PyObject * self , PyObject * args , PyObject * kwds)", + "filename": "_compiled_base.c", + "nloc": 51, + "complexity": 9, + "token_count": 399, + "parameters": [ + "self", + "args", + "kwds" + ], + "start_line": 146, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + }, + { + "name": "arr_insert", + "long_name": "arr_insert( PyObject * self , PyObject * args , PyObject * kwdict)", + "filename": "_compiled_base.c", + "nloc": 96, + "complexity": 21, + "token_count": 705, + "parameters": [ + "self", + "args", + "kwdict" + ], + "start_line": 217, + "end_line": 337, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 121, + "top_nesting_level": 0 + }, + { + "name": "arr_add_docstring", + "long_name": "arr_add_docstring( PyObject * dummy , PyObject * args)", + "filename": "_compiled_base.c", + "nloc": 26, + "complexity": 6, + "token_count": 169, + "parameters": [ + "dummy", + "args" + ], + "start_line": 346, + "end_line": 393, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 48, + "top_nesting_level": 0 + }, + { + "name": "define_types", + "long_name": "define_types()", + "filename": "_compiled_base.c", + "nloc": 13, + "complexity": 3, + "token_count": 68, + "parameters": [], + "start_line": 408, + "end_line": 422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "init_compiled_base", + "long_name": "init_compiled_base()", + "filename": "_compiled_base.c", + "nloc": 15, + "complexity": 2, + "token_count": 92, + "parameters": [], + "start_line": 426, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "arr_add_docstring", + "long_name": "arr_add_docstring( PyObject * dummy , PyObject * args)", + "filename": "_compiled_base.c", + "nloc": 29, + "complexity": 7, + "token_count": 191, + "parameters": [ + "dummy", + "args" + ], + "start_line": 347, + "end_line": 397, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 51, + "top_nesting_level": 0 + }, + { + "name": "define_types", + "long_name": "define_types()", + "filename": "_compiled_base.c", + "nloc": 16, + "complexity": 4, + "token_count": 91, + "parameters": [], + "start_line": 412, + "end_line": 429, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + } + ], + "nloc": 337, + "complexity": 65, + "token_count": 2337, + "diff_parsed": { + "added": [ + "static PyTypeObject *PyMethodDescr_TypePtr=NULL;", + "\telse if _TESTDOC2(MethodDescr)", + " _ADDDOC(MethodDescr, new->d_method->ml_doc,", + "\t\t\tnew->d_method->ml_name)", + "\tmyobj = PyDict_GetItemString(tp_dict, \"newbyteorder\");", + "\tif (myobj == NULL) return;", + "\tPyMethodDescr_TypePtr = myobj->ob_type;" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "cec9a2ee40ef84dab429e71825ea9c4c9765aa40", + "msg": "Cleaning up __all__ list and numpy namespace.", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2006-01-05T10:40:20+00:00", + "author_timezone": 0, + "committer_date": "2006-01-05T10:40:20+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "8b1e2f929fdfb79e0a446a1fb7bec33a799d492b" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpyf7vr7d8/repo_copy", + "deletions": 10, + "insertions": 35, + "lines": 45, + "files": 7, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "numpy/__init__.py", + "new_path": "numpy/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -16,8 +16,9 @@\n ---------------------\n \"\"\"\n \n-import os, sys\n-NUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n+import os as _os\n+import sys as _sys\n+NUMPY_IMPORT_VERBOSE = int(_os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n \n try:\n from __config__ import show as show_config\n@@ -25,12 +26,13 @@\n show_config = None\n \n try:\n- import pkg_resources # activate namespace packages (manipulates __path__)\n+ import pkg_resources as _pk # activate namespace packages (manipulates __path__)\n+ del _pk\n except ImportError:\n pass\n \n if show_config is None:\n- print >> sys.stderr, 'Running from numpy source directory.'\n+ print >> _sys.stderr, 'Running from numpy source directory.'\n else:\n from version import version as __version__\n from testing import ScipyTest\n@@ -38,6 +40,11 @@\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n+\n+ __all__ = ['ScipyTest','fft','ifft','rand','randn']\n+ __all__ += core.__all__\n+ __all__ += lib.__all__\n+\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n \n test = ScipyTest('numpy').test\n@@ -45,3 +52,5 @@\n import add_newdocs\n \n # TODO: Fix __doc__\n+\n+del _os, _sys\n", + "added_lines": 13, + "deleted_lines": 4, + "source_code": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os as _os\nimport sys as _sys\nNUMPY_IMPORT_VERBOSE = int(_os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __config__ import show as show_config\nexcept ImportError:\n show_config = None\n\ntry:\n import pkg_resources as _pk # activate namespace packages (manipulates __path__)\n del _pk\nexcept ImportError:\n pass\n\nif show_config is None:\n print >> _sys.stderr, 'Running from numpy source directory.'\nelse:\n from version import version as __version__\n from testing import ScipyTest\n from core import *\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n\n __all__ = ['ScipyTest','fft','ifft','rand','randn']\n __all__ += core.__all__\n __all__ += lib.__all__\n\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n\n test = ScipyTest('numpy').test\n\n import add_newdocs\n\n # TODO: Fix __doc__\n\ndel _os, _sys\n", + "source_code_before": "\"\"\"\\\nNumPy\n==========\n\nYou can support the development of NumPy and SciPy by purchasing\ndocumentation at\n\n http://www.trelgol.com\n\nIt is being distributed for a fee for a limited time to try and raise\nmoney for development.\n\nDocumentation is also available in the docstrings.\n\nAvailable subpackages\n---------------------\n\"\"\"\n\nimport os, sys\nNUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))\n\ntry:\n from __config__ import show as show_config\nexcept ImportError:\n show_config = None\n\ntry:\n import pkg_resources # activate namespace packages (manipulates __path__)\nexcept ImportError:\n pass\n\nif show_config is None:\n print >> sys.stderr, 'Running from numpy source directory.'\nelse:\n from version import version as __version__\n from testing import ScipyTest\n from core import *\n from lib import *\n from dft import fft, ifft\n from random import rand, randn\n __all__ = filter(lambda s:not s.startswith('_'),dir())\n\n test = ScipyTest('numpy').test\n\n import add_newdocs\n\n # TODO: Fix __doc__\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 45, + "complexity": 0, + "token_count": 151, + "diff_parsed": { + "added": [ + "import os as _os", + "import sys as _sys", + "NUMPY_IMPORT_VERBOSE = int(_os.environ.get('NUMPY_IMPORT_VERBOSE','0'))", + " import pkg_resources as _pk # activate namespace packages (manipulates __path__)", + " del _pk", + " print >> _sys.stderr, 'Running from numpy source directory.'", + "", + " __all__ = ['ScipyTest','fft','ifft','rand','randn']", + " __all__ += core.__all__", + " __all__ += lib.__all__", + "", + "", + "del _os, _sys" + ], + "deleted": [ + "import os, sys", + "NUMPY_IMPORT_VERBOSE = int(os.environ.get('NUMPY_IMPORT_VERBOSE','0'))", + " import pkg_resources # activate namespace packages (manipulates __path__)", + " print >> sys.stderr, 'Running from numpy source directory.'" + ] + } + }, + { + "old_path": "numpy/core/__init__.py", + "new_path": "numpy/core/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -17,7 +17,11 @@\n from memmap import *\n del nt\n \n-__all__ = filter(lambda s:not s.startswith('_'),dir())\n+__all__ = ['char','rec','memmap']\n+__all__ += numeric.__all__\n+__all__ += oldnumeric.__all__\n+__all__ += defmatrix.__all__\n+__all__ += records.__all__\n \n from numpy.testing import ScipyTest \n test = ScipyTest().test\n", + "added_lines": 5, + "deleted_lines": 1, + "source_code": "\nfrom info import __doc__\nfrom numpy.version import version as __version__\n\nimport multiarray\nimport umath\nimport numerictypes as nt\nmultiarray.set_typeDict(nt.typeDict)\nimport _sort\nfrom numeric import *\nfrom oldnumeric import *\nfrom defmatrix import *\nimport ma\nimport chararray as char\nimport records as rec\nfrom records import *\nfrom memmap import *\ndel nt\n\n__all__ = ['char','rec','memmap']\n__all__ += numeric.__all__\n__all__ += oldnumeric.__all__\n__all__ += defmatrix.__all__\n__all__ += records.__all__\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "source_code_before": "\nfrom info import __doc__\nfrom numpy.version import version as __version__\n\nimport multiarray\nimport umath\nimport numerictypes as nt\nmultiarray.set_typeDict(nt.typeDict)\nimport _sort\nfrom numeric import *\nfrom oldnumeric import *\nfrom defmatrix import *\nimport ma\nimport chararray as char\nimport records as rec\nfrom records import *\nfrom memmap import *\ndel nt\n\n__all__ = filter(lambda s:not s.startswith('_'),dir())\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 23, + "complexity": 0, + "token_count": 104, + "diff_parsed": { + "added": [ + "__all__ = ['char','rec','memmap']", + "__all__ += numeric.__all__", + "__all__ += oldnumeric.__all__", + "__all__ += defmatrix.__all__", + "__all__ += records.__all__" + ], + "deleted": [ + "__all__ = filter(lambda s:not s.startswith('_'),dir())" + ] + } + }, + { + "old_path": "numpy/f2py/f2py2e.py", + "new_path": "numpy/f2py/f2py2e.py", + "filename": "f2py2e.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -160,7 +160,7 @@\n a message should be shown.\n \n Version: %s\n-numpy_core Version: %s\n+numpy Version: %s\n Requires: Python 2.3 or higher.\n License: LGPL (see http://www.fsf.org)\n Copyright 1999 - 2005 Pearu Peterson all rights reserved.\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __version__ as numpy_version\nexcept ImportError:\n numpy_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\n\nf2py2e - Fortran to Python C/API generator. 2nd Edition.\n See __usage__ below.\n\nCopyright 1999--2005 Pearu Peterson all rights reserved,\nPearu Peterson \nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\n\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n$Date: 2005/05/06 08:31:19 $\nPearu Peterson\n\"\"\"\n__version__ = \"$Revision: 1.90 $\"[10:-1]\n\nimport __version__\nf2py_version = __version__.version\n\nimport sys,os,string,pprint,shutil,types,re\nerrmess=sys.stderr.write\n#outmess=sys.stdout.write\nshow=pprint.pprint\n\nimport crackfortran\nimport rules\nimport cb_rules\nimport common_rules\nimport auxfuncs\nimport cfuncs\nimport capi_maps\nimport func2subr\nimport f90mod_rules\n\noutmess = auxfuncs.outmess\n\ntry:\n from numpy import __version__ as numpy_version\nexcept ImportError:\n numpy_version = 'N/A'\n\n__usage__ = \"\"\"\\\nUsage:\n\n1) To construct extension module sources:\n\n f2py [] [[[only:]||[skip:]] \\\\\n ] \\\\\n [: ...]\n\n2) To compile fortran files and build extension modules:\n\n f2py -c [, , ] \n\n3) To generate signature files:\n\n f2py -h ...< same options as in (1) >\n\nDescription: This program generates a Python C/API file (module.c)\n that contains wrappers for given fortran functions so that they\n can be called from Python. With the -c option the corresponding\n extension modules are built.\n\nOptions:\n\n -h Write signatures of the fortran routines to file \n and exit. You can then edit and use it instead\n of . If ==stdout then the\n signatures are printed to stdout.\n Names of fortran routines for which Python C/API\n functions will be generated. Default is all that are found\n in .\n Paths to fortran/signature files that will be scanned for\n in order to determine their signatures.\n skip: Ignore fortran functions that follow until `:'.\n only: Use only fortran functions that follow until `:'.\n : Get back to mode.\n\n -m Name of the module; f2py generates a Python/C API\n file module.c or extension module .\n Default is 'untitled'.\n\n --[no-]lower Do [not] lower the cases in . By default,\n --lower is assumed with -h key, and --no-lower without -h key.\n\n --build-dir All f2py generated files are created in .\n Default is tempfile.mktemp().\n\n --overwrite-signature Overwrite existing signature file.\n\n --[no-]latex-doc Create (or not) module.tex.\n Default is --no-latex-doc.\n --short-latex Create 'incomplete' LaTeX document (without commands\n \\\\documentclass, \\\\tableofcontents, and \\\\begin{document},\n \\\\end{document}).\n\n --[no-]rest-doc Create (or not) module.rst.\n Default is --no-rest-doc.\n\n --debug-capi Create C/API code that reports the state of the wrappers\n during runtime. Useful for debugging.\n\n --[no-]wrap-functions Create Fortran subroutine wrappers to Fortran 77\n functions. --wrap-functions is default because it ensures\n maximum portability/compiler independence.\n\n --include_paths ::... Search include files from the given\n directories.\n\n --help-link [..] List system resources found by system_info.py. See also\n --link- switch below. [..] is optional list\n of resources names. E.g. try 'f2py --help-link lapack_opt'.\n\n --quiet Run quietly.\n --verbose Run with extra verbosity.\n -v Print f2py version ID and exit.\n\n\nnumpy.distutils options (only effective with -c):\n\n --fcompiler= Specify Fortran compiler type by vendor\n --compiler= Specify C compiler type (as defined by distutils)\n\n --help-fcompiler List available Fortran compilers and exit\n --f77exec= Specify the path to F77 compiler\n --f90exec= Specify the path to F90 compiler\n --f77flags= Specify F77 compiler flags\n --f90flags= Specify F90 compiler flags\n --opt= Specify optimization flags\n --arch= Specify architecture specific optimization flags\n --noopt Compile without optimization\n --noarch Compile without arch-dependent optimization\n --debug Compile with debugging information\n\nExtra options (only effective with -c):\n\n --link- Link extension module with as defined\n by numpy.distutils/system_info.py. E.g. to link\n with optimized LAPACK libraries (vecLib on MacOSX,\n ATLAS elsewhere), use --link-lapack_opt.\n See also --help-link switch.\n\n -L/path/to/lib/ -l\n -D -U\n -I/path/to/include/\n .o .so .a\n\n Using the following macros may be required with non-gcc Fortran\n compilers:\n -DPREPEND_FORTRAN -DNO_APPEND_FORTRAN -DUPPERCASE_FORTRAN\n -DUNDERSCORE_G77\n\n When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY\n interface is printed out at exit (platforms: Linux).\n\n When using -DF2PY_REPORT_ON_ARRAY_COPY=, a message is\n sent to stderr whenever F2PY interface makes a copy of an\n array. Integer sets the threshold for array sizes when\n a message should be shown.\n\nVersion: %s\nnumpy_core Version: %s\nRequires: Python 2.3 or higher.\nLicense: LGPL (see http://www.fsf.org)\nCopyright 1999 - 2005 Pearu Peterson all rights reserved.\nhttp://cens.ioc.ee/projects/f2py2e/\"\"\"%(f2py_version, numpy_version)\n\n\ndef scaninputline(inputline):\n files,funcs,skipfuncs,onlyfuncs,debug=[],[],[],[],[]\n f,f2,f3,f4,f5,f6,f7=1,0,0,0,0,0,0\n verbose = 1\n dolc=-1\n dolatexdoc = 0\n dorestdoc = 0\n wrapfuncs = 1\n buildpath = '.'\n include_paths = []\n signsfile,modulename=None,None\n options = {'buildpath':buildpath}\n for l in inputline:\n if l=='': pass\n elif l=='only:': f=0\n elif l=='skip:': f=-1\n elif l==':': f=1;f4=0\n elif l[:8]=='--debug-': debug.append(l[8:])\n elif l=='--lower': dolc=1\n elif l=='--build-dir': f6=1\n elif l=='--no-lower': dolc=0\n elif l=='--quiet': verbose = 0\n elif l=='--verbose': verbose += 1\n elif l=='--latex-doc': dolatexdoc=1\n elif l=='--no-latex-doc': dolatexdoc=0\n elif l=='--rest-doc': dorestdoc=1\n elif l=='--no-rest-doc': dorestdoc=0\n elif l=='--wrap-functions': wrapfuncs=1\n elif l=='--no-wrap-functions': wrapfuncs=0\n elif l=='--short-latex': options['shortlatex']=1\n elif l=='--overwrite-signature': options['h-overwrite']=1\n elif l=='-h': f2=1\n elif l=='-m': f3=1\n elif l[:2]=='-v':\n print f2py_version\n sys.exit()\n elif l=='--show-compilers':\n f5=1\n elif l[:8]=='-include':\n cfuncs.outneeds['userincludes'].append(l[9:-1])\n cfuncs.userincludes[l[9:-1]]='#include '+l[8:]\n elif l[:15]=='--include_paths':\n f7=1\n elif l[0]=='-':\n errmess('Unknown option %s\\n'%`l`)\n sys.exit()\n elif f2: f2=0;signsfile=l\n elif f3: f3=0;modulename=l\n elif f6: f6=0;buildpath=l\n elif f7: f7=0;include_paths.extend(l.split(os.pathsep))\n elif f==1:\n try:\n open(l).close()\n files.append(l)\n except IOError,detail:\n errmess('IOError: %s. Skipping file \"%s\".\\n'%(str(detail),l))\n elif f==-1: skipfuncs.append(l)\n elif f==0: onlyfuncs.append(l)\n if not f5 and not files and not modulename:\n print __usage__\n sys.exit()\n if not os.path.isdir(buildpath):\n if not verbose:\n outmess('Creating build directory %s'%(buildpath))\n os.mkdir(buildpath)\n if signsfile:\n signsfile = os.path.join(buildpath,signsfile)\n if signsfile and os.path.isfile(signsfile) and not options.has_key('h-overwrite'):\n errmess('Signature file \"%s\" exists!!! Use --overwrite-signature to overwrite.\\n'%(signsfile))\n sys.exit()\n\n options['debug']=debug\n options['verbose']=verbose\n if dolc==-1 and not signsfile: options['do-lower']=0\n else: options['do-lower']=dolc\n if modulename: options['module']=modulename\n if signsfile: options['signsfile']=signsfile\n if onlyfuncs: options['onlyfuncs']=onlyfuncs\n if skipfuncs: options['skipfuncs']=skipfuncs\n options['dolatexdoc'] = dolatexdoc\n options['dorestdoc'] = dorestdoc\n options['wrapfuncs'] = wrapfuncs\n options['buildpath']=buildpath\n options['include_paths']=include_paths\n return files,options\n\ndef callcrackfortran(files,options):\n rules.options=options\n funcs=[]\n crackfortran.debug=options['debug']\n crackfortran.verbose=options['verbose']\n if options.has_key('module'):\n crackfortran.f77modulename=options['module']\n if options.has_key('skipfuncs'):\n crackfortran.skipfuncs=options['skipfuncs']\n if options.has_key('onlyfuncs'):\n crackfortran.onlyfuncs=options['onlyfuncs']\n crackfortran.include_paths[:]=options['include_paths']\n crackfortran.dolowercase=options['do-lower']\n postlist=crackfortran.crackfortran(files)\n if options.has_key('signsfile'):\n outmess('Saving signatures to file \"%s\"\\n'%(options['signsfile']))\n pyf=crackfortran.crack2fortran(postlist)\n if options['signsfile'][-6:]=='stdout':\n sys.stdout.write(pyf)\n else:\n f=open(options['signsfile'],'w')\n f.write(pyf)\n f.close()\n return postlist\n\ndef buildmodules(list):\n cfuncs.buildcfuncs()\n outmess('Building modules...\\n')\n modules,mnames,isusedby=[],[],{}\n for i in range(len(list)):\n if string.find(list[i]['name'],'__user__')>=0:\n cb_rules.buildcallbacks(list[i])\n else:\n if list[i].has_key('use'):\n for u in list[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(list[i]['name'])\n modules.append(list[i])\n mnames.append(list[i]['name'])\n ret = {}\n for i in range(len(mnames)):\n if isusedby.has_key(mnames[i]):\n outmess('\\tSkipping module \"%s\" which is used by %s.\\n'%(mnames[i],string.join(map(lambda s:'\"%s\"'%s,isusedby[mnames[i]]),',')))\n else:\n um=[]\n if modules[i].has_key('use'):\n for u in modules[i]['use'].keys():\n if isusedby.has_key(u) and u in mnames:\n um.append(modules[mnames.index(u)])\n else:\n outmess('\\tModule \"%s\" uses nonexisting \"%s\" which will be ignored.\\n'%(mnames[i],u))\n ret[mnames[i]] = {}\n dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))\n return ret\n\ndef dict_append(d_out,d_in):\n for (k,v) in d_in.items():\n if not d_out.has_key(k):\n d_out[k] = []\n if type(v) is types.ListType:\n d_out[k] = d_out[k] + v\n else:\n d_out[k].append(v)\n\ndef run_main(comline_list):\n \"\"\"Run f2py as if string.join(comline_list,' ') is used as a command line.\n In case of using -h flag, return None.\n \"\"\"\n reload(crackfortran)\n f2pydir=os.path.dirname(os.path.abspath(cfuncs.__file__))\n fobjhsrc = os.path.join(f2pydir,'src','fortranobject.h')\n fobjcsrc = os.path.join(f2pydir,'src','fortranobject.c')\n files,options=scaninputline(comline_list)\n auxfuncs.options=options \n postlist=callcrackfortran(files,options)\n isusedby={}\n for i in range(len(postlist)):\n if postlist[i].has_key('use'):\n for u in postlist[i]['use'].keys():\n if not isusedby.has_key(u): isusedby[u]=[]\n isusedby[u].append(postlist[i]['name'])\n for i in range(len(postlist)):\n if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:\n if isusedby.has_key(postlist[i]['name']):\n #if not quiet:\n outmess('Skipping Makefile build for module \"%s\" which is used by %s\\n'%(postlist[i]['name'],string.join(map(lambda s:'\"%s\"'%s,isusedby[postlist[i]['name']]),',')))\n if options.has_key('signsfile'):\n if options['verbose']>1:\n outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')\n outmess('%s %s\\n'%(os.path.basename(sys.argv[0]),options['signsfile']))\n return\n for i in range(len(postlist)):\n if postlist[i]['block']!='python module':\n if not options.has_key('python module'):\n errmess('Tip: If your original code is Fortran 77 then you must use -m option.\\n')\n raise TypeError,'All blocks must be module blocks but got %s'%(`postlist[i]['block']`)\n auxfuncs.debugoptions=options['debug']\n f90mod_rules.options=options\n auxfuncs.wrapfuncs=options['wrapfuncs']\n\n ret=buildmodules(postlist)\n\n for mn in ret.keys():\n dict_append(ret[mn],{'csrc':fobjcsrc,'h':fobjhsrc})\n return ret\n\ndef filter_files(prefix,suffix,files,remove_prefix=None):\n \"\"\"\n Filter files by prefix and suffix.\n \"\"\"\n filtered,rest = [],[]\n match = re.compile(prefix+r'.*'+suffix+r'\\Z').match\n if remove_prefix:\n ind = len(prefix)\n else:\n ind = 0\n for file in map(string.strip,files):\n if match(file): filtered.append(file[ind:])\n else: rest.append(file)\n return filtered,rest\n\ndef get_prefix(module):\n p = os.path.dirname(os.path.dirname(module.__file__))\n return p\n\ndef run_compile():\n \"\"\"\n Do it all in one call!\n \"\"\"\n import tempfile,os,shutil\n\n i = sys.argv.index('-c')\n del sys.argv[i]\n\n remove_build_dir = 0\n try: i = sys.argv.index('--build-dir')\n except ValueError: i=None\n if i is not None:\n build_dir = sys.argv[i+1]\n del sys.argv[i+1]\n del sys.argv[i]\n else:\n remove_build_dir = 1\n build_dir = os.path.join(tempfile.mktemp())\n\n sysinfo_flags = filter(re.compile(r'[-][-]link[-]').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=sysinfo_flags:a not in flags,sys.argv)\n if sysinfo_flags:\n sysinfo_flags = [f[7:] for f in sysinfo_flags]\n\n f2py_flags = filter(re.compile(r'[-][-]((no[-]|)(wrap[-]functions|lower)|debug[-]capi|quiet)|[-]include').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=f2py_flags:a not in flags,sys.argv)\n f2py_flags2 = []\n fl = 0\n for a in sys.argv[1:]:\n if a in ['only:','skip:']:\n fl = 1\n elif a==':':\n fl = 0\n if fl or a==':':\n f2py_flags2.append(a)\n if f2py_flags2 and f2py_flags2[-1]!=':':\n f2py_flags2.append(':')\n f2py_flags.extend(f2py_flags2)\n\n sys.argv = filter(lambda a,flags=f2py_flags2:a not in flags,sys.argv)\n \n flib_flags = filter(re.compile(r'[-][-]((f(90)?compiler([-]exec|)|compiler)=|help[-]compiler)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=flib_flags:a not in flags,sys.argv)\n fc_flags = filter(re.compile(r'[-][-]((f(77|90)(flags|exec)|opt|arch)=|(debug|noopt|noarch|help[-]fcompiler))').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=fc_flags:a not in flags,sys.argv)\n\n if 1:\n del_list = []\n for s in flib_flags:\n v = '--fcompiler='\n if s[:len(v)]==v:\n from numpy.distutils import fcompiler\n allowed_keys = fcompiler.fcompiler_class.keys()\n nv = ov = s[len(v):].lower()\n if ov not in allowed_keys:\n vmap = {} # XXX\n try:\n nv = vmap[ov]\n except KeyError:\n if ov not in vmap.values():\n print 'Unknown vendor: \"%s\"' % (s[len(v):])\n nv = ov\n i = flib_flags.index(s)\n flib_flags[i] = '--fcompiler=' + nv\n continue\n for s in del_list:\n i = flib_flags.index(s)\n del flib_flags[i]\n assert len(flib_flags)<=2,`flib_flags`\n setup_flags = filter(re.compile(r'[-][-](verbose)').match,sys.argv[1:])\n sys.argv = filter(lambda a,flags=setup_flags:a not in flags,sys.argv)\n if '--quiet' in f2py_flags:\n setup_flags.append('--quiet')\n\n modulename = 'untitled'\n sources = sys.argv[1:]\n if '-m' in sys.argv:\n i = sys.argv.index('-m')\n modulename = sys.argv[i+1]\n del sys.argv[i+1],sys.argv[i]\n sources = sys.argv[1:]\n else:\n from numpy.distutils.command.build_src import get_f2py_modulename\n pyf_files,sources = filter_files('','[.]pyf([.]src|)',sources)\n sources = pyf_files + sources\n for f in pyf_files:\n modulename = get_f2py_modulename(f)\n if modulename:\n break\n\n extra_objects, sources = filter_files('','[.](o|a|so)',sources)\n include_dirs, sources = filter_files('-I','',sources,remove_prefix=1)\n library_dirs, sources = filter_files('-L','',sources,remove_prefix=1)\n libraries, sources = filter_files('-l','',sources,remove_prefix=1)\n undef_macros, sources = filter_files('-U','',sources,remove_prefix=1)\n define_macros, sources = filter_files('-D','',sources,remove_prefix=1)\n using_numarray = 0\n using_numeric = 0\n for i in range(len(define_macros)):\n name_value = string.split(define_macros[i],'=',1)\n if len(name_value)==1:\n name_value.append(None)\n if len(name_value)==2:\n define_macros[i] = tuple(name_value)\n else:\n print 'Invalid use of -D:',name_value\n\n from numpy.distutils.system_info import get_info\n\n num_include_dir = None\n num_info = {}\n #import numpy\n #n = 'numpy'\n #p = get_prefix(numpy)\n #from numpy.distutils.misc_util import get_numpy_include_dirs\n #num_info = {'include_dirs': get_numpy_include_dirs()}\n\n if num_info:\n include_dirs.extend(num_info.get('include_dirs',[]))\n\n from numpy.distutils.core import setup,Extension\n ext_args = {'name':modulename,'sources':sources,\n 'include_dirs': include_dirs,\n 'library_dirs': library_dirs,\n 'libraries': libraries,\n 'define_macros': define_macros,\n 'undef_macros': undef_macros,\n 'extra_objects': extra_objects,\n 'f2py_options': f2py_flags,\n }\n\n if sysinfo_flags:\n from numpy.distutils.misc_util import dict_append\n for n in sysinfo_flags:\n i = get_info(n)\n if not i:\n outmess('No %s resources found in system'\\\n ' (try `f2py --help-link`)\\n' % (`n`))\n dict_append(ext_args,**i)\n\n ext = Extension(**ext_args)\n sys.argv = [sys.argv[0]] + setup_flags\n sys.argv.extend(['build',\n '--build-temp',build_dir,\n '--build-base',build_dir,\n '--build-platlib','.'])\n if fc_flags:\n sys.argv.extend(['config_fc']+fc_flags)\n if flib_flags:\n sys.argv.extend(['build_ext']+flib_flags)\n\n setup(ext_modules = [ext])\n\n if remove_build_dir and os.path.exists(build_dir):\n outmess('Removing build directory %s\\n'%(build_dir))\n shutil.rmtree(build_dir)\n\ndef main():\n if '--help-link' in sys.argv[1:]:\n sys.argv.remove('--help-link')\n from numpy.distutils.system_info import show_all\n show_all()\n return\n if '-c' in sys.argv[1:]:\n run_compile()\n else:\n run_main(sys.argv[1:])\n\n#if __name__ == \"__main__\":\n# main()\n\n\n# EOF\n\n", + "methods": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "scaninputline", + "long_name": "scaninputline( inputline )", + "filename": "f2py2e.py", + "nloc": 84, + "complexity": 50, + "token_count": 692, + "parameters": [ + "inputline" + ], + "start_line": 170, + "end_line": 254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 85, + "top_nesting_level": 0 + }, + { + "name": "callcrackfortran", + "long_name": "callcrackfortran( files , options )", + "filename": "f2py2e.py", + "nloc": 24, + "complexity": 6, + "token_count": 181, + "parameters": [ + "files", + "options" + ], + "start_line": 256, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "buildmodules", + "long_name": "buildmodules( list )", + "filename": "f2py2e.py", + "nloc": 29, + "complexity": 12, + "token_count": 315, + "parameters": [ + "list" + ], + "start_line": 281, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d_out , d_in )", + "filename": "f2py2e.py", + "nloc": 8, + "complexity": 4, + "token_count": 68, + "parameters": [ + "d_out", + "d_in" + ], + "start_line": 311, + "end_line": 318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "run_main", + "long_name": "run_main( comline_list )", + "filename": "f2py2e.py", + "nloc": 35, + "complexity": 15, + "token_count": 397, + "parameters": [ + "comline_list" + ], + "start_line": 320, + "end_line": 360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "filter_files", + "long_name": "filter_files( prefix , suffix , files , remove_prefix = None )", + "filename": "f2py2e.py", + "nloc": 11, + "complexity": 4, + "token_count": 95, + "parameters": [ + "prefix", + "suffix", + "files", + "remove_prefix" + ], + "start_line": 362, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "get_prefix", + "long_name": "get_prefix( module )", + "filename": "f2py2e.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "module" + ], + "start_line": 377, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "run_compile", + "long_name": "run_compile( )", + "filename": "f2py2e.py", + "nloc": 132, + "complexity": 34, + "token_count": 1097, + "parameters": [], + "start_line": 381, + "end_line": 537, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 157, + "top_nesting_level": 0 + }, + { + "name": "main", + "long_name": "main( )", + "filename": "f2py2e.py", + "nloc": 10, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 539, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 495, + "complexity": 129, + "token_count": 3030, + "diff_parsed": { + "added": [ + "numpy Version: %s" + ], + "deleted": [ + "numpy_core Version: %s" + ] + } + }, + { + "old_path": "numpy/lib/__init__.py", + "new_path": "numpy/lib/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -13,10 +13,20 @@\n from polynomial import *\n from machar import *\n from getlimits import *\n-import convertcode\n+#import convertcode\n from utils import *\n \n-__all__ = filter(lambda s:not s.startswith('_'),dir())\n+__all__ = []\n+__all__ += type_check.__all__\n+__all__ += index_tricks.__all__\n+__all__ += function_base.__all__\n+__all__ += shape_base.__all__\n+__all__ += twodim_base.__all__\n+__all__ += ufunclike.__all__\n+__all__ += polynomial.__all__\n+__all__ += machar.__all__\n+__all__ += getlimits.__all__\n+__all__ += utils.__all__\n \n from numpy.testing import ScipyTest \n test = ScipyTest().test\n", + "added_lines": 12, + "deleted_lines": 2, + "source_code": "\nfrom info import __doc__\nfrom numpy.version import version as __version__\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom twodim_base import *\nfrom ufunclike import *\n\nimport scimath as math\nfrom polynomial import *\nfrom machar import *\nfrom getlimits import *\n#import convertcode\nfrom utils import *\n\n__all__ = []\n__all__ += type_check.__all__\n__all__ += index_tricks.__all__\n__all__ += function_base.__all__\n__all__ += shape_base.__all__\n__all__ += twodim_base.__all__\n__all__ += ufunclike.__all__\n__all__ += polynomial.__all__\n__all__ += machar.__all__\n__all__ += getlimits.__all__\n__all__ += utils.__all__\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "source_code_before": "\nfrom info import __doc__\nfrom numpy.version import version as __version__\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom twodim_base import *\nfrom ufunclike import *\n\nimport scimath as math\nfrom polynomial import *\nfrom machar import *\nfrom getlimits import *\nimport convertcode\nfrom utils import *\n\n__all__ = filter(lambda s:not s.startswith('_'),dir())\n\nfrom numpy.testing import ScipyTest \ntest = ScipyTest().test\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 26, + "complexity": 0, + "token_count": 123, + "diff_parsed": { + "added": [ + "#import convertcode", + "__all__ = []", + "__all__ += type_check.__all__", + "__all__ += index_tricks.__all__", + "__all__ += function_base.__all__", + "__all__ += shape_base.__all__", + "__all__ += twodim_base.__all__", + "__all__ += ufunclike.__all__", + "__all__ += polynomial.__all__", + "__all__ += machar.__all__", + "__all__ += getlimits.__all__", + "__all__ += utils.__all__" + ], + "deleted": [ + "import convertcode", + "__all__ = filter(lambda s:not s.startswith('_'),dir())" + ] + } + }, + { + "old_path": "numpy/lib/function_base.py", + "new_path": "numpy/lib/function_base.py", + "filename": "function_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,7 +1,7 @@\n \n-l__all__ = ['logspace', 'linspace',\n+__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n- 'copy', 'iterable', 'base_repr', 'binary_repr', \n+ 'copy', 'iterable', #'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\n__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', #'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring',\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n asarray, empty, empty_like\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert, add_docstring\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\n## Code from cephes for i0\n\n_i0A = [\n-4.41534164647933937950E-18,\n 3.33079451882223809783E-17,\n-2.43127984654795469359E-16,\n 1.71539128555513303061E-15,\n-1.16853328779934516808E-14,\n 7.67618549860493561688E-14,\n-4.85644678311192946090E-13,\n 2.95505266312963983461E-12,\n-1.72682629144155570723E-11,\n 9.67580903537323691224E-11,\n-5.18979560163526290666E-10,\n 2.65982372468238665035E-9,\n-1.30002500998624804212E-8,\n 6.04699502254191894932E-8,\n-2.67079385394061173391E-7,\n 1.11738753912010371815E-6,\n-4.41673835845875056359E-6,\n 1.64484480707288970893E-5,\n-5.75419501008210370398E-5,\n 1.88502885095841655729E-4,\n-5.76375574538582365885E-4,\n 1.63947561694133579842E-3,\n-4.32430999505057594430E-3,\n 1.05464603945949983183E-2,\n-2.37374148058994688156E-2,\n 4.93052842396707084878E-2,\n-9.49010970480476444210E-2,\n 1.71620901522208775349E-1,\n-3.04682672343198398683E-1,\n 6.76795274409476084995E-1]\n\n_i0B = [\n-7.23318048787475395456E-18,\n-4.83050448594418207126E-18,\n 4.46562142029675999901E-17,\n 3.46122286769746109310E-17,\n-2.82762398051658348494E-16,\n-3.42548561967721913462E-16,\n 1.77256013305652638360E-15,\n 3.81168066935262242075E-15,\n-9.55484669882830764870E-15,\n-4.15056934728722208663E-14,\n 1.54008621752140982691E-14,\n 3.85277838274214270114E-13,\n 7.18012445138366623367E-13,\n-1.79417853150680611778E-12,\n-1.32158118404477131188E-11,\n-3.14991652796324136454E-11,\n 1.18891471078464383424E-11,\n 4.94060238822496958910E-10,\n 3.39623202570838634515E-9,\n 2.26666899049817806459E-8,\n 2.04891858946906374183E-7,\n 2.89137052083475648297E-6,\n 6.88975834691682398426E-5,\n 3.36911647825569408990E-3,\n 8.04490411014108831608E-1]\n\ndef _chbevl(x, vals):\n b0 = vals[0]\n b1 = 0.0\n\n for i in xrange(1,len(vals)):\n b2 = b1\n b1 = b0\n b0 = x*b1 - b2 + vals[i]\n\n return 0.5*(b0 - b2)\n \n\ndef _i0_1(x):\n return exp(x) * _chbevl(x/2.0-2, _i0A)\n\ndef _i0_2(x):\n return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n\ndef i0(x):\n x = atleast_1d(x)\n y = empty_like(x)\n ind = (x<0)\n x[ind] = -x[ind]\n ind = (x<=8.0)\n y[ind] = _i0_1(x[ind])\n ind2 = ~ind\n y[ind2] = _i0_2(x[ind2])\n return y.squeeze() \n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n\n#always succeed\ndef add_newdoc(place, obj, doc):\n try:\n new = {}\n exec 'from %s import %s' % (place, obj) in new\n if isinstance(doc, str):\n add_docstring(new[obj], doc.strip())\n elif isinstance(doc, tuple):\n add_docstring(getattr(new[obj], doc[0]), doc[1].strip())\n elif isinstance(doc, list):\n for val in doc:\n add_docstring(getattr(new[obj], val[0]), val[1].strip())\n except:\n pass\n", + "source_code_before": "\nl__all__ = ['logspace', 'linspace',\n 'select', 'piecewise', 'trim_zeros',\n 'copy', 'iterable', 'base_repr', 'binary_repr', \n 'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',\n 'unique', 'extract', 'insert', 'nansum', 'nanmax', 'nanargmax',\n 'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',\n 'histogram', 'bincount', 'digitize', 'cov', 'corrcoef', 'msort',\n 'median', 'sinc', 'hamming', 'hanning', 'bartlett', 'blackman',\n 'kaiser', 'trapz', 'i0', 'add_newdoc', 'add_docstring',\n ]\n\nimport types\nimport math\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import ones, zeros, arange, concatenate, array, \\\n asarray, empty, empty_like\nfrom numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar\nfrom numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \\\n frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp\nfrom numpy.core.oldnumeric import ravel, nonzero, choose, \\\n sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\\\n sort\nfrom type_check import ScalarType\nfrom shape_base import atleast_1d\nfrom twodim_base import diag\nfrom _compiled_base import digitize, bincount, _insert, add_docstring\n\n#end Fernando's utilities\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False):\n \"\"\"Return evenly spaced numbers.\n\n Return 'num' evenly spaced samples from 'start' to 'stop'. If\n 'endpoint' is True, the last sample is 'stop'. If 'retstep' is\n True then return the step value used.\n \"\"\"\n num = int(num)\n if num <= 0:\n return array([])\n if endpoint:\n if num == 1:\n return array([start])\n step = (stop-start)/float((num-1))\n else:\n step = (stop-start)/float(num)\n y = _nx.arange(0, num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef logspace(start,stop,num=50,endpoint=True,base=10.0):\n \"\"\"Evenly spaced numbers on a logarithmic scale.\n\n Computes int(num) evenly spaced exponents from start to stop.\n If endpoint=True, then last exponent is stop.\n Returns base**exponents.\n \"\"\"\n y = linspace(start,stop,num=num,endpoint=endpoint)\n return _nx.power(base,y)\n\ndef iterable(y):\n try: iter(y)\n except: return 0\n return 1\n\ndef histogram(a, bins=10, range=None, normed=False):\n a = asarray(a).ravel()\n if not iterable(bins):\n if range is None:\n range = (a.min(), a.max())\n mn, mx = [mi+0.0 for mi in range]\n if mn == mx:\n mn -= 0.5\n mx += 0.5\n bins = linspace(mn, mx, bins, endpoint=False)\n\n n = sort(a).searchsorted(bins)\n n = concatenate([n, [len(a)]])\n n = n[1:]-n[:-1]\n\n if normed:\n db = bins[1] - bins[0]\n return 1.0/(a.size*db) * n, bins\n else:\n return n, bins\n\ndef average(a, axis=0, weights=None, returned=False):\n \"\"\"average(a, axis=0, weights=None, returned=False)\n\n Average the array over the given axis. If the axis is None, average\n over all dimensions of the array. Equivalent to a.mean(axis), but\n with a default axis of 0 instead of None.\n\n If an integer axis is given, this equals:\n a.sum(axis) * 1.0 / len(a)\n\n If axis is None, this equals:\n a.sum(axis) * 1.0 / product(a.shape)\n\n If weights are given, result is:\n sum(a * weights) / sum(weights),\n where the weights must have a's shape or be 1D with length the \n size of a in the given axis. Integer weights are converted to \n Float. Not specifying weights is equivalent to specifying \n weights that are all 1.\n\n If 'returned' is True, return a tuple: the result and the sum of\n the weights or count of values. The shape of these two results\n will be the same.\n\n Raises ZeroDivisionError if appropriate. (The version in MA does\n not -- it returns masked values).\n \"\"\"\n if axis is None:\n a = array(a).ravel()\n if weights is None:\n n = add.reduce(a)\n d = len(a) * 1.0\n else:\n w = array(weights).ravel() * 1.0\n n = add.reduce(multiply(a, w))\n d = add.reduce(w) \n else:\n a = array(a)\n ash = a.shape\n if ash == ():\n a.shape = (1,)\n if weights is None:\n n = add.reduce(a, axis) \n d = ash[axis] * 1.0\n if returned:\n d = ones(n.shape) * d\n else:\n w = array(weights, copy=False) * 1.0\n wsh = w.shape\n if wsh == ():\n wsh = (1,)\n if wsh == ash:\n n = add.reduce(a*w, axis)\n d = add.reduce(w, axis) \n elif wsh == (ash[axis],):\n ni = ash[axis]\n r = [newaxis]*ni\n r[axis] = slice(None, None, 1)\n w1 = eval(\"w[\"+repr(tuple(r))+\"]*ones(ash, Float)\")\n n = add.reduce(a*w1, axis)\n d = add.reduce(w1, axis)\n else:\n raise ValueError, 'averaging weights have wrong shape'\n\n if not isinstance(d, ArrayType):\n if d == 0.0:\n raise ZeroDivisionError, 'zero denominator in average()'\n if returned:\n return n/d, d\n else:\n return n/d\n\ndef asarray_chkfinite(a):\n \"\"\"Like asarray, but check that no NaNs or Infs are present.\n \"\"\"\n a = asarray(a)\n if (a.dtypechar in _nx.typecodes['AllFloat']) \\\n and (_nx.isnan(a).any() or _nx.isinf(a).any()):\n raise ValueError, \"array must not contain infs or NaNs\"\n return a\n\ndef piecewise(x, condlist, funclist, *args, **kw):\n \"\"\"Return a piecewise-defined function.\n\n x is the domain\n\n condlist is a list of boolean arrays or a single boolean array\n The length of the condition list must be n2 or n2-1 where n2\n is the length of the function list. If len(condlist)==n2-1, then\n an 'otherwise' condition is formed by |'ing all the conditions\n and inverting. \n\n funclist is a list of functions to call of length (n2).\n Each function should return an array output for an array input\n Each function can take (the same set) of extra arguments and\n keyword arguments which are passed in after the function list.\n\n The output is the same shape and type as x and is found by\n calling the functions on the appropriate portions of x.\n\n Note: This is similar to choose or select, except\n the the functions are only evaluated on elements of x\n that satisfy the corresponding condition.\n\n The result is\n |--\n | f1(x) for condition1\n y = --| f2(x) for condition2\n | ...\n | fn(x) for conditionn\n |--\n\n \"\"\"\n n2 = len(funclist)\n if not isinstance(condlist, type([])):\n condlist = [condlist]\n n = len(condlist)\n if n == n2-1: # compute the \"otherwise\" condition.\n totlist = condlist[0]\n for k in range(1, n):\n totlist |= condlist\n condlist.append(~totlist)\n n += 1\n if (n != n2):\n raise ValueError, \"function list and condition list must be the same\"\n y = empty(x.shape, x.dtype)\n for k in range(n):\n item = funclist[k]\n if not callable(item):\n y[condlist[k]] = item\n else:\n y[condlist[k]] = item(x[condlist[k]], *args, **kw)\n return y\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Return an array composed of different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n\n choicelist is a list of choice arrays (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0, ..., cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0, ..., vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n\n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n\n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n\n Note that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"list of cases must be same length as list of conditions\"\n choicelist.insert(0, default)\n S = 0\n pfac = 1\n for k in range(1, n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k])\n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\ndef _asarray1d(arr, copy=False):\n \"\"\"Ensure 1D array for one array.\n \"\"\"\n if copy:\n return asarray(arr).flatten()\n else:\n return asarray(arr).ravel()\n\ndef copy(a):\n \"\"\"Return an array copy of the given object.\n \"\"\"\n return array(a, copy=True)\n\n# Basic operations\n\ndef gradient(f, *varargs):\n \"\"\"Calculate the gradient of an N-dimensional scalar function.\n\n Uses central differences on the interior and first differences on boundaries\n to give the same shape.\n\n Inputs:\n\n f -- An N-dimensional array giving samples of a scalar function\n\n varargs -- 0, 1, or N scalars giving the sample distances in each direction\n\n Outputs:\n\n N arrays of the same shape as f giving the derivative of f with respect\n to each dimension.\n \"\"\"\n N = len(f.shape) # number of dimensions\n n = len(varargs)\n if n==0:\n dx = [1.0]*N\n elif n==1:\n dx = [varargs[0]]*N\n elif n==N:\n dx = list(varargs)\n else:\n raise SyntaxError, \"invalid number of arguments\"\n\n # use central differences on interior and first differences on endpoints\n\n print dx\n outvals = []\n\n # create slice objects --- initially all are [:, :, ..., :]\n slice1 = [slice(None)]*N\n slice2 = [slice(None)]*N\n slice3 = [slice(None)]*N\n\n otype = f.dtypechar\n if otype not in ['f', 'd', 'F', 'D']:\n otype = 'd'\n\n for axis in range(N):\n # select out appropriate parts for this dimension\n out = zeros(f.shape, f.dtypechar)\n slice1[axis] = slice(1, -1)\n slice2[axis] = slice(2, None)\n slice3[axis] = slice(None, -2)\n # 1D equivalent -- out[1:-1] = (f[2:] - f[:-2])/2.0\n out[slice1] = (f[slice2] - f[slice3])/2.0 \n slice1[axis] = 0\n slice2[axis] = 1\n slice3[axis] = 0\n # 1D equivalent -- out[0] = (f[1] - f[0])\n out[slice1] = (f[slice2] - f[slice3])\n slice1[axis] = -1\n slice2[axis] = -1\n slice3[axis] = -2\n # 1D equivalent -- out[-1] = (f[-1] - f[-2])\n out[slice1] = (f[slice2] - f[slice3])\n\n # divide by step size\n outvals.append(out / dx[axis])\n\n # reset the slice object in this dimension to \":\"\n slice1[axis] = slice(None)\n slice2[axis] = slice(None)\n slice3[axis] = slice(None)\n\n if N == 1:\n return outvals[0]\n else:\n return outvals\n\n\ndef diff(a, n=1, axis=-1):\n \"\"\"Calculate the nth order discrete difference along given axis.\n \"\"\"\n if n==0:\n return a\n if n<0:\n raise ValueError, 'order must be non-negative but got ' + `n`\n a = asarray(a)\n nd = len(a.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1, None)\n slice2[axis] = slice(None, -1)\n slice1 = tuple(slice1)\n slice2 = tuple(slice2)\n if n > 1:\n return diff(a[slice1]-a[slice2], n-1, axis=axis)\n else:\n return a[slice1]-a[slice2]\n\ndef angle(z, deg=0):\n \"\"\"Return the angle of the complex argument z.\n \"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact\n\ndef unwrap(p, discont=pi, axis=-1):\n \"\"\"Unwrap radian phase p by changing absolute jumps greater than\n 'discont' to their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p, axis=axis)\n slice1 = [slice(None, None)]*nd # full slices\n slice1[axis] = slice(1, None)\n ddmod = mod(dd+pi, 2*pi)-pi\n _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)\n ph_correct = ddmod - dd;\n _nx.putmask(ph_correct, abs(dd)>> import numpy\n >>> a = array((0, 0, 0, 1, 2, 3, 2, 1, 0))\n >>> numpy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n trim = trim.upper()\n if 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\ndef unique(inseq):\n \"\"\"Return unique items from a 1-dimensional sequence.\n \"\"\"\n # Dictionary setting is quite fast.\n set = {}\n for item in inseq:\n set[item] = None\n return asarray(set.keys())\n\ndef extract(condition, arr):\n \"\"\"Return the elements of ravel(arr) where ravel(condition) is True\n (in 1D).\n\n Equivalent to compress(ravel(condition), ravel(arr)).\n \"\"\"\n return _nx.take(ravel(arr), nonzero(ravel(condition)))\n\ndef insert(arr, mask, vals):\n \"\"\"Similar to putmask arr[mask] = vals but the 1D array vals has the\n same number of elements as the non-zero values of mask. Inverse of\n extract.\n \"\"\"\n return _insert(arr, mask, vals)\n\ndef nansum(a, axis=-1):\n \"\"\"Sum the array over the given axis, treating NaNs as 0.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = 0\n return y.sum(axis)\n\ndef nanmin(a, axis=-1):\n \"\"\"Find the minimium over the given axis, ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.min(axis)\n\ndef nanargmin(a, axis=-1):\n \"\"\"Find the indices of the minimium over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = _nx.inf\n return y.argmin(axis)\n\ndef nanmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.max(axis)\n\ndef nanargmax(a, axis=-1):\n \"\"\"Find the maximum over the given axis ignoring NaNs.\n \"\"\"\n y = array(a)\n if not issubclass(y.dtype, _nx.integer):\n y[isnan(a)] = -_nx.inf\n return y.argmax(axis)\n\ndef disp(mesg, device=None, linefeed=True):\n \"\"\"Display a message to the given device (default is sys.stdout)\n with or without a linefeed.\n \"\"\"\n if device is None:\n import sys\n device = sys.stdout\n if linefeed:\n device.write('%s\\n' % mesg)\n else:\n device.write('%s' % mesg)\n device.flush()\n return\n\nclass vectorize(object):\n \"\"\"\n vectorize(somefunction, otypes=None, doc=None)\n Generalized Function class.\n\n Description:\n\n Define a vectorized function which takes nested sequence\n objects or numpy arrays as inputs and returns a\n numpy array as output, evaluating the function over successive\n tuples of the input arrays like the python map function except it uses\n the broadcasting rules of numpy.\n\n Input:\n\n somefunction -- a Python function or method\n\n Example:\n\n def myfunc(a, b):\n if a > b:\n return a-b\n else\n return a+b\n\n vfunc = vectorize(myfunc)\n\n >>> vfunc([1, 2, 3, 4], 2)\n array([3, 4, 1, 2])\n\n \"\"\"\n def __init__(self, pyfunc, otypes='', doc=None):\n try:\n fcode = pyfunc.func_code\n except AttributeError:\n raise TypeError, \"object is not a callable Python object\"\n\n self.thefunc = pyfunc\n self.ufunc = None\n self.nin = fcode.co_argcount\n if pyfunc.func_defaults:\n self.nin_wo_defaults = self.nin - len(pyfunc.func_defaults)\n else:\n self.nin_wo_defaults = self.nin\n self.nout = None\n if doc is None:\n self.__doc__ = pyfunc.__doc__\n else:\n self.__doc__ = doc\n if isinstance(otypes, types.StringType):\n self.otypes=otypes\n else:\n raise ValueError, \"output types must be a string\"\n for char in self.otypes:\n if char not in typecodes['All']:\n raise ValueError, \"invalid typecode specified\"\n self.lastcallargs = 0\n\n def __call__(self, *args):\n # get number of outputs and output types by calling\n # the function on the first entries of args\n nargs = len(args)\n if (nargs > self.nin) or (nargs < self.nin_wo_defaults):\n raise ValueError, \"mismatch between python function inputs\"\\\n \" and received arguments\"\n if self.nout is None or self.otypes == '':\n newargs = []\n for arg in args:\n newargs.append(asarray(arg).flat[0])\n theout = self.thefunc(*newargs)\n if isinstance(theout, types.TupleType):\n self.nout = len(theout)\n else:\n self.nout = 1\n theout = (theout,)\n if self.otypes == '':\n otypes = []\n for k in range(self.nout):\n otypes.append(asarray(theout[k]).dtypechar)\n self.otypes = ''.join(otypes)\n\n if (self.ufunc is None) or (self.lastcallargs != nargs):\n self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)\n self.lastcallargs = nargs\n\n if self.nout == 1:\n return self.ufunc(*args).astype(self.otypes[0])\n else:\n return tuple([x.astype(c) for x, c in zip(self.ufunc(*args), self.otypes)])\n\ndef cov(m,y=None, rowvar=0, bias=0):\n \"\"\"Estimate the covariance matrix.\n \n If m is a vector, return the variance. For matrices where each row\n is an observation, and each column a variable, return the covariance\n matrix. Note that in this case diag(cov(m)) is a vector of\n variances for each column.\n\n cov(m) is the same as cov(m, m)\n\n Normalization is by (N-1) where N is the number of observations\n (unbiased estimate). If bias is 1 then normalization is by N.\n\n If rowvar is zero, then each row is a variable with\n observations in the columns.\n \"\"\"\n if y is None:\n y = asarray(m)\n else:\n y = asarray(y)\n m = asarray(m)\n if rowvar:\n m = m.transpose()\n y = y.transpose()\n if (m.shape[0] == 1):\n m = m.transpose()\n if (y.shape[0] == 1):\n y = y.transpose()\n N = m.shape[0]\n if (y.shape[0] != N):\n raise ValueError, \"x and y must have the same number of observations.\"\n m = m - m.mean(axis=0)\n y = y - y.mean(axis=0)\n if bias:\n fact = N*1.0\n else:\n fact = N-1.0\n\n val = squeeze(dot(m.transpose(),y.conj()) / fact)\n return val\n\ndef corrcoef(x, y=None):\n \"\"\"The correlation coefficients\n \"\"\"\n c = cov(x, y)\n d = diag(c)\n return c/sqrt(multiply.outer(d,d))\n\ndef blackman(M):\n \"\"\"blackman(M) returns the M-point Blackman window.\n \"\"\"\n n = arange(0,M)\n return 0.42-0.5*cos(2.0*pi*n/(M-1)) + 0.08*cos(4.0*pi*n/(M-1))\n\ndef bartlett(M):\n \"\"\"bartlett(M) returns the M-point Bartlett window.\n \"\"\"\n n = arange(0,M)\n return where(less_equal(n,(M-1)/2.0),2.0*n/(M-1),2.0-2.0*n/(M-1))\n\ndef hanning(M):\n \"\"\"hanning(M) returns the M-point Hanning window.\n \"\"\"\n n = arange(0,M)\n return 0.5-0.5*cos(2.0*pi*n/(M-1))\n\ndef hamming(M):\n \"\"\"hamming(M) returns the M-point Hamming window.\n \"\"\"\n n = arange(0,M)\n return 0.54-0.46*cos(2.0*pi*n/(M-1))\n\n## Code from cephes for i0\n\n_i0A = [\n-4.41534164647933937950E-18,\n 3.33079451882223809783E-17,\n-2.43127984654795469359E-16,\n 1.71539128555513303061E-15,\n-1.16853328779934516808E-14,\n 7.67618549860493561688E-14,\n-4.85644678311192946090E-13,\n 2.95505266312963983461E-12,\n-1.72682629144155570723E-11,\n 9.67580903537323691224E-11,\n-5.18979560163526290666E-10,\n 2.65982372468238665035E-9,\n-1.30002500998624804212E-8,\n 6.04699502254191894932E-8,\n-2.67079385394061173391E-7,\n 1.11738753912010371815E-6,\n-4.41673835845875056359E-6,\n 1.64484480707288970893E-5,\n-5.75419501008210370398E-5,\n 1.88502885095841655729E-4,\n-5.76375574538582365885E-4,\n 1.63947561694133579842E-3,\n-4.32430999505057594430E-3,\n 1.05464603945949983183E-2,\n-2.37374148058994688156E-2,\n 4.93052842396707084878E-2,\n-9.49010970480476444210E-2,\n 1.71620901522208775349E-1,\n-3.04682672343198398683E-1,\n 6.76795274409476084995E-1]\n\n_i0B = [\n-7.23318048787475395456E-18,\n-4.83050448594418207126E-18,\n 4.46562142029675999901E-17,\n 3.46122286769746109310E-17,\n-2.82762398051658348494E-16,\n-3.42548561967721913462E-16,\n 1.77256013305652638360E-15,\n 3.81168066935262242075E-15,\n-9.55484669882830764870E-15,\n-4.15056934728722208663E-14,\n 1.54008621752140982691E-14,\n 3.85277838274214270114E-13,\n 7.18012445138366623367E-13,\n-1.79417853150680611778E-12,\n-1.32158118404477131188E-11,\n-3.14991652796324136454E-11,\n 1.18891471078464383424E-11,\n 4.94060238822496958910E-10,\n 3.39623202570838634515E-9,\n 2.26666899049817806459E-8,\n 2.04891858946906374183E-7,\n 2.89137052083475648297E-6,\n 6.88975834691682398426E-5,\n 3.36911647825569408990E-3,\n 8.04490411014108831608E-1]\n\ndef _chbevl(x, vals):\n b0 = vals[0]\n b1 = 0.0\n\n for i in xrange(1,len(vals)):\n b2 = b1\n b1 = b0\n b0 = x*b1 - b2 + vals[i]\n\n return 0.5*(b0 - b2)\n \n\ndef _i0_1(x):\n return exp(x) * _chbevl(x/2.0-2, _i0A)\n\ndef _i0_2(x):\n return exp(x) * _chbevl(32.0/x - 2.0, _i0B) / sqrt(x)\n\ndef i0(x):\n x = atleast_1d(x)\n y = empty_like(x)\n ind = (x<0)\n x[ind] = -x[ind]\n ind = (x<=8.0)\n y[ind] = _i0_1(x[ind])\n ind2 = ~ind\n y[ind2] = _i0_2(x[ind2])\n return y.squeeze() \n\ndef kaiser(M,beta):\n \"\"\"kaiser(M, beta) returns a Kaiser window of length M with shape parameter\n beta. It depends on numpy.special (in full numpy) for the modified bessel\n function i0.\n \"\"\"\n from numpy.dual import i0\n n = arange(0,M)\n alpha = (M-1)/2.0\n return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)\n\ndef sinc(x):\n \"\"\"sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.\n \"\"\"\n y = pi* where(x == 0, 1.0e-20, x)\n return sin(y)/y\n\ndef msort(a):\n b = array(a,copy=True)\n b.sort(0)\n return b\n\ndef median(m):\n \"\"\"median(m) returns a median of m along the first dimension of m.\n \"\"\"\n sorted = msort(m)\n if sorted.shape[0] % 2 == 1:\n return sorted[int(sorted.shape[0]/2)]\n else:\n sorted = msort(m)\n index=sorted.shape[0]/2\n return (sorted[index-1]+sorted[index])/2.0\n\ndef trapz(y, x=None, dx=1.0, axis=-1):\n \"\"\"Integrate y(x) using samples along the given axis and the composite\n trapezoidal rule. If x is None, spacing given by dx is assumed.\n \"\"\"\n y = asarray(y)\n if x is None:\n d = dx\n else:\n d = diff(x,axis=axis)\n nd = len(y.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)\n\n#always succeed\ndef add_newdoc(place, obj, doc):\n try:\n new = {}\n exec 'from %s import %s' % (place, obj) in new\n if isinstance(doc, str):\n add_docstring(new[obj], doc.strip())\n elif isinstance(doc, tuple):\n add_docstring(getattr(new[obj], doc[0]), doc[1].strip())\n elif isinstance(doc, list):\n for val in doc:\n add_docstring(getattr(new[obj], val[0]), val[1].strip())\n except:\n pass\n", + "methods": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 32, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 54, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 69, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 90, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 171, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 224, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 280, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 287, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 362, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 382, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 398, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 415, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 433, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 455, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 464, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 472, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 487, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 495, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 503, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 519, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 564, + "end_line": 589, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 591, + "end_line": 621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 623, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 664, + "end_line": 669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 671, + "end_line": 675, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 677, + "end_line": 681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 683, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 689, + "end_line": 693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 795, + "end_line": 799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 801, + "end_line": 804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 806, + "end_line": 815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 817, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "add_newdoc", + "long_name": "add_newdoc( place , obj , doc )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 6, + "token_count": 118, + "parameters": [ + "place", + "obj", + "doc" + ], + "start_line": 834, + "end_line": 846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = True , retstep = False )", + "filename": "function_base.py", + "nloc": 15, + "complexity": 5, + "token_count": 107, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 32, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = True , base = 10 . 0 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 47, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "base" + ], + "start_line": 54, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "iterable", + "long_name": "iterable( y )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 2, + "token_count": 17, + "parameters": [ + "y" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "histogram", + "long_name": "histogram( a , bins = 10 , range = None , normed = False )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 6, + "token_count": 174, + "parameters": [ + "a", + "bins", + "range", + "normed" + ], + "start_line": 69, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "average", + "long_name": "average( a , axis = 0 , weights = None , returned = False )", + "filename": "function_base.py", + "nloc": 44, + "complexity": 12, + "token_count": 334, + "parameters": [ + "a", + "axis", + "weights", + "returned" + ], + "start_line": 90, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 71, + "top_nesting_level": 0 + }, + { + "name": "asarray_chkfinite", + "long_name": "asarray_chkfinite( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 4, + "token_count": 57, + "parameters": [ + "a" + ], + "start_line": 162, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "piecewise", + "long_name": "piecewise( x , condlist , funclist , * args , ** kw )", + "filename": "function_base.py", + "nloc": 21, + "complexity": 7, + "token_count": 163, + "parameters": [ + "x", + "condlist", + "funclist", + "args", + "kw" + ], + "start_line": 171, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 52, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 224, + "end_line": 270, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "_asarray1d", + "long_name": "_asarray1d( arr , copy = False )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "arr", + "copy" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "copy", + "long_name": "copy( a )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "a" + ], + "start_line": 280, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "gradient", + "long_name": "gradient( f , * varargs )", + "filename": "function_base.py", + "nloc": 41, + "complexity": 7, + "token_count": 325, + "parameters": [ + "f", + "varargs" + ], + "start_line": 287, + "end_line": 359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 73, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( a , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 17, + "complexity": 4, + "token_count": 142, + "parameters": [ + "a", + "n", + "axis" + ], + "start_line": 362, + "end_line": 380, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 72, + "parameters": [ + "z", + "deg" + ], + "start_line": 382, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 150, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 398, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 4, + "token_count": 75, + "parameters": [ + "a" + ], + "start_line": 415, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 7, + "token_count": 86, + "parameters": [ + "filt", + "trim" + ], + "start_line": 433, + "end_line": 453, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "unique", + "long_name": "unique( inseq )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 30, + "parameters": [ + "inseq" + ], + "start_line": 455, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "extract", + "long_name": "extract( condition , arr )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 26, + "parameters": [ + "condition", + "arr" + ], + "start_line": 464, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "insert", + "long_name": "insert( arr , mask , vals )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "arr", + "mask", + "vals" + ], + "start_line": 472, + "end_line": 477, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "nansum", + "long_name": "nansum( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 46, + "parameters": [ + "a", + "axis" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmin", + "long_name": "nanmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 487, + "end_line": 493, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmin", + "long_name": "nanargmin( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 48, + "parameters": [ + "a", + "axis" + ], + "start_line": 495, + "end_line": 501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanmax", + "long_name": "nanmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 503, + "end_line": 509, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "nanargmax", + "long_name": "nanargmax( a , axis = - 1 )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 49, + "parameters": [ + "a", + "axis" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "disp", + "long_name": "disp( mesg , device = None , linefeed = True )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 3, + "token_count": 53, + "parameters": [ + "mesg", + "device", + "linefeed" + ], + "start_line": 519, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , pyfunc , otypes = '' , doc = None )", + "filename": "function_base.py", + "nloc": 25, + "complexity": 7, + "token_count": 144, + "parameters": [ + "self", + "pyfunc", + "otypes", + "doc" + ], + "start_line": 564, + "end_line": 589, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "function_base.py", + "nloc": 27, + "complexity": 13, + "token_count": 254, + "parameters": [ + "self", + "args" + ], + "start_line": 591, + "end_line": 621, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "cov", + "long_name": "cov( m , y = None , rowvar = 0 , bias = 0 )", + "filename": "function_base.py", + "nloc": 24, + "complexity": 7, + "token_count": 188, + "parameters": [ + "m", + "y", + "rowvar", + "bias" + ], + "start_line": 623, + "end_line": 662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 40, + "top_nesting_level": 0 + }, + { + "name": "corrcoef", + "long_name": "corrcoef( x , y = None )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 664, + "end_line": 669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "blackman", + "long_name": "blackman( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 671, + "end_line": 675, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "bartlett", + "long_name": "bartlett( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 60, + "parameters": [ + "M" + ], + "start_line": 677, + "end_line": 681, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hanning", + "long_name": "hanning( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 683, + "end_line": 687, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "hamming", + "long_name": "hamming( M )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 39, + "parameters": [ + "M" + ], + "start_line": 689, + "end_line": 693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "_chbevl", + "long_name": "_chbevl( x , vals )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 59, + "parameters": [ + "x", + "vals" + ], + "start_line": 756, + "end_line": 765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "_i0_1", + "long_name": "_i0_1( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "x" + ], + "start_line": 768, + "end_line": 769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "_i0_2", + "long_name": "_i0_2( x )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 771, + "end_line": 772, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "i0", + "long_name": "i0( x )", + "filename": "function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 77, + "parameters": [ + "x" + ], + "start_line": 774, + "end_line": 783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "kaiser", + "long_name": "kaiser( M , beta )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "M", + "beta" + ], + "start_line": 785, + "end_line": 793, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "sinc", + "long_name": "sinc( x )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "x" + ], + "start_line": 795, + "end_line": 799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "msort", + "long_name": "msort( a )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "a" + ], + "start_line": 801, + "end_line": 804, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "median", + "long_name": "median( m )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 75, + "parameters": [ + "m" + ], + "start_line": 806, + "end_line": 815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "trapz", + "long_name": "trapz( y , x = None , dx = 1 . 0 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 2, + "token_count": 123, + "parameters": [ + "y", + "x", + "dx", + "axis" + ], + "start_line": 817, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "add_newdoc", + "long_name": "add_newdoc( place , obj , doc )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 6, + "token_count": 118, + "parameters": [ + "place", + "obj", + "doc" + ], + "start_line": 834, + "end_line": 846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 561, + "complexity": 140, + "token_count": 4411, + "diff_parsed": { + "added": [ + "__all__ = ['logspace', 'linspace',", + " 'copy', 'iterable', #'base_repr', 'binary_repr'," + ], + "deleted": [ + "l__all__ = ['logspace', 'linspace',", + " 'copy', 'iterable', 'base_repr', 'binary_repr'," + ] + } + }, + { + "old_path": "numpy/lib/tests/test_index_tricks.py", + "new_path": "numpy/lib/tests/test_index_tricks.py", + "filename": "test_index_tricks.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -2,6 +2,7 @@\n from numpy.testing import *\n set_package_path()\n import numpy.lib;reload(numpy.lib)\n+from numpy import *\n from numpy.lib import *\n restore_path()\n \n", + "added_lines": 1, + "deleted_lines": 0, + "source_code": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.lib;reload(numpy.lib)\nfrom numpy import *\nfrom numpy.lib import *\nrestore_path()\n\nclass test_grid(ScipyTestCase):\n def check_basic(self):\n a = mgrid[-1:1:10j]\n b = mgrid[-1:1:0.1]\n assert(a.shape == (10,))\n assert(b.shape == (20,))\n assert(a[0] == -1)\n assert_almost_equal(a[-1],1)\n assert(b[0] == -1)\n assert_almost_equal(b[1]-b[0],0.1,11)\n assert_almost_equal(b[-1],b[0]+19*0.1,11)\n assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n\n def check_nd(self):\n c = mgrid[-1:1:10j,-2:2:10j]\n d = mgrid[-1:1:0.1,-2:2:0.2]\n assert(c.shape == (2,10,10))\n assert(d.shape == (2,20,20))\n assert_array_equal(c[0][0,:],-ones(10,'d'))\n assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n\nclass test_concatenator(ScipyTestCase):\n def check_1d(self):\n assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n b = ones(5)\n c = r_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n\n def check_2d(self):\n b = rand(5,5)\n c = rand(5,5)\n d = r_[b,c,'1'] # append columns\n assert(d.shape == (5,10))\n assert_array_equal(d[:,:5],b)\n assert_array_equal(d[:,5:],c)\n d = r_[b,c]\n assert(d.shape == (10,5))\n assert_array_equal(d[:5,:],b)\n assert_array_equal(d[5:,:],c)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "\nfrom numpy.testing import *\nset_package_path()\nimport numpy.lib;reload(numpy.lib)\nfrom numpy.lib import *\nrestore_path()\n\nclass test_grid(ScipyTestCase):\n def check_basic(self):\n a = mgrid[-1:1:10j]\n b = mgrid[-1:1:0.1]\n assert(a.shape == (10,))\n assert(b.shape == (20,))\n assert(a[0] == -1)\n assert_almost_equal(a[-1],1)\n assert(b[0] == -1)\n assert_almost_equal(b[1]-b[0],0.1,11)\n assert_almost_equal(b[-1],b[0]+19*0.1,11)\n assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n\n def check_nd(self):\n c = mgrid[-1:1:10j,-2:2:10j]\n d = mgrid[-1:1:0.1,-2:2:0.2]\n assert(c.shape == (2,10,10))\n assert(d.shape == (2,20,20))\n assert_array_equal(c[0][0,:],-ones(10,'d'))\n assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n\nclass test_concatenator(ScipyTestCase):\n def check_1d(self):\n assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n b = ones(5)\n c = r_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n\n def check_2d(self):\n b = rand(5,5)\n c = rand(5,5)\n d = r_[b,c,'1'] # append columns\n assert(d.shape == (5,10))\n assert_array_equal(d[:,:5],b)\n assert_array_equal(d[:,5:],c)\n d = r_[b,c]\n assert(d.shape == (10,5))\n assert_array_equal(d[:5,:],b)\n assert_array_equal(d[5:,:],c)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 10, + "end_line": 20, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 22, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 35, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 111, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 51, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 9, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 21, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 34, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 111, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 48, + "complexity": 4, + "token_count": 628, + "diff_parsed": { + "added": [ + "from numpy import *" + ], + "deleted": [] + } + }, + { + "old_path": "numpy/lib/tests/test_twodim_base.py", + "new_path": "numpy/lib/tests/test_twodim_base.py", + "filename": "test_twodim_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -5,6 +5,7 @@\n from numpy.testing import *\n set_package_path()\n import numpy.lib;reload(numpy.lib)\n+from numpy import *\n from numpy.lib import *\n restore_path()\n \n", + "added_lines": 1, + "deleted_lines": 0, + "source_code": "\"\"\" Test functions for matrix module\n\n\"\"\"\n\nfrom numpy.testing import *\nset_package_path()\nimport numpy.lib;reload(numpy.lib)\nfrom numpy import *\nfrom numpy.lib import *\nrestore_path()\n\n##################################################\n\n\ndef get_mat(n):\n data = arange(n)\n data = add.outer(data,data)\n return data\n\nclass test_eye(ScipyTestCase):\n def check_basic(self):\n\tassert_equal(eye(4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]]))\n assert_equal(eye(4,dtype='f'),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]],'f'))\n def check_diag(self):\n assert_equal(eye(4,k=1),array([[0,1,0,0],\n [0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,k=-1),array([[0,0,0,0],\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]]))\n def check_2d(self):\n assert_equal(eye(4,3),array([[1,0,0],\n [0,1,0],\n [0,0,1],\n [0,0,0]]))\n assert_equal(eye(3,4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]])) \n def check_diag2d(self):\n assert_equal(eye(3,4,k=2),array([[0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,3,k=-2),array([[0,0,0],\n [0,0,0],\n [1,0,0],\n [0,1,0]]))\n\nclass test_diag(ScipyTestCase):\n def check_vector(self):\n vals = (100*arange(5)).astype('l')\n b = zeros((5,5))\n for k in range(5):\n b[k,k] = vals[k]\n assert_equal(diag(vals),b)\n b = zeros((7,7))\n c = b.copy()\n for k in range(5):\n b[k,k+2] = vals[k]\n c[k+2,k] = vals[k]\n assert_equal(diag(vals,k=2), b)\n assert_equal(diag(vals,k=-2), c)\n\n def check_matrix(self):\n vals = (100*get_mat(5)+1).astype('l')\n b = zeros((5,))\n for k in range(5):\n b[k] = vals[k,k]\n assert_equal(diag(vals),b)\n b = b*0\n for k in range(3):\n b[k] = vals[k,k+2]\n assert_equal(diag(vals,2),b[:3])\n for k in range(3):\n b[k] = vals[k+2,k]\n assert_equal(diag(vals,-2),b[:3])\n\nclass test_fliplr(ScipyTestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, fliplr, ones(4))\n a = get_mat(4)\n b = a[:,::-1]\n assert_equal(fliplr(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[2,1,0],\n [5,4,3]]\n assert_equal(fliplr(a),b)\n\nclass test_flipud(ScipyTestCase):\n def check_basic(self):\n a = get_mat(4)\n b = a[::-1,:]\n assert_equal(flipud(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[3,4,5],\n [0,1,2]]\n assert_equal(flipud(a),b)\n\nclass test_rot90(ScipyTestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, rot90, ones(4))\n\n a = [[0,1,2],\n [3,4,5]]\n b1 = [[2,5],\n [1,4],\n [0,3]]\n b2 = [[5,4,3],\n [2,1,0]]\n b3 = [[3,0],\n [4,1],\n [5,2]]\n b4 = [[0,1,2],\n [3,4,5]]\n\n for k in range(-3,13,4):\n assert_equal(rot90(a,k=k),b1)\n for k in range(-2,13,4):\n assert_equal(rot90(a,k=k),b2)\n for k in range(-1,13,4):\n assert_equal(rot90(a,k=k),b3)\n for k in range(0,13,4):\n assert_equal(rot90(a,k=k),b4)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "source_code_before": "\"\"\" Test functions for matrix module\n\n\"\"\"\n\nfrom numpy.testing import *\nset_package_path()\nimport numpy.lib;reload(numpy.lib)\nfrom numpy.lib import *\nrestore_path()\n\n##################################################\n\n\ndef get_mat(n):\n data = arange(n)\n data = add.outer(data,data)\n return data\n\nclass test_eye(ScipyTestCase):\n def check_basic(self):\n\tassert_equal(eye(4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]]))\n assert_equal(eye(4,dtype='f'),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]],'f'))\n def check_diag(self):\n assert_equal(eye(4,k=1),array([[0,1,0,0],\n [0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,k=-1),array([[0,0,0,0],\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]]))\n def check_2d(self):\n assert_equal(eye(4,3),array([[1,0,0],\n [0,1,0],\n [0,0,1],\n [0,0,0]]))\n assert_equal(eye(3,4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]])) \n def check_diag2d(self):\n assert_equal(eye(3,4,k=2),array([[0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,3,k=-2),array([[0,0,0],\n [0,0,0],\n [1,0,0],\n [0,1,0]]))\n\nclass test_diag(ScipyTestCase):\n def check_vector(self):\n vals = (100*arange(5)).astype('l')\n b = zeros((5,5))\n for k in range(5):\n b[k,k] = vals[k]\n assert_equal(diag(vals),b)\n b = zeros((7,7))\n c = b.copy()\n for k in range(5):\n b[k,k+2] = vals[k]\n c[k+2,k] = vals[k]\n assert_equal(diag(vals,k=2), b)\n assert_equal(diag(vals,k=-2), c)\n\n def check_matrix(self):\n vals = (100*get_mat(5)+1).astype('l')\n b = zeros((5,))\n for k in range(5):\n b[k] = vals[k,k]\n assert_equal(diag(vals),b)\n b = b*0\n for k in range(3):\n b[k] = vals[k,k+2]\n assert_equal(diag(vals,2),b[:3])\n for k in range(3):\n b[k] = vals[k+2,k]\n assert_equal(diag(vals,-2),b[:3])\n\nclass test_fliplr(ScipyTestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, fliplr, ones(4))\n a = get_mat(4)\n b = a[:,::-1]\n assert_equal(fliplr(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[2,1,0],\n [5,4,3]]\n assert_equal(fliplr(a),b)\n\nclass test_flipud(ScipyTestCase):\n def check_basic(self):\n a = get_mat(4)\n b = a[::-1,:]\n assert_equal(flipud(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[3,4,5],\n [0,1,2]]\n assert_equal(flipud(a),b)\n\nclass test_rot90(ScipyTestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, rot90, ones(4))\n\n a = [[0,1,2],\n [3,4,5]]\n b1 = [[2,5],\n [1,4],\n [0,3]]\n b2 = [[5,4,3],\n [2,1,0]]\n b3 = [[3,0],\n [4,1],\n [5,2]]\n b4 = [[0,1,2],\n [3,4,5]]\n\n for k in range(-3,13,4):\n assert_equal(rot90(a,k=k),b1)\n for k in range(-2,13,4):\n assert_equal(rot90(a,k=k),b2)\n for k in range(-1,13,4):\n assert_equal(rot90(a,k=k),b3)\n for k in range(0,13,4):\n assert_equal(rot90(a,k=k),b4)\n\nif __name__ == \"__main__\":\n ScipyTest().run()\n", + "methods": [ + { + "name": "get_mat", + "long_name": "get_mat( n )", + "filename": "test_twodim_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "n" + ], + "start_line": 15, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 21, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_diag", + "long_name": "check_diag( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 118, + "parameters": [ + "self" + ], + "start_line": 30, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_twodim_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_diag2d", + "long_name": "check_diag2d( self )", + "filename": "test_twodim_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 104, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_vector", + "long_name": "check_vector( self )", + "filename": "test_twodim_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 136, + "parameters": [ + "self" + ], + "start_line": 57, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_matrix", + "long_name": "check_matrix( self )", + "filename": "test_twodim_base.py", + "nloc": 13, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self" + ], + "start_line": 71, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 86, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 77, + "parameters": [ + "self" + ], + "start_line": 98, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 22, + "complexity": 5, + "token_count": 220, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "get_mat", + "long_name": "get_mat( n )", + "filename": "test_twodim_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "n" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 20, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_diag", + "long_name": "check_diag( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 118, + "parameters": [ + "self" + ], + "start_line": 29, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_twodim_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 38, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_diag2d", + "long_name": "check_diag2d( self )", + "filename": "test_twodim_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 104, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_vector", + "long_name": "check_vector( self )", + "filename": "test_twodim_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 136, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_matrix", + "long_name": "check_matrix( self )", + "filename": "test_twodim_base.py", + "nloc": 13, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self" + ], + "start_line": 70, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 85, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 77, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_twodim_base.py", + "nloc": 22, + "complexity": 5, + "token_count": 220, + "parameters": [ + "self" + ], + "start_line": 108, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 121, + "complexity": 19, + "token_count": 1201, + "diff_parsed": { + "added": [ + "from numpy import *" + ], + "deleted": [] + } + } + ] + } +] \ No newline at end of file